diff --git a/board.php b/board.php index 55d7746f3..cea33f0b0 100755 --- a/board.php +++ b/board.php @@ -139,6 +139,7 @@ if ( $Game->watched() && isset($_REQUEST['unwatch'])) { print '
' .'
' + .libAuth::formTokenHTML() .'Are you sure you wish to remove this game from your spectated games list? ' .'' .' diff --git a/gamepanel/game.php b/gamepanel/game.php index 3673153d4..42295e0e8 100755 --- a/gamepanel/game.php +++ b/gamepanel/game.php @@ -537,6 +537,7 @@ function joinBar() if( $User->type['User'] && $this->phase != 'Finished') { $buf .= '' + .libAuth::formTokenHTML() .''; if( ! $this->watched() ) { $buf .= ' 60*60 ) throw new Exception("The given e-mail token link has expired; please request another one and click the link within an hour."); + + if ( $key !== substr(md5(Config::$secret.$email.$timestamp),0,8) ) return false; else return $email; diff --git a/logon.php b/logon.php index d4ef58ddd..e82edd862 100755 --- a/logon.php +++ b/logon.php @@ -79,8 +79,15 @@ } elseif ( $_REQUEST['forgotPassword'] == 3 && isset($_REQUEST['emailToken']) ) { - $email = $DB->escape(libAuth::emailToken_email($_REQUEST['emailToken'])); + $validatedEmail = libAuth::emailToken_email($_REQUEST['emailToken']); + if( $validatedEmail === false ) + throw new Exception(l_t("Account not found")); + + $email = $DB->escape(); $userID = User::findEmail($email); + if( $userID == 0 ) + throw new Exception(l_t("Account not found")); + $newPassword = base64_encode(rand(1000000000,2000000000)); $DB->sql_put("UPDATE wD_Users diff --git a/redirect.php b/redirect.php index f6b3804ee..811ef0311 100755 --- a/redirect.php +++ b/redirect.php @@ -23,6 +23,7 @@ if ((isset($_POST['watch']) || isset($_POST['unwatch'])) && isset($_POST['gameID'])) { require_once(l_r('objects/game.php')); require_once(l_r('gamepanel/gameboard.php')); + libAuth::formToken_Valid(); $gameID = (int)$_POST['gameID']; // Get the game object, if this fails, then someone has entered some rubbish for the gameID