This commit is contained in:
2017-12-15 19:44:52 +01:00
parent 7f2314c00b
commit a7de7ed80a
5 changed files with 36 additions and 11 deletions
+2 -2
View File
@@ -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'];
+4 -4
View File
@@ -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,
+2 -4
View File
@@ -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);
+26
View File
@@ -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
View File
@@ -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'));
/*
*---------------------------------------------------------------