Login ready

This commit is contained in:
2017-12-19 17:23:34 +01:00
parent a7de7ed80a
commit 327dc4376c
11 changed files with 120 additions and 18 deletions
+8 -2
View File
@@ -12,6 +12,8 @@ class Login extends MY_Controller {
public function __construct()
{
parent::__construct();
$this->load->library( 'beheer/CreateUserSession' );
}
public function index()
@@ -23,7 +25,11 @@ class Login extends MY_Controller {
if ( ! $user ) return $this->json( FALSE );
$this->checkPassword( $user, $password );
$passwordCheck = $this->checkPassword( $user, $password );
if ( $passwordCheck === TRUE ) $this->usersession->handle( $user );
$this->json( $passwordCheck );
}
private function checkPassword( $user, $password )
@@ -32,7 +38,7 @@ class Login extends MY_Controller {
$saltedPassword = $this->User->saltedPasswordRecipe( $password, $user->salt );
if( $saltedPassword == $user->password ) return TRUE;
if ( $saltedPassword == $user->password ) return TRUE;
return FALSE;
}