diff options
author | friendica <info@friendica.com> | 2012-12-05 18:39:07 -0800 |
---|---|---|
committer | friendica <info@friendica.com> | 2012-12-05 18:39:07 -0800 |
commit | 186163a5ce0be821587a2f888234a4cad993adbf (patch) | |
tree | e5d959450bd8596d0e31388b412e0d74d7915a23 /mod/acl.php | |
parent | 270266357d76392660703d290ab159774cfc2081 (diff) | |
download | volse-hubzilla-186163a5ce0be821587a2f888234a4cad993adbf.tar.gz volse-hubzilla-186163a5ce0be821587a2f888234a4cad993adbf.tar.bz2 volse-hubzilla-186163a5ce0be821587a2f888234a4cad993adbf.zip |
check permissions for mail to non-connected people, reject if no permission - but you can try and send mail to any webbie. We probably should check for this before you send the message but perhaps we can find another way to let you know if it's allowed or not without an expensive probe. Like mod_follow, a webbie without an @ is treated as a local address.
Diffstat (limited to 'mod/acl.php')
-rw-r--r-- | mod/acl.php | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/mod/acl.php b/mod/acl.php index 248ba23d0..7bd11765f 100644 --- a/mod/acl.php +++ b/mod/acl.php @@ -29,7 +29,10 @@ function acl_init(&$a){ if ($search!=""){ $sql_extra = "AND `name` LIKE '%%".dbesc($search)."%%'"; $sql_extra2 = "AND (`attag` LIKE '%%".dbesc($search)."%%' OR `name` LIKE '%%".dbesc($search)."%%' OR `nick` LIKE '%%".dbesc($search)."%%')"; - $sql_extra3 = "AND ( xchan_name like '%%" . dbesc($search) . "%%' )"; + + $col = ((strpos($search,'@') !== false) ? 'xchan_addr' : 'xchan_name' ); + $sql_extra3 = "AND $col like " . protect_sprintf( "'%" . dbesc($search) . "%'" ) . " "; + } else { $sql_extra = $sql_extra2 = $sql_extra3 = ""; } @@ -127,12 +130,16 @@ function acl_init(&$a){ ); } elseif($type == 'm') { - $r = q("SELECT xchan_hash as id, xchan_name as name, xchan_photo_s as micro, xchan_url as url from xchan - where 1 +dbg(1); + $r = q("SELECT xchan_hash as id, xchan_name as name, xchan_addr as nick, xchan_photo_s as micro, xchan_url as url + 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_extra3 ORDER BY `xchan_name` ASC ", - intval(local_user()) + intval(local_user()), + intval(PERMS_W_MAIL) ); +dbg(0); } elseif($type == 'a') { $r = q("SELECT abook_id as id, xchan_name as name, xchan_addr as nick, xchan_photo_s as micro, xchan_network as network, xchan_url as url, xchan_addr as attag FROM abook left join xchan on abook_xchan = xchan_hash |