diff --git a/application/libraries/Aauth.php b/application/libraries/Aauth.php index 7c52063..9621a9b 100644 --- a/application/libraries/Aauth.php +++ b/application/libraries/Aauth.php @@ -71,6 +71,17 @@ class Aauth { $this->config_vars = & $this->CI->config->item('aauth'); } + /** + * Hash password + * Hash the password for storage in the database + * @param string $pass Password to hash + * @return string Hashed password + */ + function hash_password($pass) { + + return md5($pass); + } + ######################## # User Functions ######################## @@ -125,8 +136,8 @@ class Aauth { $query = null; $query = $this->CI->db->where('email', $email); - // Database stores pasword md5 cripted - $query = $this->CI->db->where('pass', md5($pass)); + // Database stores pasword hashed password + $query = $this->CI->db->where('pass', hash_password($pass)); $query = $this->CI->db->where('banned', 0); $query = $this->CI->db->get($this->config_vars['users']); @@ -382,7 +393,7 @@ class Aauth { $data = array( 'email' => $email, - 'pass' => md5($pass), + 'pass' => hash_password($pass), 'name' => $name, ); @@ -427,7 +438,7 @@ class Aauth { } if ($pass != FALSE) { - $data['pass'] = md5($pass); + $data['pass'] = hash_password($pass); } if ($name != FALSE) { @@ -638,7 +649,7 @@ class Aauth { $data = array( 'verification_code' => '', - 'pass' => md5($pass) + 'pass' => hash_password($pass) ); $row = $query->row();