24
1
mirror of https://github.com/processone/ejabberd.git synced 2024-06-08 21:43:07 +02:00

* src/mod_muc/mod_muc_room.erl: Bugfix

SVN Revision: 516
This commit is contained in:
Alexey Shchepin 2006-03-06 02:30:15 +00:00
parent d837cb9e8d
commit 4f2a355408
2 changed files with 50 additions and 10 deletions

View File

@ -1,3 +1,7 @@
2006-03-06 Alexey Shchepin <alexey@sevcom.net>
* src/mod_muc/mod_muc_room.erl: Bugfix
2006-03-05 Alexey Shchepin <alexey@sevcom.net> 2006-03-05 Alexey Shchepin <alexey@sevcom.net>
* src/ejabberd_c2s.erl: Bugfix * src/ejabberd_c2s.erl: Bugfix

View File

@ -1684,10 +1684,28 @@ find_changed_items(UJID, UAffiliation, URole,
[StrAffiliation]), [StrAffiliation]),
{error, ?ERRT_NOT_ACCEPTABLE(Lang, ErrText1)}; {error, ?ERRT_NOT_ACCEPTABLE(Lang, ErrText1)};
SAffiliation -> SAffiliation ->
CanChangeRA =
case can_change_ra( case can_change_ra(
UAffiliation, URole, UAffiliation, URole,
TAffiliation, TRole, TAffiliation, TRole,
affiliation, SAffiliation) of affiliation, SAffiliation) of
nothing ->
nothing;
true ->
true;
check_owner ->
case search_affiliation(
owner, StateData) of
[{OJID, _}] ->
jlib:jid_remove_resource(OJID) /=
jlib:jid_tolower(jlib:jid_remove_resource(UJID));
_ ->
true
end;
_ ->
false
end,
case CanChangeRA of
nothing -> nothing ->
find_changed_items( find_changed_items(
UJID, UJID,
@ -1705,7 +1723,7 @@ find_changed_items(UJID, UAffiliation, URole,
xml:get_path_s( xml:get_path_s(
Item, [{elem, "reason"}, Item, [{elem, "reason"},
cdata])} | Res]); cdata])} | Res]);
_ -> false ->
{error, ?ERR_NOT_ALLOWED} {error, ?ERR_NOT_ALLOWED}
end end
end end
@ -1721,10 +1739,28 @@ find_changed_items(UJID, UAffiliation, URole,
[StrRole]), [StrRole]),
{error, ?ERRT_BAD_REQUEST(Lang, ErrText1)}; {error, ?ERRT_BAD_REQUEST(Lang, ErrText1)};
SRole -> SRole ->
CanChangeRA =
case can_change_ra( case can_change_ra(
UAffiliation, URole, UAffiliation, URole,
TAffiliation, TRole, TAffiliation, TRole,
role, SRole) of role, SRole) of
nothing ->
nothing;
true ->
true;
check_owner ->
case search_affiliation(
owner, StateData) of
[{OJID, _}] ->
jlib:jid_remove_resource(OJID) /=
jlib:jid_tolower(jlib:jid_remove_resource(UJID));
_ ->
true
end;
_ ->
false
end,
case CanChangeRA of
nothing -> nothing ->
find_changed_items( find_changed_items(
UJID, UJID,
@ -1824,7 +1860,7 @@ can_change_ra(owner, _FRole,
can_change_ra(owner, _FRole, can_change_ra(owner, _FRole,
owner, _TRole, owner, _TRole,
affiliation, _Affiliation) -> affiliation, _Affiliation) ->
true; check_owner;
can_change_ra(_FAffiliation, _FRole, can_change_ra(_FAffiliation, _FRole,
_TAffiliation, _TRole, _TAffiliation, _TRole,
affiliation, _Value) -> affiliation, _Value) ->