diff options
author | redmatrix <git@macgirvin.com> | 2016-07-18 21:37:34 -0700 |
---|---|---|
committer | redmatrix <git@macgirvin.com> | 2016-07-18 21:37:34 -0700 |
commit | b63165b6e0d856848b20d184783bfdf358210f9b (patch) | |
tree | cdfb1bf415c1d99f52d0d835f84aff147f3e0dac /include/channel.php | |
parent | 32ce790717f39ecb6cbd7371b631753652c77ee3 (diff) | |
download | volse-hubzilla-b63165b6e0d856848b20d184783bfdf358210f9b.tar.gz volse-hubzilla-b63165b6e0d856848b20d184783bfdf358210f9b.tar.bz2 volse-hubzilla-b63165b6e0d856848b20d184783bfdf358210f9b.zip |
more perms work (a lot more)
Diffstat (limited to 'include/channel.php')
-rw-r--r-- | include/channel.php | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/include/channel.php b/include/channel.php index bec7d11d6..de0ac70e8 100644 --- a/include/channel.php +++ b/include/channel.php @@ -379,8 +379,21 @@ function create_identity($arr) { set_pconfig($newuid,'system','permissions_role',$arr['permissions_role']); if(array_key_exists('online',$role_permissions)) set_pconfig($newuid,'system','hide_presence',1-intval($role_permissions['online'])); - if(array_key_exists('perms_auto',$role_permissions)) - set_pconfig($newuid,'system','autoperms',(($role_permissions['perms_auto']) ? $role_permissions['perms_accept'] : 0)); + if(array_key_exists('perms_auto',$role_permissions)) { + $autoperms = intval($role_permissions['perms_auto']); + set_pconfig($newuid,'system','autoperms',$autoperms); + if($autoperms) { + $x = \Zotlabs\Access\Permissions::FilledPerms($role_permissions['connect']); + foreach($x as $k => $v) { + set_pconfig($newuid,'autoperms',$k,$v); + } + } + else { + $r = q("delete from pconfig where uid = %d and cat = 'autoperms'", + intval($newuid) + ); + } + } } // Create a group with yourself as a member. This allows somebody to use it |