mirror of
https://github.com/Ekokumppanit/ystavakylaecard.git
synced 2026-03-17 18:59:36 +00:00
Moved passwordhash() from yllapito controller to user model, where it belongs
This commit is contained in:
@@ -175,7 +175,7 @@ class Yllapito extends CI_Controller
|
|||||||
$pass = $this->input->post('password');
|
$pass = $this->input->post('password');
|
||||||
|
|
||||||
// Hash the password
|
// Hash the password
|
||||||
$pass = $this->passwordhash($pass);
|
$pass = $this->users->passwordhash($pass);
|
||||||
|
|
||||||
$test = array(
|
$test = array(
|
||||||
'username' => $user,
|
'username' => $user,
|
||||||
@@ -227,16 +227,6 @@ class Yllapito extends CI_Controller
|
|||||||
|
|
||||||
public function makePassword($password = null)
|
public function makePassword($password = null)
|
||||||
{
|
{
|
||||||
echo $this->passwordhash($password);
|
echo $this->users->passwordhash($password);
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private function passwordhash($password = null)
|
|
||||||
{
|
|
||||||
return hash(
|
|
||||||
'ripemd160',
|
|
||||||
$password . $this->config->item('encryption_key')
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,6 +12,14 @@ class User_model extends MY_Model
|
|||||||
parent::__construct();
|
parent::__construct();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function passwordhash($password = null)
|
||||||
|
{
|
||||||
|
return hash(
|
||||||
|
'ripemd160',
|
||||||
|
$password . $this->config->item('encryption_key')
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
protected function timestamps($ecard)
|
protected function timestamps($ecard)
|
||||||
{
|
{
|
||||||
$ecard['created_at'] = $ecard['updated_at'] = date('Y-m-d H:i:s');
|
$ecard['created_at'] = $ecard['updated_at'] = date('Y-m-d H:i:s');
|
||||||
|
|||||||
Reference in New Issue
Block a user