Skip to content

Commit

Permalink
Merge branch 'password-update'
Browse files Browse the repository at this point in the history
  • Loading branch information
phpfunk committed Jan 15, 2014
2 parents 97cc111 + b04eb10 commit ef55839
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
10 changes: 10 additions & 0 deletions application/models/users_model.php
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,16 @@ function check_user_credentials()
}
else {
$match = (md5($password) == $encrypted_password) ? true : false;

// Try to update to new password security since they are on old MD5
$hash = generateHash($password);

// If hash is valid and match is valid
// Upgrade users to new encryption routine
if ($hash !== false && $match === true) {
$this->db->update('users', array('password' => $hash['encrypted'],'salt' => $hash['salt']), array('email' => $email));
}

}

// If a match, return array, else false
Expand Down
5 changes: 5 additions & 0 deletions application/views/changelog.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@
<h2>Changelog</h2>
<p>A quick list of what's new. Posted immediately upon update.</p>

<h4 id="0310"><a href="#0310">0.3.10 - 15 January 2014</a></h4>
<ul>
<li>Update: Users with old password encryption technique will be update to new encrypted password/salt upon next successful login.</li>
</ul>

<h4 id="039"><a href="#039">0.3.9 - 15 January 2014</a></h4>
<ul>
<li>Bug: Fixing password issue. Forgot to store salt, DERP!</li>
Expand Down

0 comments on commit ef55839

Please sign in to comment.