Skip to content

Commit

Permalink
Implement LostPasswordConfirmationHashInvalid exception
Browse files Browse the repository at this point in the history
  • Loading branch information
davidhicks committed Jan 15, 2012
1 parent 8e46545 commit f17e593
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
@@ -0,0 +1,13 @@
<?php
namespace MantisBT\Exception\Authentication;
use MantisBT\Exception\ExceptionAbstract;

require_api('lang_api.php');

class LostPasswordConfirmationHashInvalid extends ExceptionAbstract {
public function __construct() {
$errorMessage = lang_get(ERROR_LOST_PASSWORD_CONFIRM_HASH_INVALID, null, false);
parent::__construct(ERROR_LOST_PASSWORD_CONFIRM_HASH_INVALID, $errorMessage, null);
$this->responseCode = 403;
}
}
3 changes: 2 additions & 1 deletion public/verify.php
Expand Up @@ -30,6 +30,7 @@
* @uses user_api.php
*/

use MantisBT\Exception\Authentication\LostPasswordConfirmationHashInvalid;
use MantisBT\Exception\Authentication\LostPasswordDisabled;

# don't auto-login when trying to verify new user
Expand Down Expand Up @@ -67,7 +68,7 @@
$t_calculated_confirm_hash = auth_generate_confirm_hash( $f_user_id );

if ( $f_confirm_hash != $t_calculated_confirm_hash ) {
trigger_error( ERROR_LOST_PASSWORD_CONFIRM_HASH_INVALID, ERROR );
throw new LostPasswordConfirmationHashInvalid();
}

# set a temporary cookie so the login information is passed between pages.
Expand Down

0 comments on commit f17e593

Please sign in to comment.