Skip to content

Commit

Permalink
Merge pull request #263 from SystemDisc/master
Browse files Browse the repository at this point in the history
fixed bug where passwords are stored in plaintext
  • Loading branch information
David McReynolds committed Aug 26, 2014
2 parents ab411dd + 1989c3f commit 8170f4b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions fuel/modules/fuel/libraries/Fuel_modules.php
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ public function get($module = NULL, $include_advanced = TRUE)
$modules = $this->get(NULL, FALSE);
foreach($modules as $key => $mod)
{
if (strtolower($mod->info('model_name')) == $module OR ($has_uri AND $mod->info('module_uri') == $module))
if (strtolower($mod->info('model_name')) == $module OR (!empty($has_uri) AND $mod->info('module_uri') == $module))
{
$module = $key;
break;
Expand Down Expand Up @@ -1138,4 +1138,4 @@ public function __get($var)
}

/* End of file Fuel_modules.php */
/* Location: ./modules/fuel/libraries/fuel/Fuel_modules.php */
/* Location: ./modules/fuel/libraries/fuel/Fuel_modules.php */
6 changes: 3 additions & 3 deletions fuel/modules/fuel/models/fuel_users_model.php
Original file line number Diff line number Diff line change
Expand Up @@ -537,11 +537,11 @@ public function on_before_save($values)


// added here instead of on_before_clean in case of any cleaning that may alter the salt and password values
if (!empty($values['new_password']))
if (!empty($values['password']))
{

$values['salt'] = substr($this->salt(), 0, 32);
$values['password'] = $this->salted_password_hash($values['new_password'], $values['salt']);
$values['password'] = $this->salted_password_hash($values['password'], $values['salt']);
}

return $values;
Expand Down Expand Up @@ -683,4 +683,4 @@ function get_name()
return $this->first_name.' '.$this->last_name;
}

}
}

0 comments on commit 8170f4b

Please sign in to comment.