aboutsummaryrefslogtreecommitdiffstats
path: root/include/permissions.php
diff options
context:
space:
mode:
authorredmatrix <redmatrix@redmatrix.me>2015-06-14 21:08:00 -0700
committerredmatrix <redmatrix@redmatrix.me>2015-06-14 21:08:00 -0700
commitbe0459a98b9c047e4cf89b835fd35a32da51ca31 (patch)
treebf4ddf3797fbd64b56853ac090361fb552ecfc6e /include/permissions.php
parentf0b255b1a9053e3983047354f0147225f2b29cd9 (diff)
downloadvolse-hubzilla-be0459a98b9c047e4cf89b835fd35a32da51ca31.tar.gz
volse-hubzilla-be0459a98b9c047e4cf89b835fd35a32da51ca31.tar.bz2
volse-hubzilla-be0459a98b9c047e4cf89b835fd35a32da51ca31.zip
convert the abook fields
Diffstat (limited to 'include/permissions.php')
-rw-r--r--include/permissions.php26
1 files changed, 12 insertions, 14 deletions
diff --git a/include/permissions.php b/include/permissions.php
index f63c6da18..59c6694d6 100644
--- a/include/permissions.php
+++ b/include/permissions.php
@@ -113,11 +113,10 @@ function get_all_perms($uid, $observer_xchan, $internal_use = true) {
}
if(! $abook_checked) {
- $x = q("select abook_my_perms, abook_flags, xchan_network from abook left join xchan on abook_xchan = xchan_hash
- where abook_channel = %d and abook_xchan = '%s' and not ( abook_flags & %d )>0 limit 1",
+ $x = q("select abook_my_perms, abook_blocked, abook_ignored, abook_pending, xchan_network from abook left join xchan on abook_xchan = xchan_hash
+ where abook_channel = %d and abook_xchan = '%s' and abook_self = 0 limit 1",
intval($uid),
- dbesc($observer_xchan),
- intval(ABOOK_FLAG_SELF)
+ dbesc($observer_xchan)
);
if(! $x) {
// not in address book, see if they've got an xchan
@@ -131,7 +130,7 @@ function get_all_perms($uid, $observer_xchan, $internal_use = true) {
// If they're blocked - they can't read or write
- if(($x) && ($x[0]['abook_flags'] & ABOOK_FLAG_BLOCKED)) {
+ if(($x) && intval($x[0]['abook_blocked'])) {
$ret[$perm_name] = false;
continue;
}
@@ -139,7 +138,7 @@ function get_all_perms($uid, $observer_xchan, $internal_use = true) {
// Check if this is a write permission and they are being ignored
// This flag is only visible internally.
- if(($x) && ($internal_use) && (! $global_perms[$perm_name][2]) && ($x[0]['abook_flags'] & ABOOK_FLAG_IGNORED)) {
+ if(($x) && ($internal_use) && (! $global_perms[$perm_name][2]) && intval($x[0]['abook_ignored'])) {
$ret[$perm_name] = false;
continue;
}
@@ -218,7 +217,7 @@ function get_all_perms($uid, $observer_xchan, $internal_use = true) {
continue;
}
- if($x[0]['abook_flags'] & ABOOK_FLAG_PENDING) {
+ if(intval($x[0]['abook_pending'])) {
$ret[$perm_name] = false;
continue;
}
@@ -300,19 +299,18 @@ function perm_is_allowed($uid, $observer_xchan, $permission) {
if($r[0][$channel_perm] & PERMS_AUTHED)
return true;
- $x = q("select abook_my_perms, abook_flags, xchan_network from abook left join xchan on abook_xchan = xchan_hash
- where abook_channel = %d and abook_xchan = '%s' and not ( abook_flags & %d )>0 limit 1",
+ $x = q("select abook_my_perms, abook_blocked, abook_ignored, abook_pending, xchan_network from abook left join xchan on abook_xchan = xchan_hash
+ where abook_channel = %d and abook_xchan = '%s' and abook_self = 0 limit 1",
intval($uid),
- dbesc($observer_xchan),
- intval(ABOOK_FLAG_SELF)
+ dbesc($observer_xchan)
);
// If they're blocked - they can't read or write
- if(($x) && ($x[0]['abook_flags'] & ABOOK_FLAG_BLOCKED))
+ if(($x) && intval($x[0]['abook_blocked']))
return false;
- if(($x) && (! $global_perms[$permission][2]) && ($x[0]['abook_flags'] & ABOOK_FLAG_IGNORED))
+ if(($x) && (! $global_perms[$permission][2]) && intval($x[0]['abook_ignored']))
return false;
if(! $x) {
@@ -374,7 +372,7 @@ function perm_is_allowed($uid, $observer_xchan, $permission) {
return true;
}
- if($x[0]['abook_flags'] & ABOOK_FLAG_PENDING) {
+ if(intval($x[0]['abook_pending'])) {
return false;
}