diff options
author | friendica <info@friendica.com> | 2015-01-27 20:00:43 -0800 |
---|---|---|
committer | friendica <info@friendica.com> | 2015-01-27 20:00:43 -0800 |
commit | a2cdd1499c968c31ae1b95933231f80be5fc639b (patch) | |
tree | 231780d92f46a0f265e79fa478c3b7e7fc84d085 /mod/acl.php | |
parent | 0bfbe6d61d3c6250a162a29d2cdb0ec78ad02f1d (diff) | |
parent | 145b30adfc21b7f29d1431ebd1e2e0f4ebd853bf (diff) | |
download | volse-hubzilla-a2cdd1499c968c31ae1b95933231f80be5fc639b.tar.gz volse-hubzilla-a2cdd1499c968c31ae1b95933231f80be5fc639b.tar.bz2 volse-hubzilla-a2cdd1499c968c31ae1b95933231f80be5fc639b.zip |
Merge branch 'master' into tres
Conflicts:
include/socgraph.php
Diffstat (limited to 'mod/acl.php')
-rw-r--r-- | mod/acl.php | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/mod/acl.php b/mod/acl.php index a1ed177c8..5d08c3e5b 100644 --- a/mod/acl.php +++ b/mod/acl.php @@ -33,7 +33,7 @@ function acl_init(&$a){ $sql_extra2 = "AND ( xchan_name LIKE " . protect_sprintf( "'%" . dbesc($search) . "%'" ) . " OR xchan_addr LIKE " . protect_sprintf( "'%" . dbesc($search) . ((strpos($search,'@') === false) ? "%@%'" : "%'")) . ") "; // This horrible mess is needed because position also returns 0 if nothing is found. W/ould be MUCH easier if it instead returned a very large value - // Otherwise we could just order by LEAST(POSTION($search IN xchan_name),POSITION($search IN xchan_addr)). + // Otherwise we could just order by LEAST(POSITION($search IN xchan_name),POSITION($search IN xchan_addr)). $order_extra2 = "CASE WHEN xchan_name LIKE " . protect_sprintf( "'%" . dbesc($search) . "%'" ) ." then POSITION('".dbesc($search)."' IN xchan_name) else position('".dbesc($search)."' IN xchan_addr) end, "; $col = ((strpos($search,'@') !== false) ? 'xchan_addr' : 'xchan_name' ); $sql_extra3 = "AND $col like " . protect_sprintf( "'%" . dbesc($search) . "%'" ) . " "; @@ -167,6 +167,7 @@ function acl_init(&$a){ ); } 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 xchan_deleted = 0 @@ -174,6 +175,7 @@ function acl_init(&$a){ ORDER BY xchan_name ASC ", intval(local_user()) ); + } elseif($type == 'x') { $r = navbar_complete($a); @@ -203,7 +205,7 @@ function acl_init(&$a){ foreach($r as $g){ // remove RSS feeds from ACLs - they are inaccessible - if(strpos($g['hash'],'/')) + if(strpos($g['hash'],'/') && $type != 'a') continue; if(($g['abook_their_perms'] & PERMS_W_TAGWALL) && $type == 'c' && (! $noforums)) { @@ -227,7 +229,7 @@ function acl_init(&$a){ "id" => $g['id'], "xid" => $g['hash'], "link" => $g['nick'], - "nick" => substr($g['nick'],0,strpos($g['nick'],'@')), + "nick" => (($g['nick']) ? substr($g['nick'],0,strpos($g['nick'],'@')) : t('RSS')), "self" => (($g['abook_flags'] & ABOOK_FLAG_SELF) ? 'abook-self' : ''), "taggable" => '', "label" => '', @@ -242,6 +244,8 @@ function acl_init(&$a){ 'count' => $count, 'items' => $items, ); + + echo json_encode($o); |