From b154f7552389315c13e942c07d75ecd1a0afb6a0 Mon Sep 17 00:00:00 2001 From: Alexey Shchepin Date: Thu, 27 Nov 2003 20:16:10 +0000 Subject: [PATCH] * examples/mtr/ejabberd.cfg: Updatted (thanks to Marshall T. Rose) * src/ejabberd_auth.erl: LDAP attribute that holds user ID now configurable * src/ejabberd.cfg.example: Updated SVN Revision: 178 --- ChangeLog | 8 +++++ examples/mtr/ejabberd.cfg | 64 ++++++++++++++++++++------------------- src/ejabberd.cfg.example | 1 + src/ejabberd_auth.erl | 3 +- 4 files changed, 44 insertions(+), 32 deletions(-) diff --git a/ChangeLog b/ChangeLog index c36079fc0..9b16540ca 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2003-11-27 Alexey Shchepin + + * examples/mtr/ejabberd.cfg: Updatted (thanks to Marshall T. Rose) + + * src/ejabberd_auth.erl: LDAP attribute that holds user ID now + configurable + * src/ejabberd.cfg.example: Updated + 2003-11-26 Alexey Shchepin * src/ejabberd_c2s.erl: Fixed processing of presence probe from diff --git a/examples/mtr/ejabberd.cfg b/examples/mtr/ejabberd.cfg index 759810e85..6f4f4b284 100644 --- a/examples/mtr/ejabberd.cfg +++ b/examples/mtr/ejabberd.cfg @@ -1,42 +1,44 @@ -% $Id$ +% jabber.dbc.mtview.ca.us override_acls. {acl, admin, {user, "mrose", "jabber.dbc.mtview.ca.us"}}. -{acl, jabberorg, {server, "jabber.org"}}. -{acl, mrose, {user, "mrose", "jabber.dbc.mtview.ca.us"}}. + +{access, announce, [{allow, admin}, + {deny, all}]}. +{access, c2s, [{deny, blocked}, + {allow, all}]}. +{access, c2s_shaper, [{none, admin}, + {normal, all}]}. +{access, configure, [{allow, admin}, + {deny, all}]}. +{access, disco_admin, [{allow, admin}, + {deny, all}]}. +{access, muc_admin, [{allow, admin}, + {deny, all}]}. +{access, register, [{deny, all}]}. +{access, s2s_shaper, [{fast, all}]}. -{shaper, normal, {maxrate, 1000}}. +{auth_method, internal}. +{host, "jabber.dbc.mtview.ca.us"}. +{outgoing_s2s_port, 5269}. +{shaper, normal, {maxrate, 1000}}. +{shaper, fast, {maxrate, 50000}}. +{welcome_message, none}. -{access, disco_admin, [{allow, admin}, - {deny, all}]}. +{listen, [{5222, ejabberd_c2s, + [{access, c2s}, + {shaper, c2s_shaper}]}, + {5223, ejabberd_c2s, + [{access, c2s}, + {shaper, c2s_shaper}, + {ssl, [{certfile, "/etc/openssl/certs/ejabberd.pem"}]}]}, + {5269, ejabberd_s2s_in, + [{shaper, s2s_shaper}]}]}. -{access, configure, [{allow, admin}]}. - -{access, c2s, [{deny, blocked}, - {allow, all}]}. - - -{access, c2s_shaper, [{none, admin}, - {normal, all}]}. - -{access, muc_admin, [{allow, admin}]}. - - -{host, "jabber.dbc.mtview.ca.us"}. - -{listen, [{5222, ejabberd_c2s, [{access, c2s}, - {shaper, c2s_shaper}]}, - {5223, ejabberd_c2s, [{access, c2s}, - {ssl, [{certfile, "/etc/openssl/certs/ejabberd.pem"}]}]}, - {5269, ejabberd_s2s_in, []} - ]}. - -% This value (5569) is only for debugging, must be 5269 -{outgoing_s2s_port, 5269}. {modules, [ {mod_register, []}, @@ -52,13 +54,13 @@ override_acls. % {mod_irc, []}, {mod_muc, []}, {mod_pubsub, []}, - {mod_time, [{iqdisc, no_queue}]}, + {mod_time, []}, + {mod_last, []}, {mod_version, []} ]}. - % Local Variables: % mode: erlang % End: diff --git a/src/ejabberd.cfg.example b/src/ejabberd.cfg.example index baf46eae1..a4cd2c62b 100644 --- a/src/ejabberd.cfg.example +++ b/src/ejabberd.cfg.example @@ -69,6 +69,7 @@ % For LDAP uthentification use these lines instead of above one: %{auth_method, ldap}. %{ldap_servers, ["localhost"]}. % List of LDAP servers +%{ldap_uidattr, "uid"}. % LDAP attribute that holds user ID %{ldap_base, "dc=example,dc=com"}. % Base of LDAP directory diff --git a/src/ejabberd_auth.erl b/src/ejabberd_auth.erl index be7da007b..48c4edf8b 100644 --- a/src/ejabberd_auth.erl +++ b/src/ejabberd_auth.erl @@ -343,7 +343,8 @@ is_user_exists_ldap(User) -> end. find_user_dn(User) -> - Filter = eldap:equalityMatch("uid", User), + Attr = ejabberd_config:get_local_option(ldap_uidattr), + Filter = eldap:equalityMatch(Attr, User), Base = ejabberd_config:get_local_option(ldap_base), case eldap:search("ejabberd", [{base, Base}, {filter, Filter},