aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Module/Settings.php
diff options
context:
space:
mode:
authorredmatrix <git@macgirvin.com>2016-07-18 21:37:34 -0700
committerredmatrix <git@macgirvin.com>2016-07-18 21:37:34 -0700
commitb63165b6e0d856848b20d184783bfdf358210f9b (patch)
treecdfb1bf415c1d99f52d0d835f84aff147f3e0dac /Zotlabs/Module/Settings.php
parent32ce790717f39ecb6cbd7371b631753652c77ee3 (diff)
downloadvolse-hubzilla-b63165b6e0d856848b20d184783bfdf358210f9b.tar.gz
volse-hubzilla-b63165b6e0d856848b20d184783bfdf358210f9b.tar.bz2
volse-hubzilla-b63165b6e0d856848b20d184783bfdf358210f9b.zip
more perms work (a lot more)
Diffstat (limited to 'Zotlabs/Module/Settings.php')
-rw-r--r--Zotlabs/Module/Settings.php32
1 files changed, 17 insertions, 15 deletions
diff --git a/Zotlabs/Module/Settings.php b/Zotlabs/Module/Settings.php
index 81d76a2dd..514078b2f 100644
--- a/Zotlabs/Module/Settings.php
+++ b/Zotlabs/Module/Settings.php
@@ -21,10 +21,7 @@ class Settings extends \Zotlabs\Web\Controller {
// We are setting these values - don't use the argc(), argv() functions here
\App::$argc = 2;
\App::$argv[] = 'channel';
- }
-
-
-
+ }
}
@@ -422,20 +419,25 @@ class Settings extends \Zotlabs\Web\Controller {
);
}
- foreach($global_perms as $k => $v) {
- set_abconfig(local_channel(),$channel['channel_hash'],'my_perms',$k,((array_key_exists($k,$role_permissions['perms_connect'])) ? 1 : 0));
- }
-
- set_pconfig(local_channel(),'system','autoperms',(($role_permissions['perms_auto']) ? intval($role_permissions['perms_accept']) : 0));
-
- foreach($role_permissions as $p => $v) {
- if(strpos($p,'channel_') !== false) {
- $set_perms .= ', ' . $p . ' = ' . intval($v) . ' ';
+ $x = \Zotlabs\Access\Permissions::FilledPerms($role_permissions['perms_connect']);
+ foreach($x as $k => $v) {
+ set_abconfig(local_channel(),$channel['channel_hash'],'my_perms',$k, $v);
+ if($role_permissions['perms_auto']) {
+ set_pconfig(local_channel(),'autoperms',$k,$v);
+ }
+ else {
+ del_pconfig(local_channel(),'autoperms',$k);
}
- if($p === 'directory_publish') {
- $publish = intval($v);
+ }
+
+ if($role_permissions['limits']) {
+ foreach($role_permissions['limits'] as $k => $v) {
+ \Zotlabs\Access\PermissionLimits::Set(local_channel(),$k,$v);
}
}
+ if(array_key_exists('directory_publish',$role_permissions)) {
+ $publish = intval($role_permissions['directory_publish']);
+ }
}
set_pconfig(local_channel(),'system','hide_online_status',$hide_presence);