diff options
author | redmatrix <git@macgirvin.com> | 2016-07-11 17:02:49 -0700 |
---|---|---|
committer | redmatrix <git@macgirvin.com> | 2016-07-11 17:02:49 -0700 |
commit | 71b001fdb7f4c900f6e7ff15a29952d6dc82c1fc (patch) | |
tree | faa3dd9fa2192995757a261451a2c4e969dad181 /Zotlabs/Module/Connedit.php | |
parent | cc83983ae5cb4675f631b0fb4bc61b800f183dae (diff) | |
download | volse-hubzilla-71b001fdb7f4c900f6e7ff15a29952d6dc82c1fc.tar.gz volse-hubzilla-71b001fdb7f4c900f6e7ff15a29952d6dc82c1fc.tar.bz2 volse-hubzilla-71b001fdb7f4c900f6e7ff15a29952d6dc82c1fc.zip |
more perms work - notably the stuff in public_perms
Diffstat (limited to 'Zotlabs/Module/Connedit.php')
-rw-r--r-- | Zotlabs/Module/Connedit.php | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/Zotlabs/Module/Connedit.php b/Zotlabs/Module/Connedit.php index 445219894..8aecfca4c 100644 --- a/Zotlabs/Module/Connedit.php +++ b/Zotlabs/Module/Connedit.php @@ -129,14 +129,21 @@ class Connedit extends \Zotlabs\Web\Controller { $abook_my_perms = 0; - foreach($_POST as $k => $v) { - if(strpos($k,'perms_') === 0) { - $perm = substr($k,6); - set_abconfig($channel['channel_id'],$orig_record[0]['abook_xchan'],'my_perms',$perm,(($v) ? 1 : 0)); - $abook_my_perms += $v; + $all_perms = \Zotlabs\Access\Permissions::Perms(); + + if($all_perms) { + foreach($all_perms as $perm => $desc) { + if(in_array('perms_' . $perm, $_POST)) { + set_abconfig($channel['channel_id'],$orig_record[0]['abook_xchan'],'my_perms',$perm, + intval($_POST['perms_' . $perm])); + $abook_my_perms ++; + } + else { + set_abconfig($channel['channel_id'],$orig_record[0]['abook_xchan'],'my_perms',$perm,0); + } } } - + $new_friend = false; if(! $is_self) { @@ -686,7 +693,6 @@ class Connedit extends \Zotlabs\Web\Controller { $their_perms[$t['k']] = $t['v']; } } -logger('theris: ' . print_r($their_perms,true)); foreach($global_perms as $k => $v) { $thisperm = get_abconfig(local_channel(),$contact['abook_xchan'],'my_perms',$k); |