diff options
author | friendica <info@friendica.com> | 2012-11-02 16:25:59 -0700 |
---|---|---|
committer | friendica <info@friendica.com> | 2012-11-02 16:25:59 -0700 |
commit | a47a1d5eb9d8e28a646540c5d19e05ffe35774cc (patch) | |
tree | 55d8e2802a8a477a4d324a6dcbaa509b744e4dcb /include/follow.php | |
parent | aca2e3b52ae44b5abe2681bc03351feb150e47ef (diff) | |
download | volse-hubzilla-a47a1d5eb9d8e28a646540c5d19e05ffe35774cc.tar.gz volse-hubzilla-a47a1d5eb9d8e28a646540c5d19e05ffe35774cc.tar.bz2 volse-hubzilla-a47a1d5eb9d8e28a646540c5d19e05ffe35774cc.zip |
secure permission discovery
Diffstat (limited to 'include/follow.php')
-rw-r--r-- | include/follow.php | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/include/follow.php b/include/follow.php index 2b65e389e..b3591b8ba 100644 --- a/include/follow.php +++ b/include/follow.php @@ -80,7 +80,20 @@ function new_contact($uid,$url,$channel,$interactive = false) { $global_perms = get_perms(); - foreach($j->permissions as $k => $v) { + if($j->permissions->data) { + $permissions = aes_unencapsulate(array( + 'data' => $j->permissions->data, + 'key' => $j->permissions->key, + 'iv' => $j->permissions->iv), + $channel['channel_prvkey']); + if($permissions) + $permissions = json_decode($permissions); + logger('decrypted permissions: ' . print_r($permissions,true), LOGGER_DATA); + } + else + $permissions = $j->permissions; + + foreach($permissions as $k => $v) { if($v) { $their_perms = $their_perms | intval($global_perms[$k][1]); } |