aboutsummaryrefslogtreecommitdiffstats
path: root/mod/display.php
diff options
context:
space:
mode:
authorFriendika <info@friendika.com>2011-06-30 17:35:35 -0700
committerFriendika <info@friendika.com>2011-06-30 17:35:35 -0700
commit53653f6a4d6b4c9d348d7e9d8eb1648469b031af (patch)
tree9b2ccc93946de6f127d4a90a74b93eaa2de6dcaa /mod/display.php
parentb03df35b02907a78a5787654a57e73810e707f6a (diff)
downloadvolse-hubzilla-53653f6a4d6b4c9d348d7e9d8eb1648469b031af.tar.gz
volse-hubzilla-53653f6a4d6b4c9d348d7e9d8eb1648469b031af.tar.bz2
volse-hubzilla-53653f6a4d6b4c9d348d7e9d8eb1648469b031af.zip
consolidate perrmisions sql, minor duepuntozero validation fixes
Diffstat (limited to 'mod/display.php')
-rw-r--r--mod/display.php37
1 files changed, 1 insertions, 36 deletions
diff --git a/mod/display.php b/mod/display.php
index fdb93e480..305a21825 100644
--- a/mod/display.php
+++ b/mod/display.php
@@ -59,42 +59,7 @@ function display_content(&$a) {
if(count($r))
$a->page_contact = $r[0];
- $sql_extra = "
- AND `allow_cid` = ''
- AND `allow_gid` = ''
- AND `deny_cid` = ''
- AND `deny_gid` = ''
- ";
-
-
- // Profile owner - everything is visible
-
- if(local_user() && (local_user() == $a->profile['uid'])) {
- $sql_extra = '';
- }
-
- // authenticated visitor - here lie dragons
- // If $remotecontact is true, we know that not only is this a remotely authenticated
- // person, but that it is *our* contact, which is important in multi-user mode.
-
- elseif($remote_contact) {
- $gs = '<<>>'; // should be impossible to match
- if(count($groups)) {
- foreach($groups as $g)
- $gs .= '|<' . intval($g) . '>';
- }
- $sql_extra = sprintf(
- " AND ( `allow_cid` = '' OR `allow_cid` REGEXP '<%d>' )
- AND ( `deny_cid` = '' OR NOT `deny_cid` REGEXP '<%d>' )
- AND ( `allow_gid` = '' OR `allow_gid` REGEXP '%s' )
- AND ( `deny_gid` = '' OR NOT `deny_gid` REGEXP '%s') ",
-
- intval($_SESSION['visitor_id']),
- intval($_SESSION['visitor_id']),
- dbesc($gs),
- dbesc($gs)
- );
- }
+ $sql_extra = permissions_sql($a->profile['uid'],$remote_contact,$groups);
$r = q("SELECT `item`.*, `item`.`id` AS `item_id`,
`contact`.`name`, `contact`.`photo`, `contact`.`url`, `contact`.`rel`,