diff options
author | Simon L'nu <simon.lnu@gmail.com> | 2012-04-24 03:33:46 -0400 |
---|---|---|
committer | Simon L'nu <simon.lnu@gmail.com> | 2012-04-24 03:33:46 -0400 |
commit | 0e2c6c28198b0e27087ceea6d1ba9d1891405549 (patch) | |
tree | 0d5afc1cb1934f1bedfdd8a3056133564dd8a932 /mod/acl.php | |
parent | 6e9485605f64394f8e6d830b8a959a5afc85cf2d (diff) | |
parent | 7923404c836979f5da7bd7ab47b1d93d137af1cc (diff) | |
download | volse-hubzilla-0e2c6c28198b0e27087ceea6d1ba9d1891405549.tar.gz volse-hubzilla-0e2c6c28198b0e27087ceea6d1ba9d1891405549.tar.bz2 volse-hubzilla-0e2c6c28198b0e27087ceea6d1ba9d1891405549.zip |
Merge branch 'master', remote-tracking branch 'remotes/upstream/master'
* remotes/upstream/master:
separate tag search from body search
Esperanto at 100% again
Improvements to diabook-dark
move unfriend to standalone function for use in account removal
more work on mail2 (introductions), added 'm' (mail) flag to ACL backend for autocomplete of PM recips
* master:
Diffstat (limited to 'mod/acl.php')
-rw-r--r-- | mod/acl.php | 39 |
1 files changed, 35 insertions, 4 deletions
diff --git a/mod/acl.php b/mod/acl.php index fe353d1eb..c23ee1a67 100644 --- a/mod/acl.php +++ b/mod/acl.php @@ -38,6 +38,22 @@ function acl_init(&$a){ intval(local_user()) ); $contact_count = (int)$r[0]['c']; + } + elseif ($type == 'm') { + + // autocomplete for Private Messages + + $r = q("SELECT COUNT(`id`) AS c FROM `contact` + WHERE `uid` = %d AND `self` = 0 + AND `blocked` = 0 AND `pending` = 0 + AND `network` IN ('%s','%s','%s') $sql_extra2" , + intval(local_user()), + dbesc(NETWORK_DFRN), + dbesc(NETWORK_ZOT), + dbesc(NETWORK_DIASPORA) + ); + $contact_count = (int)$r[0]['c']; + } else { $contact_count = 0; } @@ -83,6 +99,23 @@ function acl_init(&$a){ ORDER BY `name` ASC ", intval(local_user()) ); + } + elseif($type == 'm') { + $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 `network` IN ('%s','%s','%s') + $sql_extra2 + ORDER BY `name` ASC ", + intval(local_user()), + dbesc(NETWORK_DFRN), + dbesc(NETWORK_ZOT), + dbesc(NETWORK_DIASPORA) + ); + } + else + $r = array(); + + if(count($r)) { foreach($r as $g){ $contacts[] = array( "type" => "c", @@ -93,11 +126,9 @@ function acl_init(&$a){ "link" => $g['url'], "nick" => ($g['attag']) ? $g['attag'] : $g['nick'], ); - } - + } } - - + $items = array_merge($groups, $contacts); $o = array( |