aboutsummaryrefslogtreecommitdiffstats
path: root/mod/acl.php
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2015-01-20 19:33:19 -0800
committerfriendica <info@friendica.com>2015-01-20 19:33:19 -0800
commit51848c619080e19cace647966a17eb9a1b42ca25 (patch)
tree6aee6c9487813051801cabbd2a4914528232d5b5 /mod/acl.php
parentee3eee425c92b37fba5a7035d8e9ec0b0b563d0b (diff)
downloadvolse-hubzilla-51848c619080e19cace647966a17eb9a1b42ca25.tar.gz
volse-hubzilla-51848c619080e19cace647966a17eb9a1b42ca25.tar.bz2
volse-hubzilla-51848c619080e19cace647966a17eb9a1b42ca25.zip
working through the xchan table to remove bitfields, mostly complete except for updating the updater
Diffstat (limited to 'mod/acl.php')
-rw-r--r--mod/acl.php30
1 files changed, 12 insertions, 18 deletions
diff --git a/mod/acl.php b/mod/acl.php
index d406942c3..a1ed177c8 100644
--- a/mod/acl.php
+++ b/mod/acl.php
@@ -94,18 +94,17 @@ function acl_init(&$a){
$r = q("SELECT abook_id as id, xchan_hash as hash, xchan_name as name, xchan_photo_s as micro, xchan_url as url, xchan_addr as nick, abook_their_perms, abook_flags
FROM abook left join xchan on abook_xchan = xchan_hash
- WHERE (abook_channel = %d $extra_channels_sql) AND not ( abook_flags & %d )>0 and not (xchan_flags & %d )>0 $sql_extra2 order by $order_extra2 xchan_name asc" ,
+ WHERE (abook_channel = %d $extra_channels_sql) AND not ( abook_flags & %d )>0 and xchan_deleted = 0 $sql_extra2 order by $order_extra2 xchan_name asc" ,
intval(local_user()),
- intval(ABOOK_FLAG_BLOCKED|ABOOK_FLAG_PENDING|ABOOK_FLAG_ARCHIVED),
- intval(XCHAN_FLAGS_DELETED)
+ intval(ABOOK_FLAG_BLOCKED|ABOOK_FLAG_PENDING|ABOOK_FLAG_ARCHIVED)
);
}
else { // Visitors
$r = q("SELECT xchan_hash as id, xchan_hash as hash, xchan_name as name, xchan_photo_s as micro, xchan_url as url, xchan_addr as nick, 0 as abook_their_perms, 0 as abook_flags
FROM xchan left join xlink on xlink_link = xchan_hash
- WHERE xlink_xchan = '%s' AND NOT (xchan_flags & %d) > 0 $sql_extra2 order by $order_extra2 xchan_name asc" ,
- dbesc(get_observer_hash()),
- intval(XCHAN_FLAGS_DELETED));
+ WHERE xlink_xchan = '%s' AND xchan_deleted = 0 $sql_extra2 order by $order_extra2 xchan_name asc" ,
+ dbesc(get_observer_hash())
+ );
// Find contacts of extra channels
// This is probably more complicated than it needs to be
@@ -119,9 +118,8 @@ function acl_init(&$a){
$r2 = q("SELECT abook_id as id, xchan_hash as hash, xchan_name as name, xchan_photo_s as micro, xchan_url as url, xchan_addr as nick, abook_their_perms, abook_flags
FROM abook left join xchan on abook_xchan = xchan_hash
- WHERE abook_channel IN ($extra_channels_sql) $known_hashes_sql AND not ( abook_flags & %d )>0 and not (xchan_flags & %d )>0 $sql_extra2 order by $order_extra2 xchan_name asc" ,
- intval(ABOOK_FLAG_BLOCKED|ABOOK_FLAG_PENDING|ABOOK_FLAG_ARCHIVED|ABOOK_FLAG_HIDDEN),
- intval(XCHAN_FLAGS_DELETED)
+ WHERE abook_channel IN ($extra_channels_sql) $known_hashes_sql AND not ( abook_flags & %d )>0 and xchan_deleted = 0 $sql_extra2 order by $order_extra2 xchan_name asc" ,
+ intval(ABOOK_FLAG_BLOCKED|ABOOK_FLAG_PENDING|ABOOK_FLAG_ARCHIVED|ABOOK_FLAG_HIDDEN)
);
if($r2)
$r = array_merge($r,$r2);
@@ -151,8 +149,7 @@ function acl_init(&$a){
if((! $r) && $type == 'c') {
$r = q("SELECT substr(xchan_hash,1,18) as id, xchan_hash as hash, xchan_name as name, xchan_photo_s as micro, xchan_url as url, xchan_addr as nick, 0 as abook_their_perms, 0 as abook_flags
FROM xchan
- WHERE not (xchan_flags & %d )>0 $sql_extra2 order by $order_extra2 xchan_name asc" ,
- intval(XCHAN_FLAGS_DELETED)
+ WHERE xchan_deleted = 0 $sql_extra2 order by $order_extra2 xchan_name asc"
);
}
}
@@ -162,23 +159,20 @@ function acl_init(&$a){
$r = q("SELECT xchan_hash as id, xchan_name as name, xchan_addr as nick, xchan_photo_s as micro, xchan_url as url
FROM abook left join xchan on abook_xchan = xchan_hash
WHERE abook_channel = %d and ( (abook_their_perms = null) or (abook_their_perms & %d )>0)
- and not (xchan_flags & %d)>0
+ and xchan_deleted = 0
$sql_extra3
ORDER BY `xchan_name` ASC ",
intval(local_user()),
- intval(PERMS_W_MAIL),
- intval(XCHAN_FLAGS_DELETED)
+ intval(PERMS_W_MAIL)
);
}
elseif(($type == 'a') || ($type == 'p')) {
$r = q("SELECT abook_id as id, xchan_name as name, xchan_hash as hash, xchan_addr as nick, xchan_photo_s as micro, xchan_network as network, xchan_url as url, xchan_addr as attag , abook_their_perms FROM abook left join xchan on abook_xchan = xchan_hash
WHERE abook_channel = %d
- and not (xchan_flags & %d)>0
+ and xchan_deleted = 0
$sql_extra3
ORDER BY xchan_name ASC ",
- intval(local_user()),
- intval(XCHAN_FLAGS_DELETED)
-
+ intval(local_user())
);
}
elseif($type == 'x') {