aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMickaël Rémond <mickael.remond@process-one.net>2007-06-28 17:39:53 +0000
committerMickaël Rémond <mickael.remond@process-one.net>2007-06-28 17:39:53 +0000
commitede1693f20360bb2a2b842bd2735d95387cfa845 (patch)
tree3c77d6c8c2bfecddf84bc4b4085e3694ab4ea0a0 /src
parent* src/ejabberd_service.erl: Added an option to disable from attribute checks ... (diff)
* src/ejabberd_auth_anonymous.erl: Do not purge non anonymous accounts when using anonymous authentication with another type of auth (EJAB-216).
SVN Revision: 805
Diffstat (limited to 'src')
-rw-r--r--src/ejabberd_auth_anonymous.erl9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/ejabberd_auth_anonymous.erl b/src/ejabberd_auth_anonymous.erl
index c3c4ed0c4..a342d7e1c 100644
--- a/src/ejabberd_auth_anonymous.erl
+++ b/src/ejabberd_auth_anonymous.erl
@@ -136,9 +136,16 @@ register_connection(SID, #jid{luser = LUser, lserver = LServer}) ->
%% Remove an anonymous user from the anonymous users table
unregister_connection(SID, #jid{luser = LUser, lserver = LServer}) ->
- ejabberd_hooks:run(anonymous_purge_hook, jlib:nameprep(LServer), [LUser, LServer]),
+ purge_hook(anonymous_user_exist(LUser, LServer),
+ LUser, LServer),
remove_connection(SID, LUser, LServer).
+%% Launch the hook to purge user data only for anonymous users
+purge_hook(false, _LUser, _LServer) ->
+ ok;
+purge_hook(true, LUser, LServer) ->
+ ejabberd_hooks:run(anonymous_purge_hook, LServer, [LUser, LServer]).
+
%% ---------------------------------
%% Specific anonymous auth functions
%% ---------------------------------