]> git.mxchange.org Git - friendica.git/blobdiff - include/acl_selectors.php
Degrade priority step by step
[friendica.git] / include / acl_selectors.php
index f57af575afa3091124e3dff1716d6b288c6c62fe..6f08523ca97dffded9ea03eb61229859667e9e45 100644 (file)
@@ -4,6 +4,8 @@
  * @file include/acl_selectors.php
  */
 
+use Friendica\App;
+
 require_once "include/contact_selectors.php";
 require_once "include/contact_widgets.php";
 require_once "include/DirSearch.php";
@@ -207,7 +209,7 @@ function contact_select($selname, $selclass, $preselected = false, $size = 4, $p
 
        $tabindex = ($tabindex > 0 ? "tabindex=\"$tabindex\"" : "");
 
-       if ($privmail AND $preselected) {
+       if ($privmail && $preselected) {
                $sql_extra .= " AND `id` IN (".implode(",", $preselected).")";
                $hidepreselected = ' style="display: none;"';
        } else {
@@ -259,7 +261,7 @@ function contact_select($selname, $selclass, $preselected = false, $size = 4, $p
 
        $o .= "</select>\r\n";
 
-       if ($privmail AND $preselected) {
+       if ($privmail && $preselected) {
                $o .= implode(", ", $receiverlist);
        }
 
@@ -386,6 +388,9 @@ function populate_acl($user = null, $show_jotnets = false) {
 }
 
 function construct_acl_data(App $a, $user) {
+       // This function is now deactivated. It seems as if the generated data isn't used anywhere.
+       /// @todo Remove this function and all function calls before releasing Friendica 3.5.3
+       return;
 
        // Get group and contact information for html ACL selector
        $acl_data = acl_lookup($a, 'html');
@@ -543,7 +548,7 @@ function acl_lookup(App $a, $out_type = 'json') {
 
        if ($type == '') {
 
-               $r = q("SELECT `id`, `name`, `nick`, `micro`, `network`, `url`, `attag`, `forum`, `prv` FROM `contact`
+               $r = q("SELECT `id`, `name`, `nick`, `micro`, `network`, `url`, `attag`, `addr`, `forum`, `prv` FROM `contact`
                        WHERE `uid` = %d AND NOT `self` AND NOT `blocked` AND NOT `pending` AND NOT `archive` AND `notify` != ''
                        AND NOT (`network` IN ('%s', '%s'))
                        $sql_extra2
@@ -552,7 +557,7 @@ function acl_lookup(App $a, $out_type = 'json') {
                        dbesc(NETWORK_OSTATUS), dbesc(NETWORK_STATUSNET)
                );
        } elseif ($type == 'c') {
-               $r = q("SELECT `id`, `name`, `nick`, `micro`, `network`, `url`, `attag`, `forum`, `prv` FROM `contact`
+               $r = q("SELECT `id`, `name`, `nick`, `micro`, `network`, `url`, `attag`, `addr`, `forum`, `prv` FROM `contact`
                        WHERE `uid` = %d AND NOT `self` AND NOT `blocked` AND NOT `pending` AND NOT `archive` AND `notify` != ''
                        AND NOT (`network` IN ('%s'))
                        $sql_extra2
@@ -562,7 +567,7 @@ function acl_lookup(App $a, $out_type = 'json') {
                );
        }
        elseif ($type == 'm') {
-               $r = q("SELECT `id`, `name`, `nick`, `micro`, `network`, `url`, `attag` FROM `contact`
+               $r = q("SELECT `id`, `name`, `nick`, `micro`, `network`, `url`, `attag`, `addr` FROM `contact`
                        WHERE `uid` = %d AND NOT `self` AND NOT `blocked` AND NOT `pending` AND NOT `archive`
                        AND `network` IN ('%s','%s','%s')
                        $sql_extra2
@@ -573,7 +578,7 @@ function acl_lookup(App $a, $out_type = 'json') {
                        dbesc(NETWORK_DIASPORA)
                );
        } elseif ($type == 'a') {
-               $r = q("SELECT `id`, `name`, `nick`, `micro`, `network`, `url`, `attag`, `forum`, `prv` FROM `contact`
+               $r = q("SELECT `id`, `name`, `nick`, `micro`, `network`, `url`, `attag`, `addr`, `forum`, `prv` FROM `contact`
                        WHERE `uid` = %d AND `pending` = 0
                        $sql_extra2
                        ORDER BY `name` ASC ",
@@ -617,6 +622,7 @@ function acl_lookup(App $a, $out_type = 'json') {
                                'network' => $g['network'],
                                'link'    => $g['url'],
                                'nick'    => htmlentities(($g['attag']) ? $g['attag'] : $g['nick']),
+                               'addr'    => htmlentities(($g['addr']) ? $g['addr'] : $g['url']),
                                'forum'   => ((x($g, 'forum') || x($g, 'prv')) ? 1 : 0),
                        );
                }
@@ -661,6 +667,7 @@ function acl_lookup(App $a, $out_type = 'json') {
                                                'network' => $contact['network'],
                                                'link'    => $contact['url'],
                                                'nick'    => htmlentities($contact['nick'] ? : $contact['addr']),
+                                               'addr'    => htmlentities(($contact['addr']) ? $contact['addr'] : $contact['url']),
                                                'forum'   => $contact['forum']
                                        );
                                }