diff options
-rw-r--r-- | ChangeLog | 3 | ||||
-rw-r--r-- | src/ejabberd_auth_anonymous.erl | 9 |
2 files changed, 11 insertions, 1 deletions
@@ -1,5 +1,8 @@ 2007-06-28 Mickael Remond <mickael.remond@process-one.net> + * src/ejabberd_auth_anonymous.erl: Do not purge non anonymous accounts + when using anonymous authentication with another type of auth. + * src/ejabberd_service.erl: Added an option to disable from attribute checks in packets coming from an external component (EJAB-275) * doc/guide.tex: Likewise 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 %% --------------------------------- |