aboutsummaryrefslogtreecommitdiffstats
path: root/mod
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2014-10-26 19:47:55 -0700
committerfriendica <info@friendica.com>2014-10-26 19:47:55 -0700
commitd4d44b7a87e680305ba89c9eca94065c2eeb8be9 (patch)
treee5b60419a62a60c6a42680d40452ad8194598b07 /mod
parent812135bfabd49a8235b766eb56daf05e88263f33 (diff)
downloadvolse-hubzilla-d4d44b7a87e680305ba89c9eca94065c2eeb8be9.tar.gz
volse-hubzilla-d4d44b7a87e680305ba89c9eca94065c2eeb8be9.tar.bz2
volse-hubzilla-d4d44b7a87e680305ba89c9eca94065c2eeb8be9.zip
couple of other places where we need to reset stuff completely if the role changes
Diffstat (limited to 'mod')
-rw-r--r--mod/settings.php17
1 files changed, 11 insertions, 6 deletions
diff --git a/mod/settings.php b/mod/settings.php
index 77e01d9b7..58257368e 100644
--- a/mod/settings.php
+++ b/mod/settings.php
@@ -324,15 +324,20 @@ function settings_post(&$a) {
return;
}
}
-
- if($role_permissions['perms_auto']) {
- $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(local_user()),
- intval(ABOOK_FLAG_SELF)
+ // 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())
);
}
+ $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) {
if(strpos($p,'channel_') !== false) {
$set_perms .= ', ' . $p . ' = ' . intval($v) . ' ';