diff options
author | Yalçın Can <ylcncn@gmail.com> | 2011-07-27 14:23:37 +0300 |
---|---|---|
committer | Yalçın Can <ylcncn@gmail.com> | 2011-07-27 14:23:37 +0300 |
commit | efd842174fdd37f8eb2c460c7adb21954bcfbe9d (patch) | |
tree | a2ab3cc25db92b901b69ce1bc0ad1dedb5d498ef /www/rss.php | |
parent | 8cd40b3d76e191b2fbe95b044f69aed07cc27664 (diff) | |
parent | 81aa17b8523d95310c90366d9af09767db0c84f2 (diff) | |
download | semanticscuttle-efd842174fdd37f8eb2c460c7adb21954bcfbe9d.tar.gz semanticscuttle-efd842174fdd37f8eb2c460c7adb21954bcfbe9d.tar.bz2 |
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'www/rss.php')
-rw-r--r-- | www/rss.php | 34 |
1 files changed, 32 insertions, 2 deletions
diff --git a/www/rss.php b/www/rss.php index 50240e5..d888726 100644 --- a/www/rss.php +++ b/www/rss.php @@ -64,7 +64,12 @@ if (!isset($rssEntries) || $rssEntries <= 0) { $rssEntries = $maxRssEntries; } +$privateKey = null; +if (isset($_GET['privateKey'])) { + $privateKey = $_GET['privateKey']; +} +$userid = null; $watchlist = null; $pagetitle = ''; if ($user && $user != 'all') { @@ -78,8 +83,22 @@ if ($user && $user != 'all') { } else { if ($userinfo = $userservice->getUserByUsername($user)) { $userid =& $userinfo[$userservice->getFieldName('primary')]; + /* if user is not logged in and has valid privateKey */ + if (!$userservice->isLoggedOn()) { + if ($privateKey != null) { + if (!$userservice->loginPrivateKey($privateKey)) { + $tplVars['error'] = sprintf(T_('Failed to Autenticate User with username %s using private key'), $user); + header('Content-type: text/html; charset=utf-8'); + $templateservice->loadTemplate('error.404.tpl', $tplVars); + //throw a 404 error + exit(); + } + } + } + } else { $tplVars['error'] = sprintf(T_('User with username %s was not found'), $user); + header('Content-type: text/html; charset=utf-8'); $templateservice->loadTemplate('error.404.tpl', $tplVars); //throw a 404 error exit(); @@ -87,7 +106,17 @@ if ($user && $user != 'all') { } $pagetitle .= ": ". $user; } else { - $userid = null; + if ($privateKey != null) { + if (!$userservice->loginPrivateKey($privateKey)) { + $tplVars['error'] = sprintf(T_('Failed to Autenticate User with username %s using private key'), $user); + header('Content-type: text/html; charset=utf-8'); + $templateservice->loadTemplate('error.404.tpl', $tplVars); + //throw a 404 error + exit(); + } + } else { + $userid = null; + } } if ($cat) { @@ -100,7 +129,8 @@ $tplVars['feeddescription'] = sprintf(T_('Recent bookmarks posted to %s'), $GLOB $bookmarks = $bookmarkservice->getBookmarks( 0, $rssEntries, $userid, $cat, - null, getSortOrder(), $watchlist + null, getSortOrder(), $watchlist, + null, null, null ); $bookmarks_tmp = filter($bookmarks['bookmarks']); |