mirror of
https://github.com/processone/ejabberd.git
synced 2024-12-20 17:27:00 +01:00
Check also 'access' rule on account removal
According to the documentation we should not allow account removal when it's forbidden by the rule from 'access' option.
This commit is contained in:
parent
650bdae5d9
commit
de91618070
@ -114,8 +114,12 @@ process_iq(#iq{from = From, to = To} = IQ, Source) ->
|
||||
end,
|
||||
Server = To#jid.lserver,
|
||||
Access = mod_register_opt:access_remove(Server),
|
||||
AllowRemove = allow == acl:match_rule(Server, Access, From),
|
||||
process_iq(IQ, Source, IsCaptchaEnabled, AllowRemove).
|
||||
Remove = case acl:match_rule(Server, Access, From) of
|
||||
deny -> deny;
|
||||
allow ->
|
||||
check_access(From#jid.luser, From#jid.lserver, Source)
|
||||
end,
|
||||
process_iq(IQ, Source, IsCaptchaEnabled, Remove == allow).
|
||||
|
||||
process_iq(#iq{type = set, lang = Lang,
|
||||
sub_els = [#register{remove = true}]} = IQ,
|
||||
|
Loading…
Reference in New Issue
Block a user