diversen opmerkingen

This commit is contained in:
2018-07-29 10:11:02 +02:00
parent cecbfd83fb
commit 30535f7048
34 changed files with 11883 additions and 82 deletions
+20 -1
View File
@@ -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;