aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Lib
diff options
context:
space:
mode:
authorzottel <github@zottel.net>2016-07-22 20:16:49 +0200
committerzottel <github@zottel.net>2016-07-22 20:16:49 +0200
commited82cb108f99ce45ced841161fa505ecf11ceee4 (patch)
tree03d75b325963a2ba5eba83045c1d1a042c4862f2 /Zotlabs/Lib
parent43def0873e6cc4cf535eb8282187757dd84283c2 (diff)
parent4ffc4ee70aa38c24cee2a7ae0b35c9203515acef (diff)
downloadvolse-hubzilla-ed82cb108f99ce45ced841161fa505ecf11ceee4.tar.gz
volse-hubzilla-ed82cb108f99ce45ced841161fa505ecf11ceee4.tar.bz2
volse-hubzilla-ed82cb108f99ce45ced841161fa505ecf11ceee4.zip
Merge remote-tracking branch 'upstream/dev' into dev
Diffstat (limited to 'Zotlabs/Lib')
-rw-r--r--Zotlabs/Lib/AbConfig.php2
-rw-r--r--Zotlabs/Lib/PConfig.php9
-rw-r--r--Zotlabs/Lib/PermissionDescription.php17
3 files changed, 11 insertions, 17 deletions
diff --git a/Zotlabs/Lib/AbConfig.php b/Zotlabs/Lib/AbConfig.php
index cab59abbd..cb5d96951 100644
--- a/Zotlabs/Lib/AbConfig.php
+++ b/Zotlabs/Lib/AbConfig.php
@@ -7,7 +7,7 @@ class AbConfig {
static public function Load($chan,$xhash,$family = '') {
if($family)
- $where = sprintf(" and family = '%s' ",dbesc($family));
+ $where = sprintf(" and cat = '%s' ",dbesc($family));
$r = q("select * from abconfig where chan = %d and xchan = '%s' $where",
intval($chan),
dbesc($xhash)
diff --git a/Zotlabs/Lib/PConfig.php b/Zotlabs/Lib/PConfig.php
index 195321375..319b8f203 100644
--- a/Zotlabs/Lib/PConfig.php
+++ b/Zotlabs/Lib/PConfig.php
@@ -17,7 +17,7 @@ class PConfig {
*/
static public function Load($uid) {
- if($uid === false)
+ if(is_null($uid) || $uid === false)
return false;
if(! array_key_exists($uid, \App::$config))
@@ -61,7 +61,7 @@ class PConfig {
static public function Get($uid,$family,$key,$instore = false) {
- if($uid === false)
+ if(is_null($uid) || $uid === false)
return false;
if(! array_key_exists($uid, \App::$config))
@@ -102,7 +102,7 @@ class PConfig {
// we provide a function backtrace in the logs so that we can find
// and fix the calling function.
- if($uid === false) {
+ if(is_null($uid) || $uid === false) {
btlogger('UID is FALSE!', LOGGER_NORMAL, LOG_ERR);
return;
}
@@ -172,6 +172,9 @@ class PConfig {
static public function Delete($uid, $family, $key) {
+ if(is_null($uid) || $uid === false)
+ return false;
+
$ret = false;
if(array_key_exists($key, \App::$config[$uid][$family]))
diff --git a/Zotlabs/Lib/PermissionDescription.php b/Zotlabs/Lib/PermissionDescription.php
index 55aac2dea..b6c6dd29d 100644
--- a/Zotlabs/Lib/PermissionDescription.php
+++ b/Zotlabs/Lib/PermissionDescription.php
@@ -78,22 +78,13 @@ class PermissionDescription {
$result = null;
- $global_perms = get_perms();
+ $global_perms = \Zotlabs\Access\Permissions::Perms();
if (array_key_exists($permname, $global_perms)) {
- $permDetails = $global_perms[$permname];
-
- // It should be OK to always just read the permissions from App::$channel
- //
- // App::$profile is a union of channel and profile fields.
- // The distinction is basically that App::$profile is pointing to the resource
- // being observed. App::$channel is referring to the current logged-in channel
- // member (if this is a local channel) e.g. the observer. We only show the ACL
- // widget to the page owner (observer and observed are the same) so in that case
- // I believe either may be safely used here.
- $channelPerm = \App::$channel[$permDetails[0]];
- $result = new PermissionDescription($permDetails[1], $channelPerm);
+ $channelPerm = \Zotlabs\Access\PermissionLimits::Get(\App::$channel['channel_id'],$permname);
+
+ $result = new PermissionDescription('', $channelPerm);
} else {
// The acl dialog can handle null arguments, but it shouldn't happen
logger('null PermissionDescription from unknown global permission: ' . $permname ,LOGGER_DEBUG, LOG_ERROR);