move permcat initialisation to zlib
This commit is contained in:
parent
723b51c931
commit
2d3e20d96e
@ -276,48 +276,4 @@ class PermissionRoles {
|
|||||||
return $roles;
|
return $roles;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static public function permcats($uid) {
|
|
||||||
|
|
||||||
$permcats = [
|
|
||||||
[ 'follower', t('follower','permcat'),
|
|
||||||
[ 'view_stream','view_profile','view_contacts','view_storage','view_pages','view_wiki',
|
|
||||||
'post_like' ]
|
|
||||||
],
|
|
||||||
|
|
||||||
[ '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' ]
|
|
||||||
],
|
|
||||||
[ 'trusted', t('trusted','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' ]
|
|
||||||
],
|
|
||||||
[ 'moderator', t('moderator','permcat'),
|
|
||||||
[ 'view_stream','view_profile','view_contacts','view_storage','view_pages',
|
|
||||||
'write_storage','post_wall','wite_pages','write_wiki','post_comments','post_like','tag_deliver',
|
|
||||||
'chat', 'republish' ]
|
|
||||||
]
|
|
||||||
];
|
|
||||||
|
|
||||||
if($uid) {
|
|
||||||
$x = q("select * from pconfig where uid = %d and cat = 'permcat'",
|
|
||||||
intval($uid)
|
|
||||||
);
|
|
||||||
if($x) {
|
|
||||||
foreach($x as $xv) {
|
|
||||||
$permcats[] = [ $xv['k'], $xv['k'], $xv['v'] ];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
call_hooks('permcats',$permcats);
|
|
||||||
|
|
||||||
return $permcats;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
@ -32,7 +32,7 @@ class Permcat {
|
|||||||
];
|
];
|
||||||
|
|
||||||
|
|
||||||
$p = Zaccess\PermissionRoles::permcats($channel_id);
|
$p = $this->load_permcats($channel_id);
|
||||||
if($p) {
|
if($p) {
|
||||||
for($x = 0; $x < count($p); $x++) {
|
for($x = 0; $x < count($p); $x++) {
|
||||||
$this->permcats[] = [
|
$this->permcats[] = [
|
||||||
@ -60,4 +60,51 @@ class Permcat {
|
|||||||
return ['error' => true];
|
return ['error' => true];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function load_permcats($uid) {
|
||||||
|
|
||||||
|
$permcats = [
|
||||||
|
[ 'follower', t('follower','permcat'),
|
||||||
|
[ 'view_stream','view_profile','view_contacts','view_storage','view_pages','view_wiki',
|
||||||
|
'post_like' ]
|
||||||
|
],
|
||||||
|
|
||||||
|
[ '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' ]
|
||||||
|
],
|
||||||
|
[ 'trusted', t('trusted','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' ]
|
||||||
|
],
|
||||||
|
[ 'moderator', t('moderator','permcat'),
|
||||||
|
[ 'view_stream','view_profile','view_contacts','view_storage','view_pages',
|
||||||
|
'write_storage','post_wall','wite_pages','write_wiki','post_comments','post_like','tag_deliver',
|
||||||
|
'chat', 'republish' ]
|
||||||
|
]
|
||||||
|
];
|
||||||
|
|
||||||
|
if($uid) {
|
||||||
|
$x = q("select * from pconfig where uid = %d and cat = 'permcat'",
|
||||||
|
intval($uid)
|
||||||
|
);
|
||||||
|
if($x) {
|
||||||
|
foreach($x as $xv) {
|
||||||
|
$permcats[] = [ $xv['k'], $xv['k'], $xv['v'] ];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
call_hooks('permcats',$permcats);
|
||||||
|
|
||||||
|
return $permcats;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
Reference in New Issue
Block a user