]> git.mxchange.org Git - friendica.git/blobdiff - include/acl_selectors.php
menu entry for "Delegations" moved to the settings.
[friendica.git] / include / acl_selectors.php
index a95c76ca3a1a1711324ad0c3b27efa6aa776a51f..ee74ccc16ab440309f1fe9ac8e24ebee026dd023 100644 (file)
@@ -321,13 +321,6 @@ function populate_acl($user = null,$celeb = false) {
        $o .= '</div>' . "\r\n";
        $o .= '<div id="acl-wrapper-end"></div>' . "\r\n";*/
 
-       // Not totally sure what input values can come
-       // This is a hotfix to prevent massive php warnings
-       if (is_array($user) AND isset($user["uid"]))
-               $uid = $user["uid"];
-       else
-               $uid = intval($user);
-
        $tpl = get_markup_template("acl_selector.tpl");
        $o = replace_macros($tpl, array(
                '$showall'=> t("Visible to everybody"),
@@ -338,7 +331,7 @@ function populate_acl($user = null,$celeb = false) {
                '$denycid' => json_encode($perms['deny_cid']),
                '$denygid' => json_encode($perms['deny_gid']),
                '$features' => array(
-                       "aclautomention"=>(feature_enabled($uid,"aclautomention")?"true":"false")
+                       "aclautomention"=>(feature_enabled($user['uid'],"aclautomention")?"true":"false")
                ),
        ));
 
@@ -406,19 +399,19 @@ function acl_lookup(&$a, $out_type = 'json') {
        } else {
                $sql_extra = $sql_extra2 = "";
        }
-       
+
        // count groups and contacts
        if ($type=='' || $type=='g'){
-               $r = q("SELECT COUNT(`id`) AS g FROM `group` WHERE `deleted` = 0 AND `uid` = %d $sql_extra",
+               $r = q("SELECT COUNT(*) AS g FROM `group` WHERE `deleted` = 0 AND `uid` = %d $sql_extra",
                        intval(local_user())
                );
                $group_count = (int)$r[0]['g'];
        } else {
                $group_count = 0;
        }
-       
+
        if ($type=='' || $type=='c'){
-               $r = q("SELECT COUNT(`id`) AS c FROM `contact` 
+               $r = q("SELECT COUNT(*) AS c FROM `contact` 
                                WHERE `uid` = %d AND `self` = 0 
                                AND `blocked` = 0 AND `pending` = 0 AND `archive` = 0
                                AND `notify` != '' $sql_extra2" ,
@@ -430,7 +423,7 @@ function acl_lookup(&$a, $out_type = 'json') {
 
                // autocomplete for Private Messages
 
-               $r = q("SELECT COUNT(`id`) AS c FROM `contact` 
+               $r = q("SELECT COUNT(*) AS c FROM `contact` 
                                WHERE `uid` = %d AND `self` = 0 
                                AND `blocked` = 0 AND `pending` = 0 AND `archive` = 0 
                                AND `network` IN ('%s','%s','%s') $sql_extra2" ,
@@ -446,7 +439,7 @@ function acl_lookup(&$a, $out_type = 'json') {
 
                // autocomplete for Contacts
 
-               $r = q("SELECT COUNT(`id`) AS c FROM `contact` 
+               $r = q("SELECT COUNT(*) AS c FROM `contact` 
                                WHERE `uid` = %d AND `self` = 0 
                                AND `pending` = 0 $sql_extra2" ,
                        intval(local_user())