aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs
diff options
context:
space:
mode:
authorredmatrix <git@macgirvin.com>2016-07-04 21:33:25 -0700
committerredmatrix <git@macgirvin.com>2016-07-04 21:33:25 -0700
commite6224898d29b605da6751b6744f0e544250b600a (patch)
tree70b801be1984280b820fa66d61417c3a1f2f8519 /Zotlabs
parentd566ffa678dc9f035a022304a82560b19495a838 (diff)
downloadvolse-hubzilla-e6224898d29b605da6751b6744f0e544250b600a.tar.gz
volse-hubzilla-e6224898d29b605da6751b6744f0e544250b600a.tar.bz2
volse-hubzilla-e6224898d29b605da6751b6744f0e544250b600a.zip
more heavy lifting on xtensible perms
Diffstat (limited to 'Zotlabs')
-rw-r--r--Zotlabs/Access/PermissionLimits.php4
-rw-r--r--Zotlabs/Access/PermissionRoles.php4
-rw-r--r--Zotlabs/Module/Connedit.php11
-rw-r--r--Zotlabs/Module/Settings.php2
4 files changed, 12 insertions, 9 deletions
diff --git a/Zotlabs/Access/PermissionLimits.php b/Zotlabs/Access/PermissionLimits.php
index ddea919aa..907adaae2 100644
--- a/Zotlabs/Access/PermissionLimits.php
+++ b/Zotlabs/Access/PermissionLimits.php
@@ -11,7 +11,7 @@ class PermissionLimits {
if($r) {
if($r[0]['perm_limit'] != $perm_limit) {
$x = q("update perm_limits set perm_limit = %d where id = %d",
- dbesc($perm_limit)
+ dbesc($perm_limit),
intval($r[0]['id'])
);
}
@@ -29,7 +29,7 @@ class PermissionLimits {
static public function Get($channel_id,$perm = '') {
if($perm) {
$r = q("select * from perm_limits where channel_id = %d and perm = '%s' limit 1",
- intval($channel_id)
+ intval($channel_id),
dbesc($perm)
);
if($r)
diff --git a/Zotlabs/Access/PermissionRoles.php b/Zotlabs/Access/PermissionRoles.php
index 32a72d3ae..e3b16a66c 100644
--- a/Zotlabs/Access/PermissionRoles.php
+++ b/Zotlabs/Access/PermissionRoles.php
@@ -7,8 +7,8 @@ use Zotlabs\Lib as Zlib;
class PermissionRoles {
- static private role_limits = array();
- static private role_perms = array();
+ static private $role_limits = array();
+ static private $role_perms = array();
static public function roles() {
$roles = [
diff --git a/Zotlabs/Module/Connedit.php b/Zotlabs/Module/Connedit.php
index 4469330e8..a5c5175dc 100644
--- a/Zotlabs/Module/Connedit.php
+++ b/Zotlabs/Module/Connedit.php
@@ -197,8 +197,11 @@ class Connedit extends \Zotlabs\Web\Controller {
$role = get_pconfig(local_channel(),'system','permissions_role');
if($role) {
$x = get_role_perms($role);
- if($x['perms_accept'])
- $abook_my_perms = $x['perms_accept'];
+ if($x['perms_connect']) {
+ foreach($x['perms_connect'] as $p) {
+ set_abconfig(local_channel(),$orig_record[0]['abook_xchan'],'my_perms',$p,1);
+ }
+ }
}
}
@@ -374,8 +377,8 @@ class Connedit extends \Zotlabs\Web\Controller {
$role = get_pconfig(local_channel(),'system','permissions_role');
if($role) {
$x = get_role_perms($role);
- if($x['perms_accept'])
- $my_perms = $x['perms_accept'];
+ if($x['perms_connect'])
+ $my_perms = $x['perms_connect'];
}
$yes_no = array(t('No'),t('Yes'));
diff --git a/Zotlabs/Module/Settings.php b/Zotlabs/Module/Settings.php
index 5c9ff1db0..85da261fc 100644
--- a/Zotlabs/Module/Settings.php
+++ b/Zotlabs/Module/Settings.php
@@ -371,7 +371,7 @@ class Settings extends \Zotlabs\Web\Controller {
}
foreach($global_perms as $k => $v) {
- set_abconfig(local_channel(),$channel['channel_hash'],'my_perms',$k,((array_key_exists($k,$role_permissions['perms_accept'])) ? intval($role_permissions['perms_accept'][$k])));
+ set_abconfig(local_channel(),$channel['channel_hash'],'my_perms',$k,((array_key_exists($k,$role_permissions['perms_connect'])) ? 1 : 0));
}
set_pconfig(local_channel(),'system','autoperms',(($role_permissions['perms_auto']) ? intval($role_permissions['perms_accept']) : 0));