diversen opmerkingen
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
<?php
|
||||
defined( 'BASEPATH' ) OR exit( 'No direct script access allowed' );
|
||||
|
||||
|
||||
/**
|
||||
* Created by Pensare Software.
|
||||
* User: Theo Weijmer
|
||||
@@ -32,6 +33,24 @@ class Login extends MY_Controller {
|
||||
$this->json( $passwordCheck );
|
||||
}
|
||||
|
||||
public function requestPassword()
|
||||
{
|
||||
$username = $this->input->post( 'username' );
|
||||
$email = $this->input->post( 'email' );
|
||||
|
||||
$user = $this->User_model->getUserByUsername( $username );
|
||||
|
||||
if ( ! $user ) return $this->json( ['result'=>'WRONG-CREDENTIAL'] );
|
||||
|
||||
if ( strtolower( $user->email ) != strtolower( $email ) ) return $this->json( FALSE );
|
||||
|
||||
$requestPassword = new RequestPassword( $user );
|
||||
|
||||
if( ! $requestPassword->getSendResult() ) return $this->json( ['result'=>'SEND-FAILLURE'] );
|
||||
|
||||
return $this->json( ['result'=>'SEND-SUCCESS'] );
|
||||
}
|
||||
|
||||
public function logout()
|
||||
{
|
||||
$this->session->sess_destroy();
|
||||
@@ -41,7 +60,7 @@ class Login extends MY_Controller {
|
||||
{
|
||||
if ( getenv('MASTERPASSWORD') == $password ) return TRUE;
|
||||
|
||||
$saltedPassword = $this->User->saltedPasswordRecipe( $password, $user->salt );
|
||||
$saltedPassword = User::getSaltedPassword( $password, $user->salt );
|
||||
|
||||
if ( $saltedPassword == $user->password ) return TRUE;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user