diff options
author | Vasudev Kamath <kamathvasudev@gmail.com> | 2012-06-11 20:47:11 +0530 |
---|---|---|
committer | Vasudev Kamath <kamathvasudev@gmail.com> | 2012-06-11 20:47:11 +0530 |
commit | 11974b4d948ae5d9b9fb53970838463bd88bb9f6 (patch) | |
tree | 426724e218a2fcaf3a1a2eedf6ffa591299755ee /mod/acl.php | |
parent | 079fdecff1f4daa534045f4bd857e6ae6324474d (diff) | |
parent | afa88154114d5632cb13e7c3f56143cccdfd7daa (diff) | |
download | volse-hubzilla-11974b4d948ae5d9b9fb53970838463bd88bb9f6.tar.gz volse-hubzilla-11974b4d948ae5d9b9fb53970838463bd88bb9f6.tar.bz2 volse-hubzilla-11974b4d948ae5d9b9fb53970838463bd88bb9f6.zip |
Merge branch 'master' of git://github.com/friendica/friendica
Diffstat (limited to 'mod/acl.php')
-rw-r--r-- | mod/acl.php | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/mod/acl.php b/mod/acl.php index 1e8898ab6..f3e46efa5 100644 --- a/mod/acl.php +++ b/mod/acl.php @@ -1,5 +1,6 @@ <?php /* ACL selector json backend */ + require_once("include/acl_selectors.php"); function acl_init(&$a){ @@ -16,7 +17,8 @@ function acl_init(&$a){ // For use with jquery.autocomplete for private mail completion if(x($_REQUEST,'query') && strlen($_REQUEST['query'])) { - $type = 'm'; + if(! $type) + $type = 'm'; $search = $_REQUEST['query']; } @@ -62,6 +64,18 @@ function acl_init(&$a){ ); $contact_count = (int)$r[0]['c']; + } + elseif ($type == 'a') { + + // autocomplete for Contacts + + $r = q("SELECT COUNT(`id`) AS c FROM `contact` + WHERE `uid` = %d AND `self` = 0 + AND `pending` = 0 $sql_extra2" , + intval(local_user()) + ); + $contact_count = (int)$r[0]['c']; + } else { $contact_count = 0; } @@ -120,11 +134,19 @@ function acl_init(&$a){ dbesc(NETWORK_DIASPORA) ); } + elseif($type == 'a') { + $r = q("SELECT `id`, `name`, `nick`, `micro`, `network`, `url`, `attag` FROM `contact` + WHERE `uid` = %d AND `pending` = 0 + $sql_extra2 + ORDER BY `name` ASC ", + intval(local_user()) + ); + } else $r = array(); - if($type == 'm') { + if($type == 'm' || $type == 'a') { $x = array(); $x['query'] = $search; $x['photos'] = array(); |