diff options
author | redmatrix <git@macgirvin.com> | 2016-07-17 22:18:35 -0700 |
---|---|---|
committer | redmatrix <git@macgirvin.com> | 2016-07-17 22:18:35 -0700 |
commit | f7833411a10d79ce86ec9d47ce05e2c7fcf1968a (patch) | |
tree | a30d700cb60dcdf1498e22f0a1942bb457c866c7 /include/perm_upgrade.php | |
parent | de4f9d68bdaade902a8030888f9df035fa1329ec (diff) | |
download | volse-hubzilla-f7833411a10d79ce86ec9d47ce05e2c7fcf1968a.tar.gz volse-hubzilla-f7833411a10d79ce86ec9d47ce05e2c7fcf1968a.tar.bz2 volse-hubzilla-f7833411a10d79ce86ec9d47ce05e2c7fcf1968a.zip |
clone channel perms
Diffstat (limited to 'include/perm_upgrade.php')
-rw-r--r-- | include/perm_upgrade.php | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/include/perm_upgrade.php b/include/perm_upgrade.php index 1f410f711..e01ef739e 100644 --- a/include/perm_upgrade.php +++ b/include/perm_upgrade.php @@ -62,3 +62,60 @@ function perm_abook_upgrade($abook) { +function translate_channel_perms_outbound(&$channel) { + $r = q("select * from pconfig where uid = %d and cat = 'perm_limits' ", + intval($channel['channel_id']) + ); + + if($r) { + foreach($r as $rr) { + if($rr['k'] === 'view_stream') + $channel['channel_r_stream'] = $rr['v']; + if($rr['k'] === 'view_profile') + $channel['channel_r_profile'] = $rr['v']; + if($rr['k'] === 'view_contacts') + $channel['channel_r_abook'] = $rr['v']; + if($rr['k'] === 'view_storage') + $channel['channel_r_storage'] = $rr['v']; + if($rr['k'] === 'view_pages') + $channel['channel_r_pages'] = $rr['v']; + if($rr['k'] === 'send_stream') + $channel['channel_w_stream'] = $rr['v']; + if($rr['k'] === 'post_wall') + $channel['channel_w_wall'] = $rr['v']; + if($rr['k'] === 'post_comments') + $channel['channel_w_comment'] = $rr['v']; + if($rr['k'] === 'post_mail') + $channel['channel_w_mail'] = $rr['v']; + if($rr['k'] === 'post_like') + $channel['channel_w_like'] = $rr['v']; + if($rr['k'] === 'tag_deliver') + $channel['channel_w_tagwall'] = $rr['v']; + if($rr['k'] === 'chat') + $channel['channel_w_chat'] = $rr['v']; + if($rr['k'] === 'write_storage') + $channel['channel_w_storage'] = $rr['v']; + if($rr['k'] === 'write_pages') + $channel['channel_w_pages'] = $rr['v']; + if($rr['k'] === 'republish') + $channel['channel_a_republish'] = $rr['v']; + if($rr['k'] === 'delegate') + $channel['channel_a_delegate'] = $rr['v']; + + } + $channel['perm_limits'] = $r; + } +} + +function translate_channel_perms_inbound($channel) { + + if($channel['perm_limits']) { + foreach($channel['perm_limits'] as $p) { + set_pconfig($channel['channel_id'],'perm_limits',$p['k'],$p['v']); + } + } + else { + perm_limits_upgrade($channel); + } + +}
\ No newline at end of file |