From 2afdb7854be8560aa0d9eaf6aab85bc33eb0d778 Mon Sep 17 00:00:00 2001 From: redmatrix Date: Mon, 22 Aug 2016 20:30:17 -0700 Subject: [PATCH] Revert "more missing files from merge" This reverts commit 1bd784cf12d6ca4dc3ed2a6a3e77c7127a9d8590. --- Zotlabs/Access/PermissionLimits.php | 36 ----- Zotlabs/Access/PermissionRoles.php | 215 ---------------------------- Zotlabs/Access/Permissions.php | 116 --------------- 3 files changed, 367 deletions(-) delete mode 100644 Zotlabs/Access/PermissionLimits.php delete mode 100644 Zotlabs/Access/PermissionRoles.php delete mode 100644 Zotlabs/Access/Permissions.php diff --git a/Zotlabs/Access/PermissionLimits.php b/Zotlabs/Access/PermissionLimits.php deleted file mode 100644 index 909b654d5..000000000 --- a/Zotlabs/Access/PermissionLimits.php +++ /dev/null @@ -1,36 +0,0 @@ - $v) { - if(strstr($k,'view')) - $limits[$k] = PERMS_PUBLIC; - else - $limits[$k] = PERMS_SPECIFIC; - } - return $limits; - } - - static public function Set($channel_id,$perm,$perm_limit) { - ZLib\PConfig::Set($channel_id,'perm_limits',$perm,$perm_limit); - } - - static public function Get($channel_id,$perm = '') { - if($perm) { - return Zlib\PConfig::Get($channel_id,'perm_limits',$perm); - } - else { - Zlib\PConfig::Load($channel_id); - if(array_key_exists($channel_id,\App::$config) && array_key_exists('perm_limits',\App::$config[$channel_id])) - return \App::$config[$channel_id]['perm_limits']; - return false; - } - } -} \ No newline at end of file diff --git a/Zotlabs/Access/PermissionRoles.php b/Zotlabs/Access/PermissionRoles.php deleted file mode 100644 index 8b116adc5..000000000 --- a/Zotlabs/Access/PermissionRoles.php +++ /dev/null @@ -1,215 +0,0 @@ - [ - 'social' => t('Social - Mostly Public'), - 'social_restricted' => t('Social - Restricted'), - 'social_private' => t('Social - Private') - ], - - t('Community Forum') => [ - 'forum' => t('Forum - Mostly Public'), - 'forum_restricted' => t('Forum - Restricted'), - 'forum_private' => t('Forum - Private') - ], - - t('Feed Republish') => [ - 'feed' => t('Feed - Mostly Public'), - 'feed_restricted' => t('Feed - Restricted') - ], - - t('Special Purpose') => [ - 'soapbox' => t('Special - Celebrity/Soapbox'), - 'repository' => t('Special - Group Repository') - ], - - t('Other') => [ - 'custom' => t('Custom/Expert Mode') - ] - - ]; - - return $roles; - } - - - -} \ No newline at end of file diff --git a/Zotlabs/Access/Permissions.php b/Zotlabs/Access/Permissions.php deleted file mode 100644 index 61ea51a48..000000000 --- a/Zotlabs/Access/Permissions.php +++ /dev/null @@ -1,116 +0,0 @@ - t('Can view my channel stream and posts'), - 'send_stream' => t('Can send me their channel stream and posts'), - 'view_profile' => t('Can view my default channel profile'), - 'view_contacts' => t('Can view my connections'), - 'view_storage' => t('Can view my file storage and photos'), - 'write_storage' => t('Can upload/modify my file storage and photos'), - 'view_pages' => t('Can view my channel webpages'), - 'write_pages' => t('Can create/edit my channel webpages'), - 'post_wall' => t('Can post on my channel (wall) page'), - 'post_comments' => t('Can comment on or like my posts'), - 'post_mail' => t('Can send me private mail messages'), - 'post_like' => t('Can like/dislike profiles and profile things'), - 'tag_deliver' => t('Can forward to all my channel connections via @+ mentions in posts'), - 'chat' => t('Can chat with me'), - 'republish' => t('Can source my public posts in derived channels'), - 'delegate' => t('Can administer my channel') - ]; - - $x = array('permissions' => $perms, 'filter' => $filter); - call_hooks('permissions_list',$x); - return($x['permissions']); - - } - - static public function BlockedAnonPerms() { - - // Perms from the above list that are blocked from anonymous observers. - // e.g. you must be authenticated. - - $res = array(); - $perms = PermissionLimits::Std_limits(); - foreach($perms as $perm => $limit) { - if($limit != PERMS_PUBLIC) { - $res[] = $perm; - } - } - - $x = array('permissions' => $res); - call_hooks('write_perms',$x); - return($x['permissions']); - - } - - // converts [ 0 => 'view_stream', ... ] - // to [ 'view_stream' => 1 ] - // for any permissions in $arr; - // Undeclared permissions are set to 0 - - static public function FilledPerms($arr) { - $everything = self::Perms(); - $ret = []; - foreach($everything as $k => $v) { - if(in_array($k,$arr)) - $ret[$k] = 1; - else - $ret[$k] = 0; - } - return $ret; - - } - - static public function FilledAutoperms($channel_id) { - if(! intval(get_pconfig($channel_id,'system','autoperms'))) - return false; - - $arr = []; - $r = q("select * from pconfig where uid = %d and cat = 'autoperms'", - intval($channel_id) - ); - if($r) { - foreach($r as $rr) { - $arr[$rr['k']] = $arr[$rr['v']]; - } - } - return $arr; - } - - static public function PermsCompare($p1,$p2) { - foreach($p1 as $k => $v) { - if(! array_key_exists($k,$p2)) - return false; - if($p1[$k] != $p2[$k]) - return false; - } - return true; - } -} \ No newline at end of file