aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Module/Connedit.php
diff options
context:
space:
mode:
authorredmatrix <git@macgirvin.com>2016-07-13 23:05:19 -0700
committerredmatrix <git@macgirvin.com>2016-07-13 23:05:19 -0700
commit191cd21028ab108c2a7f982c654601d780865eff (patch)
tree9610f003b964949a135f464d3caff16f28fea1fe /Zotlabs/Module/Connedit.php
parentb3a785711cde52a3c03c0a0eb90ce4e9ce8d9059 (diff)
downloadvolse-hubzilla-191cd21028ab108c2a7f982c654601d780865eff.tar.gz
volse-hubzilla-191cd21028ab108c2a7f982c654601d780865eff.tar.bz2
volse-hubzilla-191cd21028ab108c2a7f982c654601d780865eff.zip
more perms work
Diffstat (limited to 'Zotlabs/Module/Connedit.php')
-rw-r--r--Zotlabs/Module/Connedit.php20
1 files changed, 13 insertions, 7 deletions
diff --git a/Zotlabs/Module/Connedit.php b/Zotlabs/Module/Connedit.php
index f9b1336a8..260952b4e 100644
--- a/Zotlabs/Module/Connedit.php
+++ b/Zotlabs/Module/Connedit.php
@@ -205,20 +205,26 @@ class Connedit extends \Zotlabs\Web\Controller {
if($role) {
$x = get_role_perms($role);
if($x['perms_connect']) {
- foreach($x['perms_connect'] as $p) {
- set_abconfig(local_channel(),$orig_record[0]['abook_xchan'],'my_perms',$p,1);
- }
+ $abook_my_perms = $x['perms_connect'];
+ }
+ }
+
+ if($all_perms) {
+ foreach($all_perms as $perm => $desc) {
+ if(array_key_exists($perm, $abook_my_perms))
+ set_abconfig($channel['channel_id'],$orig_record[0]['abook_xchan'],'my_perms',$perm,1);
+ else
+ set_abconfig($channel['channel_id'],$orig_record[0]['abook_xchan'],'my_perms',$perm,0);
}
}
}
-
+
$abook_pending = (($new_friend) ? 0 : $orig_record[0]['abook_pending']);
- $r = q("UPDATE abook SET abook_profile = '%s', abook_my_perms = %d , abook_closeness = %d, abook_pending = %d,
+ $r = q("UPDATE abook SET abook_profile = '%s', abook_closeness = %d, abook_pending = %d,
abook_incl = '%s', abook_excl = '%s'
where abook_id = %d AND abook_channel = %d",
dbesc($profile_id),
- intval($abook_my_perms),
intval($closeness),
intval($abook_pending),
dbesc($abook_incl),
@@ -239,7 +245,7 @@ class Connedit extends \Zotlabs\Web\Controller {
info( t('Connection updated.') . EOL);
else
notice( t('Failed to update connection record.') . EOL);
-
+//@fixme perms
if(\App::$poi && \App::$poi['abook_my_perms'] != $abook_my_perms
&& (! intval(\App::$poi['abook_self']))) {
\Zotlabs\Daemon\Master::Summon(array('Notifier', (($new_friend) ? 'permission_create' : 'permission_update'), $contact_id));