aboutsummaryrefslogtreecommitdiffstats
path: root/mod
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2013-07-15 18:07:23 -0700
committerfriendica <info@friendica.com>2013-07-15 18:07:23 -0700
commit3bd7c1af238191bd9b1a739b7123fc1ec0296174 (patch)
tree8d6d9279f2f3928dc1b4f3b9ad44de00f7c0b64a /mod
parentf384695e3d0fe86b9a059ab4f289042bf17d2da2 (diff)
downloadvolse-hubzilla-3bd7c1af238191bd9b1a739b7123fc1ec0296174.tar.gz
volse-hubzilla-3bd7c1af238191bd9b1a739b7123fc1ec0296174.tar.bz2
volse-hubzilla-3bd7c1af238191bd9b1a739b7123fc1ec0296174.zip
fix some issues that showed up in the logs.
Diffstat (limited to 'mod')
-rw-r--r--mod/acl.php17
1 files changed, 9 insertions, 8 deletions
diff --git a/mod/acl.php b/mod/acl.php
index df6de13b2..382d9d90c 100644
--- a/mod/acl.php
+++ b/mod/acl.php
@@ -60,16 +60,17 @@ function acl_init(&$a){
// 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 `archive` = 0
- AND `network` IN ('%s','%s','%s') $sql_extra2" ,
+
+ $r = q("SELECT count xchan_hash as c
+ FROM abook left join xchan on abook_xchan = xchan_hash
+ WHERE abook_channel = %d and ( (abook_their_perms = null) or (abook_their_perms & %d ))
+ $sql_extra2 ",
intval(local_user()),
- dbesc(NETWORK_DFRN),
- dbesc(NETWORK_ZOT),
- dbesc(NETWORK_DIASPORA)
+ intval(PERMS_W_MAIL)
);
- $contact_count = (int)$r[0]['c'];
+
+ if($r)
+ $contact_count = (int)$r[0]['c'];
}
elseif ($type == 'a') {