diff options
| author | cweiske <cweiske@b3834d28-1941-0410-a4f8-b48e95affb8f> | 2009-10-27 19:58:54 +0000 | 
|---|---|---|
| committer | cweiske <cweiske@b3834d28-1941-0410-a4f8-b48e95affb8f> | 2009-10-27 19:58:54 +0000 | 
| commit | f24a387cc95661ed724d4a51651a96a0f1b8c488 (patch) | |
| tree | 972c61dd832f597ae046f6cf0c4fb99e9ee77920 /www/vote.php | |
| parent | af157c6bb72518f8ee3096f6370c920ef9b965a3 (diff) | |
| download | semanticscuttle-f24a387cc95661ed724d4a51651a96a0f1b8c488.tar.gz semanticscuttle-f24a387cc95661ed724d4a51651a96a0f1b8c488.tar.bz2 | |
Move URL redirection from URL to session parameter
git-svn-id: https://semanticscuttle.svn.sourceforge.net/svnroot/semanticscuttle/trunk@433 b3834d28-1941-0410-a4f8-b48e95affb8f
Diffstat (limited to 'www/vote.php')
| -rw-r--r-- | www/vote.php | 14 | 
1 files changed, 7 insertions, 7 deletions
| diff --git a/www/vote.php b/www/vote.php index 91f5c34..6dda31b 100644 --- a/www/vote.php +++ b/www/vote.php @@ -3,9 +3,9 @@   * We do expect three parameters:   * - type (for/against)   * - bookmark id - * - url we shall redirect to (?from=) + * - session needs to contain the URL last visited   * - * vote/for/123?from=xyz + * vote/for/123   */  require_once '../src/SemanticScuttle/header.php'; @@ -21,7 +21,7 @@ $vs = SemanticScuttle_Service_Factory::get('Vote');  if (!$us->isLoggedOn()) {      header('HTTP/1.0 400 Bad Request'); -    echo 'need a logged on user'; +    echo 'You need to be logged on to vote.';      exit(1);  }  $user = $us->getCurrentUser(); @@ -49,12 +49,12 @@ if (!is_numeric($bookmark)) {  }  $bookmark = (int)$bookmark; -if (!isset($_GET['from']) || $_GET['from'] == '') { -    header('HTTP/1.0 400 Bad Request'); -    echo 'Missing "from" parameter'; +if (!isset($GLOBALS['lastUrl']) || $GLOBALS['lastUrl'] == '') { +    header('HTTP/1.0 412 Precondition failed'); +    echo 'Missing last URL in session';      exit(5);  } -$from = $_GET['from']; +$from = $GLOBALS['lastUrl'];  if ($vs->hasVoted($bookmark, $user)) { | 
