aboutsummaryrefslogtreecommitdiffstats
path: root/mod/acl.php
diff options
context:
space:
mode:
authorVasudev Kamath <kamathvasudev@gmail.com>2012-05-12 12:10:09 +0530
committerVasudev Kamath <kamathvasudev@gmail.com>2012-05-12 12:10:09 +0530
commit10db2f00f9f90cb7ee9fbd94a5c986427de779c2 (patch)
tree9504ad13c592621521f7051fb06b5ca81ce1d757 /mod/acl.php
parentb5e857c0e7ccf4ef3d33e5b6d0a4325b693a8e80 (diff)
parent2454028ef61a3ea1dd8308896c8bbf1f04f97ac9 (diff)
downloadvolse-hubzilla-10db2f00f9f90cb7ee9fbd94a5c986427de779c2.tar.gz
volse-hubzilla-10db2f00f9f90cb7ee9fbd94a5c986427de779c2.tar.bz2
volse-hubzilla-10db2f00f9f90cb7ee9fbd94a5c986427de779c2.zip
Merge branch 'master' of git://github.com/friendica/friendica
Diffstat (limited to 'mod/acl.php')
-rw-r--r--mod/acl.php28
1 files changed, 28 insertions, 0 deletions
diff --git a/mod/acl.php b/mod/acl.php
index 88f150d7a..168b1f59f 100644
--- a/mod/acl.php
+++ b/mod/acl.php
@@ -13,6 +13,14 @@ function acl_init(&$a){
$type = (x($_REQUEST,'type')?$_REQUEST['type']:"");
+ // For use with jquery.autocomplete for private mail completion
+
+ if(x($_REQUEST,'query') && strlen($_REQUEST['query'])) {
+ $type = 'm';
+ $search = $_REQUEST['query'];
+ }
+
+
if ($search!=""){
$sql_extra = "AND `name` LIKE '%%".dbesc($search)."%%'";
$sql_extra2 = "AND (`attag` LIKE '%%".dbesc($search)."%%' OR `name` LIKE '%%".dbesc($search)."%%' OR `nick` LIKE '%%".dbesc($search)."%%')";
@@ -115,6 +123,26 @@ function acl_init(&$a){
else
$r = array();
+
+ if($type == 'm') {
+ $x = array();
+ $x['query'] = $search;
+ $x['photos'] = array();
+ $x['links'] = array();
+ $x['suggestions'] = array();
+ $x['data'] = array();
+ if(count($r)) {
+ foreach($r as $g) {
+ $x['photos'][] = $g['micro'];
+ $x['links'][] = $g['url'];
+ $x['suggestions'][] = $g['name']; // sprintf( t('%s [%s]'),$g['name'],$g['url']);
+ $x['data'][] = intval($g['id']);
+ }
+ }
+ echo json_encode($x);
+ killme();
+ }
+
if(count($r)) {
foreach($r as $g){
$contacts[] = array(