diff options
author | zotlabs <mike@macgirvin.com> | 2017-02-08 17:21:32 -0800 |
---|---|---|
committer | zotlabs <mike@macgirvin.com> | 2017-02-08 17:21:32 -0800 |
commit | 91819bfc2d475e1b16d3f5e9ca685ca2531a9084 (patch) | |
tree | 0a139ef141996efc1dedae5476b4f6fb8ddde981 /Zotlabs/Lib | |
parent | 6ee691e0190a7d6488888d2fd5009324e3a88f74 (diff) | |
download | volse-hubzilla-91819bfc2d475e1b16d3f5e9ca685ca2531a9084.tar.gz volse-hubzilla-91819bfc2d475e1b16d3f5e9ca685ca2531a9084.tar.bz2 volse-hubzilla-91819bfc2d475e1b16d3f5e9ca685ca2531a9084.zip |
bringer - all basic functionality is implemented
Diffstat (limited to 'Zotlabs/Lib')
-rw-r--r-- | Zotlabs/Lib/Permcat.php | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/Zotlabs/Lib/Permcat.php b/Zotlabs/Lib/Permcat.php index c697984f1..7988aff97 100644 --- a/Zotlabs/Lib/Permcat.php +++ b/Zotlabs/Lib/Permcat.php @@ -28,7 +28,8 @@ class Permcat { $this->permcats[] = [ 'name' => $name, 'localname' => $localname, - 'perms' => Zaccess\Permissions::Operms($perms) + 'perms' => Zaccess\Permissions::Operms($perms), + 'system' => 1 ]; @@ -38,7 +39,8 @@ class Permcat { $this->permcats[] = [ 'name' => $p[$x][0], 'localname' => $p[$x][1], - 'perms' => Zaccess\Permissions::Operms(Zaccess\Permissions::FilledPerms($p[$x][2])) + 'perms' => Zaccess\Permissions::Operms(Zaccess\Permissions::FilledPerms($p[$x][2])), + 'system' => intval($p[$x][3]) ]; } } @@ -65,16 +67,16 @@ class Permcat { $permcats = [ [ 'follower', t('follower','permcat'), [ 'view_stream','view_profile','view_contacts','view_storage','view_pages','view_wiki', - 'post_like' ] + 'post_like' ], 1 ], [ 'contributor', t('contributor','permcat'), [ 'view_stream','view_profile','view_contacts','view_storage','view_pages','view_wiki', - 'post_wall','post_comments','write_wiki','post_like','tag_deliver','chat' ] + 'post_wall','post_comments','write_wiki','post_like','tag_deliver','chat' ], 1 ], [ 'publisher', t('publisher','permcat'), [ 'view_stream','view_profile','view_contacts','view_storage','view_pages', 'write_storage','post_wall','write_pages','write_wiki','post_comments','post_like','tag_deliver', - 'chat', 'republish' ] + 'chat', 'republish' ], 1 ] ]; @@ -85,7 +87,7 @@ class Permcat { if($x) { foreach($x as $xv) { $value = ((preg_match('|^a:[0-9]+:{.*}$|s', $xv['v'])) ? unserialize($xv['v']) : $xv['v']); - $permcats[] = [ $xv['k'], $xv['k'], $value ]; + $permcats[] = [ $xv['k'], $xv['k'], $value, 0 ]; } } } @@ -96,6 +98,14 @@ class Permcat { } + static public function find_permcat($arr,$name) { + if((! $arr) || (! $name)) + return false; + foreach($arr as $p) + if($p['name'] == $name) + return $p['value']; + } + static public function update($channel_id, $name,$permarr) { PConfig::Set($channel_id,'permcat',$name,$permarr); } |