From 84e603aa91a303a1419962ff3ff6086710a7b1a9 Mon Sep 17 00:00:00 2001 From: Mark Pemberton Date: Sat, 4 Jun 2011 00:29:04 -0400 Subject: Reverted changes of date() to gdate(), added tests to confirm existence of private RSS feed, and finalized changes to the user session usage with rss.php --- www/ajaxGetNewPrivateKey.php | 31 ++++++++++++------------------- www/index.php | 2 +- www/jsScuttle.php | 8 ++++++++ www/rss.php | 14 ++------------ 4 files changed, 23 insertions(+), 32 deletions(-) (limited to 'www') diff --git a/www/ajaxGetNewPrivateKey.php b/www/ajaxGetNewPrivateKey.php index 59545a2..eacebd8 100644 --- a/www/ajaxGetNewPrivateKey.php +++ b/www/ajaxGetNewPrivateKey.php @@ -1,23 +1,16 @@ + * @author Mark Pemberton + * @license AGPL http://www.gnu.org/licenses/agpl.html + * @link http://sourceforge.net/projects/semanticscuttle + */ header("Last-Modified: ". gmdate("D, d M Y H:i:s") ." GMT"); header("Cache-Control: no-cache, must-revalidate"); diff --git a/www/index.php b/www/index.php index 931d64d..fab235f 100644 --- a/www/index.php +++ b/www/index.php @@ -51,7 +51,7 @@ if ($userservice->isLoggedOn()) { array_push( $tplVars['rsschannels'], array( - filter($sitename . sprintf(T_(': (private) ')) . $currentUsername), + filter($sitename . sprintf(T_(': Recent bookmarks (private)')) . $currentUsername), createURL('rss', filter($currentUsername, 'url') . '?sort='.getSortOrder().'&privatekey='.$currentUser->getPrivateKey()) ) ); diff --git a/www/jsScuttle.php b/www/jsScuttle.php index 76b49dc..3ca41ec 100644 --- a/www/jsScuttle.php +++ b/www/jsScuttle.php @@ -89,6 +89,14 @@ function useAddress(ele) { } } +/** + * Makes an ajax call to PHP script to generate an new Private Key + * + * @param input Calling object + * @param response Response object that returned value is placed + * + * @return boolean Returns false to halt execution after call + */ function getNewPrivateKey(input, response){ var pk = document.getElementById('pPrivateKey'); if (response != null) { diff --git a/www/rss.php b/www/rss.php index 8c81e0e..2927534 100644 --- a/www/rss.php +++ b/www/rss.php @@ -71,7 +71,6 @@ if (isset($_GET['privatekey'])) { $watchlist = null; $pagetitle = ''; -$isTempLogin = false; if ($user && $user != 'all') { if ($user == 'watchlist') { $user = $cat; @@ -86,9 +85,7 @@ if ($user && $user != 'all') { /* if user is not logged in and has valid privatekey */ if (!$userservice->isLoggedOn()) { if ($privatekey != null) { - if ($userservice->loginPrivateKey($privatekey)) { - $isTempLogin = true; - } else { + 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); @@ -109,9 +106,7 @@ if ($user && $user != 'all') { $pagetitle .= ": ". $user; } else { if ($privatekey != null) { - if ($userservice->loginPrivateKey($privatekey)) { - $isTempLogin = true; - } else { + 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); @@ -168,11 +163,6 @@ $tplVars['feedlastupdate'] = date('r', strtotime($latestdate)); $templateservice->loadTemplate('rss.tpl', $tplVars); -/* If temporary login, please log out */ -if ($isTempLogin) { - $userservice->logout(); -} - if ($usecache) { // Cache output if existing copy has expired $cacheservice->End($hash); -- cgit v1.2.3