]> git.mxchange.org Git - friendica.git/blobdiff - mod/acl.php
tinymce: add filebrowser for photos and attached files
[friendica.git] / mod / acl.php
index 07ca096e5bbec2f963b74d5d2d891d788a9088b8..fe353d1eb5af75e191d1f09f57e12afc0217ebdc 100644 (file)
@@ -7,15 +7,17 @@ function acl_init(&$a){
                return "";
 
 
-       $start = (x($_POST,'start')?$_POST['start']:0);
-       $count = (x($_POST,'count')?$_POST['count']:100);
-       $search = (x($_POST,'search')?$_POST['search']:"");
-       $type = (x($_POST,'type')?$_POST['type']:"");
+       $start = (x($_REQUEST,'start')?$_REQUEST['start']:0);
+       $count = (x($_REQUEST,'count')?$_REQUEST['count']:100);
+       $search = (x($_REQUEST,'search')?$_REQUEST['search']:"");
+       $type = (x($_REQUEST,'type')?$_REQUEST['type']:"");
        
 
        if ($search!=""){
                $sql_extra = "AND `name` LIKE '%%".dbesc($search)."%%'";
-               $sql_extra2 = "AND (`name` LIKE '%%".dbesc($search)."%%' OR `nick` LIKE '%%".dbesc($search)."%%')";
+               $sql_extra2 = "AND (`attag` LIKE '%%".dbesc($search)."%%' OR `name` LIKE '%%".dbesc($search)."%%' OR `nick` LIKE '%%".dbesc($search)."%%')";
+       } else {
+               $sql_extra = $sql_extra2 = "";
        }
        
        // count groups and contacts
@@ -32,7 +34,7 @@ function acl_init(&$a){
                $r = q("SELECT COUNT(`id`) AS c FROM `contact` 
                                WHERE `uid` = %d AND `self` = 0 
                                AND `blocked` = 0 AND `pending` = 0 
-                               AND `notify` != '' $sql_extra" ,
+                               AND `notify` != '' $sql_extra2" ,
                        intval(local_user())
                );
                $contact_count = (int)$r[0]['c'];
@@ -60,11 +62,11 @@ function acl_init(&$a){
                        intval($count)
                );
 
-               
                foreach($r as $g){
+//             logger('acl: group: ' . $g['name'] . ' members: ' . $g['uids']);                
                        $groups[] = array(
                                "type"  => "g",
-                               "photo" => "images/default-group-mm.png",
+                               "photo" => "images/twopeople.png",
                                "name"  => $g['name'],
                                "id"    => intval($g['id']),
                                "uids"  => array_map("intval", explode(",",$g['uids'])),
@@ -75,7 +77,7 @@ function acl_init(&$a){
        
        if ($type=='' || $type=='c'){
        
-               $r = q("SELECT `id`, `name`, `nick`, `micro`, `network`, `url` FROM `contact` 
+               $r = q("SELECT `id`, `name`, `nick`, `micro`, `network`, `url`, `attag` FROM `contact` 
                        WHERE `uid` = %d AND `self` = 0 AND `blocked` = 0 AND `pending` = 0 AND `notify` != ''
                        $sql_extra2
                        ORDER BY `name` ASC ",
@@ -89,7 +91,7 @@ function acl_init(&$a){
                                "id"    => intval($g['id']),
                                "network" => $g['network'],
                                "link" => $g['url'],
-                               "nick" => $g['nick'],
+                               "nick" => ($g['attag']) ? $g['attag'] : $g['nick'],
                        );
                }