Skip to content

Commit

Permalink
Add error checking to reset_password()
Browse files Browse the repository at this point in the history
  • Loading branch information
Militis committed May 1, 2012
1 parent fe47a63 commit bbf38b6
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions models/ion_auth_model.php
Expand Up @@ -468,6 +468,13 @@ public function reset_password($identity, $new) {
->where($this->identity_column, $identity)
->limit(1)
->get($this->tables['users']);

if ($query->num_rows() !== 1)
{
$this->trigger_events(array('post_change_password', 'post_change_password_unsuccessful'));
$this->set_error('password_change_unsuccessful');
return FALSE;
}

$result = $query->row();

Expand Down

0 comments on commit bbf38b6

Please sign in to comment.