couple of other places where we need to reset stuff completely if the role changes
This commit is contained in:
parent
812135bfab
commit
d4d44b7a87
@ -324,15 +324,20 @@ function settings_post(&$a) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// no default collection
|
||||||
if($role_permissions['perms_auto']) {
|
else {
|
||||||
$r = q("update abook set abook_my_perms = %d where abook_channel = %d and (abook_flags & %d) limit 1",
|
q("update channel set channel_default_group = '', channel_allow_gid = '', channel_allow_cid = '', channel_deny_gid = '',
|
||||||
intval($role_permissions['perms_accept']),
|
channel_deny_cid = '' where channel_id = %d limit 1",
|
||||||
intval(local_user()),
|
intval(local_user())
|
||||||
intval(ABOOK_FLAG_SELF)
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$r = q("update abook set abook_my_perms = %d where abook_channel = %d and (abook_flags & %d) limit 1",
|
||||||
|
intval(($role_permissions['perms_auto']) ? intval($role_permissions['perms_accept']) : 0),
|
||||||
|
intval(local_user()),
|
||||||
|
intval(ABOOK_FLAG_SELF)
|
||||||
|
);
|
||||||
|
|
||||||
foreach($role_permissions as $p => $v) {
|
foreach($role_permissions as $p => $v) {
|
||||||
if(strpos($p,'channel_') !== false) {
|
if(strpos($p,'channel_') !== false) {
|
||||||
$set_perms .= ', ' . $p . ' = ' . intval($v) . ' ';
|
$set_perms .= ', ' . $p . ' = ' . intval($v) . ' ';
|
||||||
|
Reference in New Issue
Block a user