diff options
Diffstat (limited to 'mod/acl.php')
-rw-r--r-- | mod/acl.php | 46 |
1 files changed, 37 insertions, 9 deletions
diff --git a/mod/acl.php b/mod/acl.php index ed9e935e9..fa399a9b5 100644 --- a/mod/acl.php +++ b/mod/acl.php @@ -55,6 +55,17 @@ function acl_init(&$a){ intval(XCHAN_FLAGS_DELETED) ); $contact_count = (int)$r[0]['c']; + + if(intval(get_config('system','taganyone')) || intval(get_pconfig(local_user(),'system','taganyone'))) { + if(((! $r) || (! $r[0]['total'])) && $type == 'c') { + $r = q("SELECT COUNT(xchan_hash) AS c FROM xchan + WHERE not (xchan_flags & %d ) $sql_extra2" , + intval(XCHAN_FLAGS_DELETED) + ); + $contact_count = (int)$r[0]['c']; + } + } + } elseif ($type == 'm') { @@ -134,7 +145,15 @@ function acl_init(&$a){ intval(ABOOK_FLAG_BLOCKED|ABOOK_FLAG_PENDING|ABOOK_FLAG_ARCHIVED), intval(XCHAN_FLAGS_DELETED) ); - + if(intval(get_config('system','taganyone')) || intval(get_pconfig(local_user(),'system','taganyone'))) { + 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 ) $sql_extra2 order by xchan_name asc" , + intval(XCHAN_FLAGS_DELETED) + ); + } + } } elseif($type == 'm') { @@ -206,6 +225,20 @@ function acl_init(&$a){ if(count($r)) { foreach($r as $g){ + if(($g['abook_their_perms'] & PERMS_W_TAGWALL) && $type == 'c') { + $contacts[] = array( + "type" => "c", + "photo" => "images/twopeople.png", + "name" => $g['name'] . '+', + "id" => $g['id'] . '+', + "xid" => $g['hash'], + "link" => $g['nick'], + "nick" => substr($g['nick'],0,strpos($g['nick'],'@')), + "self" => (($g['abook_flags'] & ABOOK_FLAG_SELF) ? 'abook-self' : ''), + "taggable" => 'taggable', + "label" => t('network') + ); + } $contacts[] = array( "type" => "c", "photo" => $g['micro'], @@ -215,7 +248,8 @@ function acl_init(&$a){ "link" => $g['nick'], "nick" => substr($g['nick'],0,strpos($g['nick'],'@')), "self" => (($g['abook_flags'] & ABOOK_FLAG_SELF) ? 'abook-self' : ''), - "taggable" => (($g['abook_their_perms'] & PERMS_W_TAGWALL) ? 'taggable' : '') + "taggable" => '', + "label" => '', ); } } @@ -270,13 +304,7 @@ function navbar_complete(&$a) { if(! $url) { require_once("include/dir_fns.php"); $directory = find_upstream_directory($dirmode); - - if($directory) { - $url = $directory['url'] . '/dirsearch'; - } - else { - $url = DIRECTORY_FALLBACK_MASTER . '/dirsearch'; - } + $url = $directory['url'] . '/dirsearch'; } if($url) { |