Skip to content

Commit

Permalink
Implement LostPasswordInvalidAccount exception
Browse files Browse the repository at this point in the history
  • Loading branch information
davidhicks committed May 7, 2012
1 parent f4d1af5 commit f6e3575
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php
namespace MantisBT\Exception\Authentication;
use MantisBT\Exception\ExceptionAbstract;

require_api('lang_api.php');

class LostPasswordInvalidAccount extends ExceptionAbstract {
public function __construct() {
$errorMessage = lang_get(ERROR_LOST_PASSWORD_NOT_MATCHING_DATA, null, false);
parent::__construct(ERROR_LOST_PASSWORD_NOT_MATCHING_DATA, $errorMessage, null);
$this->responseCode = 400;
}
}
3 changes: 2 additions & 1 deletion public/lost_pwd.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@

use MantisBT\Exception\Authentication\LostPasswordBlankEmail;
use MantisBT\Exception\Authentication\LostPasswordDisabled;
use MantisBT\Exception\Authentication\LostPasswordInvalidAccount;

/**
* MantisBT Core API's
Expand Down Expand Up @@ -81,7 +82,7 @@
$result = db_query_bound( $query, array( $f_username, $f_email, true ) );

if ( 0 == db_num_rows( $result ) ) {
trigger_error( ERROR_LOST_PASSWORD_NOT_MATCHING_DATA, ERROR );
throw new LostPasswordInvalidAccount();
}

if( is_blank( $f_email ) ) {
Expand Down

0 comments on commit f6e3575

Please sign in to comment.