diff options
author | friendica <info@friendica.com> | 2012-05-21 22:54:39 -0700 |
---|---|---|
committer | friendica <info@friendica.com> | 2012-05-21 22:54:39 -0700 |
commit | a16382529135a76c5afaf4d4189856734a8e7f58 (patch) | |
tree | d18813f3fa56c23738385aa627ac5b4da38cea61 /mod | |
parent | 9ca3ac6e61ff57a2bc615b133a64b0a7f66b3c41 (diff) | |
download | volse-hubzilla-a16382529135a76c5afaf4d4189856734a8e7f58.tar.gz volse-hubzilla-a16382529135a76c5afaf4d4189856734a8e7f58.tar.bz2 volse-hubzilla-a16382529135a76c5afaf4d4189856734a8e7f58.zip |
redir links for permission controlled attachments
Diffstat (limited to 'mod')
-rw-r--r-- | mod/item.php | 16 | ||||
-rw-r--r-- | mod/redir.php | 2 |
2 files changed, 7 insertions, 11 deletions
diff --git a/mod/item.php b/mod/item.php index 9f6b2aef4..81dd553cd 100644 --- a/mod/item.php +++ b/mod/item.php @@ -290,18 +290,16 @@ function item_post(&$a) { $author = null; $self = false; - if(($_SESSION['uid']) && ($_SESSION['uid'] == $profile_uid)) { + if((local_user()) && (local_user() == $profile_uid)) { $self = true; $r = q("SELECT * FROM `contact` WHERE `uid` = %d AND `self` = 1 LIMIT 1", intval($_SESSION['uid']) ); } - else { - if((x($_SESSION,'visitor_id')) && (intval($_SESSION['visitor_id']))) { - $r = q("SELECT * FROM `contact` WHERE `id` = %d LIMIT 1", - intval($_SESSION['visitor_id']) - ); - } + elseif(remote_user()) { + $r = q("SELECT * FROM `contact` WHERE `id` = %d LIMIT 1", + intval(remote_user()) + ); } if(count($r)) { @@ -311,7 +309,7 @@ function item_post(&$a) { // get contact info for owner - if($profile_uid == $_SESSION['uid']) { + if($profile_uid == local_user()) { $contact_record = $author; } else { @@ -322,8 +320,6 @@ function item_post(&$a) { $contact_record = $r[0]; } - - $post_type = notags(trim($_REQUEST['type'])); if($post_type === 'net-comment') { diff --git a/mod/redir.php b/mod/redir.php index 9223e5483..0f7b5cc23 100644 --- a/mod/redir.php +++ b/mod/redir.php @@ -6,7 +6,7 @@ function redir_init(&$a) { // traditional DFRN - if(local_user() && $a->argc == 2 && intval($a->argv[1])) { + if(local_user() && $a->argc > 1 && intval($a->argv[1])) { $cid = $a->argv[1]; |