couple of other places where we need to reset stuff completely if the role changes

This commit is contained in:
friendica 2014-10-26 19:47:55 -07:00
parent 812135bfab
commit d4d44b7a87

View File

@ -324,14 +324,19 @@ function settings_post(&$a) {
return; return;
} }
} }
// no default collection
else {
q("update channel set channel_default_group = '', channel_allow_gid = '', channel_allow_cid = '', channel_deny_gid = '',
channel_deny_cid = '' where channel_id = %d limit 1",
intval(local_user())
);
}
if($role_permissions['perms_auto']) {
$r = q("update abook set abook_my_perms = %d where abook_channel = %d and (abook_flags & %d) limit 1", $r = q("update abook set abook_my_perms = %d where abook_channel = %d and (abook_flags & %d) limit 1",
intval($role_permissions['perms_accept']), intval(($role_permissions['perms_auto']) ? intval($role_permissions['perms_accept']) : 0),
intval(local_user()), intval(local_user()),
intval(ABOOK_FLAG_SELF) 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) {