aboutsummaryrefslogtreecommitdiffstats
path: root/include/zot.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 /include/zot.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 'include/zot.php')
-rw-r--r--include/zot.php21
1 files changed, 17 insertions, 4 deletions
diff --git a/include/zot.php b/include/zot.php
index 0a835a909..47bdce568 100644
--- a/include/zot.php
+++ b/include/zot.php
@@ -456,15 +456,28 @@ function zot_refresh($them, $channel = null, $force = false) {
// new connection
+ $my_perms = null;
+
$role = get_pconfig($channel['channel_id'],'system','permissions_role');
if($role) {
$xx = get_role_perms($role);
- if($xx['perms_auto'])
+ if($xx['perms_auto']) {
$default_perms = $xx['perms_connect'];
+ $my_perms = \Zotlabs\Access\Permissions::FilledPerms($default_perms);
+ }
+
+ if(! $my_perms) {
+ $x = \Zotlabs\Access\Permissions::FilledAutoperms($channel['channel_id']);
+ if($x) {
+ $my_perms = $x;
+ }
}
- if(! $default_perms)
- $default_perms = get_pconfig($channel['channel_id'],'system','autoperms');
+ if($my_perms) {
+ foreach($my_perms as $k => $v) {
+ set_abconfig($channel['channel_id'],$x['hash'],'my_perms',$k,$v);
+ }
+ }
// Keep original perms to check if we need to notify them
$previous_perms = get_all_perms($channel['channel_id'],$x['hash']);
@@ -497,7 +510,7 @@ function zot_refresh($them, $channel = null, $force = false) {
);
if($new_connection) {
- if($new_perms != $previous_perms)
+ if(! \Zotlabs\Access\Permissions::PermsCompare($new_perms,$previous_perms))
Zotlabs\Daemon\Master::Summon(array('Notifier','permission_create',$new_connection[0]['abook_id']));
Zotlabs\Lib\Enotify::submit(array(
'type' => NOTIFY_INTRO,