summaryrefslogtreecommitdiffstatshomepage
path: root/www/rss.php
diff options
context:
space:
mode:
Diffstat (limited to 'www/rss.php')
-rw-r--r--www/rss.php33
1 files changed, 31 insertions, 2 deletions
diff --git a/www/rss.php b/www/rss.php
index 50240e5..2927534 100644
--- a/www/rss.php
+++ b/www/rss.php
@@ -64,6 +64,10 @@ if (!isset($rssEntries) || $rssEntries <= 0) {
$rssEntries = $maxRssEntries;
}
+$privatekey = null;
+if (isset($_GET['privatekey'])) {
+ $privatekey = $_GET['privatekey'];
+}
$watchlist = null;
$pagetitle = '';
@@ -78,8 +82,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 +105,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 +128,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']);