Login
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
defined( 'BASEPATH' ) OR exit( 'No direct script access allowed' );
|
||||
|
||||
/*
|
||||
| -------------------------------------------------------------------
|
||||
@@ -132,4 +132,4 @@ $autoload['language'] = array();
|
||||
|
|
||||
| $autoload['model'] = array('first_model' => 'first');
|
||||
*/
|
||||
$autoload['model'] = array();
|
||||
$autoload['model'] = ['beheer/User'];
|
||||
|
||||
@@ -75,10 +75,10 @@ $query_builder = TRUE;
|
||||
|
||||
$db['default'] = array(
|
||||
'dsn' => '',
|
||||
'hostname' => 'localhost',
|
||||
'username' => '',
|
||||
'password' => '',
|
||||
'database' => '',
|
||||
'hostname' => getenv('DB_HOST'),
|
||||
'username' => getenv('DB_USER'),
|
||||
'password' => getenv('DB_PASS'),
|
||||
'database' => getenv('DB_NAME'),
|
||||
'dbdriver' => 'mysqli',
|
||||
'dbprefix' => '',
|
||||
'pconnect' => FALSE,
|
||||
|
||||
@@ -19,14 +19,12 @@ class MY_Controller extends CI_Controller {
|
||||
|
||||
private function handle()
|
||||
{
|
||||
$this->environment();
|
||||
|
||||
}
|
||||
|
||||
function clean_input( $post )
|
||||
{
|
||||
$value = $this->input->post( $post );
|
||||
|
||||
// $escapedValue = $this->db->escape_string( $value, TRUE );
|
||||
$value = $this->input->input_stream( $post, TRUE );
|
||||
|
||||
$denulledValue = str_replace( 'null', '', $value);
|
||||
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
/**
|
||||
* Created by Pensare Software.
|
||||
* User: Theo Weijmer
|
||||
* Date: 15/12/2017
|
||||
* Time: 19:37
|
||||
*/
|
||||
|
||||
class User extends MY_Model {
|
||||
|
||||
protected $tablename = "users";
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
public function getUserByUsername( $username )
|
||||
{
|
||||
$user = $this->get( [
|
||||
'UCASE(username)' => strtoupper( $username )], FALSE, TRUE);
|
||||
|
||||
return $user;
|
||||
}
|
||||
|
||||
}
|
||||
+2
-1
@@ -11,6 +11,7 @@ include_once('../vendor/autoload.php');
|
||||
$dotenv = new Dotenv\Dotenv('../');
|
||||
$dotenv->load();
|
||||
|
||||
$dotenv->required(['DB_HOST', 'DB_NAME', 'DB_USER', 'DB_PASS', 'ENVIRONMENT']);
|
||||
|
||||
|
||||
/**
|
||||
@@ -67,7 +68,7 @@ $dotenv->load();
|
||||
*
|
||||
* NOTE: If you change these, also change the error_reporting() code below
|
||||
*/
|
||||
define('ENVIRONMENT', isset($_SERVER['CI_ENV']) ? $_SERVER['CI_ENV'] : 'development');
|
||||
define('ENVIRONMENT', getenv('ENVIRONMENT'));
|
||||
|
||||
/*
|
||||
*---------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user