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;
@@ -30,7 +30,22 @@ class AuthorisationController extends MY_Controller {
{
$roleAuthorisations = Role::getPagesAccessByRole();
return $roleAuthorisations;
$this->json( $roleAuthorisations );
}
public function toggleAuhorisation()
{
$pageID = $this->clean_input( 'pageID' );
$roleLevel = $this->clean_input( 'roleLevel' );
$access = $this->clean_input( 'access' );
$page = Page::find( $pageID );
if ( $access == 'F' ) $roleLevel = - $roleLevel;
$page->pagelevel = $page->pagelevel + $roleLevel;
$page->save();
}
}
@@ -69,6 +69,7 @@ class ProjectsController extends MY_Controller {
$data = [
'projectnumber' => $projectnumber,
'projectname' => $offer->offername,
'projectleader_id' => $offer->offerleader_id,
'startdate' => $offer->accepteddate,
'customer_id' => $offer->customer_id