inrichten base applicatie
This commit is contained in:
@@ -30,3 +30,4 @@ user_guide_src/cilexer/pycilexer.egg-info/*
|
|||||||
/tests/tests/
|
/tests/tests/
|
||||||
/tests/results/
|
/tests/results/
|
||||||
/resources
|
/resources
|
||||||
|
/.env
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ $autoload['packages'] = array();
|
|||||||
|
|
|
|
||||||
| $autoload['libraries'] = array('user_agent' => 'ua');
|
| $autoload['libraries'] = array('user_agent' => 'ua');
|
||||||
*/
|
*/
|
||||||
$autoload['libraries'] = array();
|
$autoload['libraries'] = array('database', 'session');
|
||||||
|
|
||||||
/*
|
/*
|
||||||
| -------------------------------------------------------------------
|
| -------------------------------------------------------------------
|
||||||
|
|||||||
@@ -19,12 +19,18 @@ class MY_Controller extends CI_Controller {
|
|||||||
|
|
||||||
private function handle()
|
private function handle()
|
||||||
{
|
{
|
||||||
|
$this->environment();
|
||||||
}
|
}
|
||||||
|
|
||||||
function clean_input( $post )
|
function clean_input( $post )
|
||||||
{
|
{
|
||||||
return str_replace( 'null', '', $this->db->escape_str( $this->input->post( $post ), TRUE ) );
|
$value = $this->input->post( $post );
|
||||||
|
|
||||||
|
// $escapedValue = $this->db->escape_string( $value, TRUE );
|
||||||
|
|
||||||
|
$denulledValue = str_replace( 'null', '', $value);
|
||||||
|
|
||||||
|
return $denulledValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function json($data)
|
public function json($data)
|
||||||
|
|||||||
@@ -34,25 +34,28 @@
|
|||||||
</head>
|
</head>
|
||||||
<body class="animsition page-login-v3 layout-full">
|
<body class="animsition page-login-v3 layout-full">
|
||||||
<!-- Page -->
|
<!-- Page -->
|
||||||
<div class="page vertical-align text-center" data-animsition-in="fade-in" data-animsition-out="fade-out">>
|
<?php $this->load->view('specials/notifyme_modal'); ?>
|
||||||
|
<div class="page vertical-align text-center" data-animsition-in="fade-in" data-animsition-out="fade-out">
|
||||||
<div class="page-content vertical-align-middle animation-slide-top animation-duration-1">
|
<div class="page-content vertical-align-middle animation-slide-top animation-duration-1">
|
||||||
<div class="panel">
|
<div class="panel" id="login-form">
|
||||||
<div class="panel-body">
|
<div class="panel-body">
|
||||||
<div class="brand">
|
<div class="brand">
|
||||||
<img class="brand-img" src="css/images/logo_dbo.png" alt="...">
|
<img class="brand-img" src="css/images/logo_dbo.png" alt="...">
|
||||||
<h2 class="brand-text font-size-18">projectbeheer</h2>
|
<h2 class="brand-text font-size-18">projectbeheer</h2>
|
||||||
</div>
|
</div>
|
||||||
<form method="post" action="#">
|
<div>
|
||||||
<div class="form-group form-material floating" data-plugin="formMaterial">
|
<div class="form-group form-material floating" data-plugin="formMaterial">
|
||||||
<input type="text" class="form-control" name="email" />
|
<input type="text" class="form-control" name="email"
|
||||||
|
data-bind="textInput:username" />
|
||||||
<label class="floating-label">gebruikersnaam</label>
|
<label class="floating-label">gebruikersnaam</label>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group form-material floating" data-plugin="formMaterial">
|
<div class="form-group form-material floating" data-plugin="formMaterial">
|
||||||
<input type="password" class="form-control" name="password" />
|
<input type="password" class="form-control" name="password"
|
||||||
|
data-bind="textInput:password" />
|
||||||
<label class="floating-label">wachtwoord</label>
|
<label class="floating-label">wachtwoord</label>
|
||||||
</div>
|
</div>
|
||||||
<button type="submit" class="btn btn-primary btn-block btn-lg mt-40">Log in</button>
|
<button type="button" class="btn btn-primary btn-block btn-lg mt-40" data-bind="click:login">Log in</button>
|
||||||
</form>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -102,5 +105,9 @@
|
|||||||
<script src="js/vendor/Plugin/switchery.js"></script>
|
<script src="js/vendor/Plugin/switchery.js"></script>
|
||||||
<script src="js/vendor/Plugin/jquery-placeholder.js"></script>
|
<script src="js/vendor/Plugin/jquery-placeholder.js"></script>
|
||||||
<script src="js/vendor/Plugin/material.js"></script>
|
<script src="js/vendor/Plugin/material.js"></script>
|
||||||
|
|
||||||
|
<script src="js/vendor/Knockout.min.js"></script>
|
||||||
|
<script src="js/lib/modules/login/loginModule.js"></script>
|
||||||
|
<script src="js/lib/modules/specials/notifyModule.js"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@@ -0,0 +1,27 @@
|
|||||||
|
<div class="modal" tabindex="-1" role="dialog" id="notify-me">
|
||||||
|
<div class="modal-dialog" role="document">
|
||||||
|
<div class="modal-content">
|
||||||
|
<div class="modal-header">
|
||||||
|
<h5 class="modal-title" data-bind="text:title"></h5>
|
||||||
|
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||||
|
<span aria-hidden="true">×</span>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
<div class="modal-body">
|
||||||
|
<p data-bind="text:message"></p>
|
||||||
|
</div>
|
||||||
|
<div class="modal-footer">
|
||||||
|
<!-- ko if : notify() -->
|
||||||
|
<button type="button" class="btn btn-primary"
|
||||||
|
data-bind="text:yesText; click:closeYes"></button>
|
||||||
|
<button type="button" class="btn btn-secondary" data-dismiss="modal"
|
||||||
|
data-bind="text:noText; click:closeNo"></button>
|
||||||
|
<!-- /ko -->
|
||||||
|
<!-- ko if : ! notify() -->
|
||||||
|
<button type="button" class="btn btn-secondary" data-dismiss="modal"
|
||||||
|
data-bind="click:closeOk">OK</button>
|
||||||
|
<!-- /ko -->
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
+2
-1
@@ -11,7 +11,8 @@
|
|||||||
"source": "https://github.com/bcit-ci/CodeIgniter"
|
"source": "https://github.com/bcit-ci/CodeIgniter"
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
"php": ">=5.3.7"
|
"php": ">=5.3.7",
|
||||||
|
"vlucas/phpdotenv": "^2.4"
|
||||||
},
|
},
|
||||||
"suggest": {
|
"suggest": {
|
||||||
"paragonie/random_compat": "Provides better randomness in PHP 5.x"
|
"paragonie/random_compat": "Provides better randomness in PHP 5.x"
|
||||||
|
|||||||
@@ -1,4 +1,18 @@
|
|||||||
<?php
|
<?php
|
||||||
|
/**
|
||||||
|
* Load all enviroment variables
|
||||||
|
*
|
||||||
|
* using: vlucas/phpdotenv (composer require vlucas/phpdotenv)
|
||||||
|
*/
|
||||||
|
|
||||||
|
include_once('../vendor/autoload.php');
|
||||||
|
|
||||||
|
//$dotenv = new Dotenv\Dotenv(__DIR__);
|
||||||
|
$dotenv = new Dotenv\Dotenv('../');
|
||||||
|
$dotenv->load();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* CodeIgniter
|
* CodeIgniter
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -4,42 +4,42 @@
|
|||||||
* Date: 05/12/2017
|
* Date: 05/12/2017
|
||||||
* Time: 11:17
|
* Time: 11:17
|
||||||
*/
|
*/
|
||||||
var pp = {};
|
var dbo = {};
|
||||||
|
|
||||||
$( function () {
|
$( function () {
|
||||||
|
|
||||||
pp.loginModel = {
|
dbo.loginModel = {
|
||||||
|
|
||||||
username: ko.observable( '' ),
|
username: ko.observable( '' ),
|
||||||
password: ko.observable( '' ),
|
password: ko.observable( '' ),
|
||||||
|
|
||||||
login: function () {
|
login: function () {
|
||||||
pp.loginService.login();
|
dbo.loginService.login();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
console.log( 'text' );
|
||||||
ko.applyBindings( pp.loginModel, document.getElementById( "login-user" ) );
|
ko.applyBindings( dbo.loginModel, document.getElementById( "login-form" ) );
|
||||||
|
|
||||||
} );
|
} );
|
||||||
|
|
||||||
pp.loginService = {
|
dbo.loginService = {
|
||||||
|
|
||||||
login: function () {
|
login: function () {
|
||||||
var ds = pp.loginDataservice;
|
var ds = dbo.loginDataservice;
|
||||||
var self = pp.loginService;
|
var self = dbo.loginService;
|
||||||
var vm = pp.loginModel;
|
var vm = dbo.loginModel;
|
||||||
|
|
||||||
self.validateInput( function ( data ) {
|
self.validateInput( function ( submitDATA ) {
|
||||||
if ( !data ) return self.notifyWrongPassword();
|
if ( ! submitDATA ) return self.notifyWrongPassword();
|
||||||
|
|
||||||
ds.login( submitDATA, function ( data ) {
|
ds.login( submitDATA, function ( data ) {
|
||||||
if ( data ) return location.reload();
|
// if ( data ) return location.reload();
|
||||||
} );
|
} );
|
||||||
} );
|
} );
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
validateInput: function ( callback ) {
|
validateInput: function ( callback ) {
|
||||||
var vm = pp.loginModel;
|
var vm = dbo.loginModel;
|
||||||
|
|
||||||
if ( vm.username().length < 2 ) return callback( false );
|
if ( vm.username().length < 2 ) return callback( false );
|
||||||
if ( vm.password().length < 6 ) return callback( false );
|
if ( vm.password().length < 6 ) return callback( false );
|
||||||
@@ -55,14 +55,13 @@ pp.loginService = {
|
|||||||
notifyWrongPassword: function () {
|
notifyWrongPassword: function () {
|
||||||
notifyMe( {
|
notifyMe( {
|
||||||
title : 'Login fout',
|
title : 'Login fout',
|
||||||
message: 'Gebruikersnaam / wachtwoord komen niet overeen',
|
message: 'Gebruikersnaam / wachtwoord komen niet overeen'
|
||||||
alert : true
|
|
||||||
} );
|
} );
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
pp.loginDataservice = {
|
dbo.loginDataservice = {
|
||||||
|
|
||||||
login: function ( submitDATA, callback ) {
|
login: function ( submitDATA, callback ) {
|
||||||
$.post( 'index.php/login/', submitDATA, function ( data ) {
|
$.post( 'index.php/login/', submitDATA, function ( data ) {
|
||||||
|
|||||||
@@ -6,10 +6,10 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
var notifyMe = function ( options, callback ) {
|
var notifyMe = function ( options, callback ) {
|
||||||
pp.notifyModel.init( options, callback );
|
dbo.notifyModel.init( options, callback );
|
||||||
}
|
}
|
||||||
|
|
||||||
pp.notifyModel = {
|
dbo.notifyModel = {
|
||||||
|
|
||||||
title : ko.observable( null ),
|
title : ko.observable( null ),
|
||||||
message : ko.observable( null ),
|
message : ko.observable( null ),
|
||||||
@@ -21,7 +21,7 @@ pp.notifyModel = {
|
|||||||
callback : null,
|
callback : null,
|
||||||
|
|
||||||
init: function ( options, callback ) {
|
init: function ( options, callback ) {
|
||||||
var vm = pp.notifyModel;
|
var vm = dbo.notifyModel;
|
||||||
|
|
||||||
vm.callback = callback;
|
vm.callback = callback;
|
||||||
|
|
||||||
@@ -31,36 +31,35 @@ pp.notifyModel = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
setOptions: function ( options ) {
|
setOptions: function ( options ) {
|
||||||
var vm = pp.notifyModel;
|
var vm = dbo.notifyModel;
|
||||||
|
|
||||||
vm.title( options.title || '' );
|
vm.title( options.title || '' );
|
||||||
vm.message( options.message || '' );
|
vm.message( options.message || '' );
|
||||||
vm.notify( options.notify || false );
|
vm.notify( options.notify || true );
|
||||||
vm.alert( options.alert || false );
|
|
||||||
vm.noText( options.noText || 'Nee' );
|
vm.noText( options.noText || 'Nee' );
|
||||||
vm.yesText( options.yesText || 'Ja' );
|
vm.yesText( options.yesText || 'Ja' );
|
||||||
vm.closeText( options.closeText || 'ok' );
|
vm.closeText( options.closeText || 'ok' );
|
||||||
},
|
},
|
||||||
|
|
||||||
closeNo: function () {
|
closeNo: function () {
|
||||||
if ( typeof( pp.notifyModel.callback ) == 'function' ) callback( false );
|
if ( typeof( dbo.notifyModel.callback ) == 'function' ) callback( false );
|
||||||
},
|
},
|
||||||
|
|
||||||
closeYes: function () {
|
closeYes: function () {
|
||||||
if ( typeof( pp.notifyModel.callback ) == 'function' ) callback( true );
|
if ( typeof( dbo.notifyModel.callback ) == 'function' ) callback( true );
|
||||||
},
|
},
|
||||||
|
|
||||||
closeOk: function () {
|
closeOk: function () {
|
||||||
if ( typeof( pp.notifyModel.callback ) == 'function' ) callback();
|
if ( typeof( dbo.notifyModel.callback ) == 'function' ) callback();
|
||||||
},
|
},
|
||||||
|
|
||||||
close: function () {
|
close: function () {
|
||||||
if ( typeof( pp.notifyModel.callback ) == 'function' ) callback();
|
if ( typeof( dbo.notifyModel.callback ) == 'function' ) callback();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ko.applyBindings( pp.notifyModel, document.getElementById( "notify-me" ) );
|
ko.applyBindings( dbo.notifyModel, document.getElementById( "notify-me" ) );
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user