Merge branch 'dubbele-authenticatie-IN-TEST' into develop
This commit is contained in:
@@ -1738,4 +1738,87 @@ z-index: 50;
|
||||
.ijkpuntkopje{
|
||||
font-weight: bold!important;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
/* ******** DIALOG *********/
|
||||
|
||||
.grippa-dialog {
|
||||
position:absolute;
|
||||
margin-top:0;
|
||||
transform: translateX(-50%);
|
||||
left: 50%;
|
||||
top: 50px;
|
||||
background-color: #ffffff;
|
||||
border: none;
|
||||
border-radius: 5px;
|
||||
overflow:hidden;
|
||||
padding: 0px;
|
||||
box-shadow: 2px 3px var(--verydark);
|
||||
margin-top:10px;
|
||||
}
|
||||
|
||||
dialog::backdrop {
|
||||
background-color: #9f9f9f;
|
||||
opacity: 0.6;
|
||||
}
|
||||
.grippa-dialog-sm{
|
||||
width:400px;
|
||||
}
|
||||
|
||||
.grippa-dialog-md{
|
||||
width:600px;
|
||||
}
|
||||
.grippa-dialog-xl{
|
||||
width:950px;
|
||||
}
|
||||
.grippa-dialog-xxl{
|
||||
width:1150px;
|
||||
}
|
||||
.grippa-dialog-header{
|
||||
background-color: #6F0B3D ;
|
||||
color: #ffffff;
|
||||
padding: 10px 25px 20px;
|
||||
/* position: relative; */
|
||||
}
|
||||
.grippa-dialog-body{
|
||||
padding: 20px 35px;
|
||||
/* position: relative; */
|
||||
}
|
||||
.grippa-dialog-footer{
|
||||
/* position: relative; */
|
||||
margin-top:10px;
|
||||
padding: 10px;
|
||||
border-top: 1px solid #ccc !important;
|
||||
|
||||
}
|
||||
.grippa-dialog-close::before{
|
||||
content: 'x';
|
||||
}
|
||||
.grippa-dialog-close{
|
||||
position: absolute !important;
|
||||
top:10px;
|
||||
right:10px;
|
||||
border:1px solid #f2f2f2;
|
||||
background: #ffffff;
|
||||
color: #aaaaaa;
|
||||
width: 25px;
|
||||
height:25px;
|
||||
font-size: 20px;
|
||||
margin-bottom:5px;
|
||||
}
|
||||
/* ********* two factor **********************/
|
||||
.two-factor-input {
|
||||
margin-top: 0px;
|
||||
width: 100%;
|
||||
font-size: 2em !important;
|
||||
padding: 10px;
|
||||
text-align: center;
|
||||
border-radius: 15px;
|
||||
border-color: #aaa;
|
||||
border-width:2px;
|
||||
box-shadow: none;
|
||||
height: 70px !important;
|
||||
spacing: 1.2em;
|
||||
text-spacing: 1.2em;
|
||||
letter-spacing: 8px;
|
||||
}
|
||||
+1
-1
@@ -36,10 +36,10 @@
|
||||
* @filesource
|
||||
*/
|
||||
|
||||
|
||||
include_once( dirname( dirname( __FILE__ ) ) . '/vendor/autoload.php' );
|
||||
include_once( dirname( dirname( __FILE__ ) ) . '/.env.php' );
|
||||
|
||||
|
||||
/*
|
||||
*---------------------------------------------------------------
|
||||
* APPLICATION ENVIRONMENT
|
||||
|
||||
+8
-2
@@ -89,13 +89,19 @@ ls.initLoginModel = function(){
|
||||
}
|
||||
}
|
||||
else {
|
||||
location.reload();
|
||||
self.fDoTwoFactor(data)
|
||||
}; // else
|
||||
},'json');
|
||||
}
|
||||
},'json');
|
||||
|
||||
},
|
||||
|
||||
fDoTwoFactor: function(hoe){
|
||||
ls.initTwoFactorService(hoe, function(){
|
||||
location.reload();
|
||||
})
|
||||
},
|
||||
|
||||
fNaarInlog: function(){
|
||||
var self=ls.LoginModel;
|
||||
self.inloggen(true);
|
||||
|
||||
@@ -53,6 +53,7 @@ ls.initGebruikersModel = function(){
|
||||
this.tussenvoegsel = ko.observable(p.tussenvoegsel);
|
||||
this.achternaam = ko.observable(p.achternaam );
|
||||
this.email = ko.observable(p.email ) ;
|
||||
this.twofactor = ko.observable(p.twofactor)
|
||||
if (p.gnaam){
|
||||
this.gnaam = ko.observable(p.gnaam);
|
||||
}
|
||||
@@ -72,6 +73,7 @@ ls.initGebruikersModel = function(){
|
||||
this.tussenvoegsel = ko.observable('');
|
||||
this.achternaam = ko.observable('');
|
||||
this.email = ko.observable('') ;
|
||||
this.twofactor = ko.observable("EMAIL")
|
||||
this.gnaam = ko.observable('');
|
||||
this.autorisatienivoid = ko.observable(0);
|
||||
this.autorisatienaam = ko.observable('');
|
||||
@@ -177,6 +179,8 @@ ls.initGebruikersModel = function(){
|
||||
self.selectedUser(new fMaakEmptyUser());
|
||||
// hier ipv 0 het laagst mogelijke recht?
|
||||
self.selectedUser().autorisatienivoid(self.autorisatieopties()[0].id);
|
||||
self.selectedUser().twofactor('EMAIL')
|
||||
|
||||
self.titel().title("Nieuwe gebruiker");
|
||||
self.titel().status(1);
|
||||
self.focusop(1);
|
||||
@@ -192,6 +196,7 @@ ls.initGebruikersModel = function(){
|
||||
self.selectedUser().tussenvoegsel(this.tussenvoegsel());
|
||||
self.selectedUser().achternaam(this.achternaam());
|
||||
self.selectedUser().email(this.email());
|
||||
self.selectedUser().twofactor(this.twofactor());
|
||||
self.selectedUser().autorisatienivoid(this.autorisatienivoid());
|
||||
self.titel().title("Wijzig gebruikergegevens");
|
||||
|
||||
@@ -200,6 +205,7 @@ ls.initGebruikersModel = function(){
|
||||
self.focusop(1);
|
||||
$("#modEditUser").modal("show");
|
||||
},
|
||||
|
||||
fDelete: function(){
|
||||
var self=ls.GebruikersModel;
|
||||
var that = this;
|
||||
@@ -248,11 +254,12 @@ ls.initGebruikersModel = function(){
|
||||
voornaam : self.selectedUser().voornaam(),
|
||||
tussenvoegsel : self.selectedUser().tussenvoegsel(),
|
||||
achternaam : self.selectedUser().achternaam(),
|
||||
email : self.selectedUser().email(),
|
||||
email : self.selectedUser().email(),
|
||||
twofactor : self.selectedUser().twofactor(),
|
||||
gnaam : self.selectedUser().gnaam(),
|
||||
autorisatienivoid : self.selectedUser().autorisatienivoid(),
|
||||
status : self.titel().status()} ;
|
||||
// controleer e-mail
|
||||
// controleer e-mail
|
||||
if (!checkEmail(self.selectedUser().email()) ){
|
||||
apprise("Het e-mailadres is niet correct.");
|
||||
self.focusop(1);
|
||||
@@ -285,11 +292,12 @@ ls.initGebruikersModel = function(){
|
||||
|
||||
if (result) {
|
||||
// hier nog alle waarden (terug)zetten.
|
||||
self.selectedUserOld().actief(result.user.OUactief);
|
||||
self.selectedUserOld().actief(result.user.OUactief);
|
||||
self.selectedUserOld().voornaam(result.user.voornaam);
|
||||
self.selectedUserOld().tussenvoegsel(result.user.tussenvoegsel);
|
||||
self.selectedUserOld().achternaam(result.user.achternaam);
|
||||
self.selectedUserOld().email(result.user.email);
|
||||
self.selectedUserOld().twofactor(result.user.twofactor);
|
||||
self.selectedUserOld().gnaam(result.user.gnaam);
|
||||
self.selectedUserOld().autorisatienivoid(result.user.nivo_id);
|
||||
self.selectedUserOld().autorisatienaam(result.user.autorisatienaam);
|
||||
|
||||
@@ -75,6 +75,8 @@ ls.initMenuModel = function(){
|
||||
newwachtwoord1 : ko.observable(''),
|
||||
newwachtwoord2 : ko.observable(''),
|
||||
zout : ko.observable(),
|
||||
twofactor : ko.observable("EMAIL"),
|
||||
googleAuthenticatorUrl: ko.observable(),
|
||||
zoekstring : ko.observable(''),
|
||||
alleorganisaties : ko.observableArray([]),
|
||||
handleidingen : ko.observableArray([]),
|
||||
@@ -384,6 +386,7 @@ ls.initMenuModel = function(){
|
||||
self.newtussenvoegsel(data.tussenvoegsel);
|
||||
self.newachternaam(data.achternaam);
|
||||
self.newemail(data.email);
|
||||
self.twofactor(data.twofactor)
|
||||
self.zout(data.zout);
|
||||
$("#modUserdetails").modal("show");
|
||||
}
|
||||
@@ -411,7 +414,8 @@ ls.initMenuModel = function(){
|
||||
tussenvoegsel: self.newtussenvoegsel(),
|
||||
achternaam: self.newachternaam(),
|
||||
email : self.newemail,
|
||||
wachtwoord: saltedChallenge};
|
||||
wachtwoord: saltedChallenge,
|
||||
twofactor : self.twofactor()};
|
||||
$.post("index.php/shared/users/updateuser", submitData,function(result){
|
||||
if (result){
|
||||
self.user(result);
|
||||
@@ -459,7 +463,19 @@ ls.initMenuModel = function(){
|
||||
submitURL = "index.php/shared/menu/downloadhandleiding/" + this.id;
|
||||
window.open(submitURL);
|
||||
$("#modDocumenten").modal("hide");
|
||||
},
|
||||
|
||||
fInitializeGoogle: function(){
|
||||
let vm = ls.MenuModel
|
||||
if (vm.twofactor == "GOOGLE") return
|
||||
$.getJSON( 'index.php/Login/maakGoogleSecret', function ( data ) {
|
||||
vm.googleAuthenticatorUrl( data.url );
|
||||
$( "#authenticatorQR" ).modal( 'show' );
|
||||
return true;
|
||||
} )
|
||||
return true
|
||||
}
|
||||
|
||||
} ; // definition van model
|
||||
ls.MenuModel.initModel();
|
||||
ko.applyBindings(ls.MenuModel, document.getElementById("menubalk"));
|
||||
|
||||
@@ -0,0 +1,109 @@
|
||||
$(function(){
|
||||
|
||||
ls.initTwoFactorService = function(hoe, callback){
|
||||
if (ls.TwoFactorService !== undefined){
|
||||
ls.TwoFactorService.initModel(hoe, callback);
|
||||
}
|
||||
else {
|
||||
ls.TwoFactorService = {
|
||||
hoe : ko.observable(),
|
||||
tempHoe : ko.observable(),
|
||||
callback : ko.observable(),
|
||||
deCode : ko.observable(''),
|
||||
infoTeksten : ['Open de Google authenticator op uw telefoon en voer de code in.',
|
||||
'Kijk in uw e-mail voor de code.',],
|
||||
infoTekst : ko.observable(),
|
||||
optieTekst : ko.observable(''),
|
||||
optieBG : ko.observable('#30ACF0'),
|
||||
kanKlik : ko.observable(false),
|
||||
codeNogmaals: ko.observable(),
|
||||
|
||||
initBindings :function(hoe, callback){
|
||||
var self = ls.TwoFactorService;
|
||||
// if (!ko.dataFor(document.getElementById('pagNaam')) ) {
|
||||
ko.applyBindings(ls.TwoFactorService, document.getElementById("twoFactorDialog"));
|
||||
// }
|
||||
self.initModel(hoe, callback);
|
||||
},
|
||||
|
||||
initModel: function(hoe, callback){
|
||||
let vm = ls.TwoFactorService
|
||||
vm.deCode('')
|
||||
vm.optieBG('#30ACF0')
|
||||
vm.hoe(hoe)
|
||||
vm.tempHoe(hoe)
|
||||
vm.callback(callback)
|
||||
|
||||
vm.codeNogmaals('')
|
||||
if (hoe =="GOOGLE") {
|
||||
vm.infoTekst(vm.infoTeksten[0])
|
||||
vm.optieTekst('Wilt u eenmalig een code per mail ontvangen? Klik dan hier.');
|
||||
vm.kanKlik(true)
|
||||
}
|
||||
else {
|
||||
vm.infoTekst(vm.infoTeksten[1])
|
||||
vm.optieTekst('');
|
||||
vm.kanKlik(false)
|
||||
}
|
||||
let dialog = document.getElementById( "twoFactorDialog" )
|
||||
dialog.showModal()
|
||||
},
|
||||
|
||||
fCheckCode: function(){
|
||||
let vm = ls.TwoFactorService
|
||||
if (vm.deCode().length ==6) {
|
||||
vm.kanKlik(false)
|
||||
let optieOud = vm.optieTekst()
|
||||
vm.optieTekst('Even geduld, de code wordt gecontroleerd.')
|
||||
let sd ={code: vm.deCode(),
|
||||
hoe : vm.tempHoe() }
|
||||
$.post('index.php/Login/checkTwoFactor', sd, function(result){
|
||||
if (result) {
|
||||
vm.infoTekst('');
|
||||
vm.optieTekst(result)
|
||||
vm.optieBG('#FF2D55');
|
||||
vm.deCode('')
|
||||
vm.codeNogmaals("Stuur nogmaals een code per e-mail? Klik hier.");
|
||||
}
|
||||
else {
|
||||
vm.fClose()
|
||||
}
|
||||
},'json')
|
||||
}
|
||||
},
|
||||
|
||||
fSendPerEmail: function(){
|
||||
let vm = ls.TwoFactorService
|
||||
vm.optieTekst("Een moment geduld aub");
|
||||
vm.codeNogmaals('')
|
||||
vm.kanKlik(false)
|
||||
$.post( 'index.php/Login/mailCodeOnce', function (error) {
|
||||
if (error) {
|
||||
let dialog = document.getElementById( "twoFactorDialog" )
|
||||
dialog.close()
|
||||
apprise(error)
|
||||
}
|
||||
else {
|
||||
vm.infoTekst("Er is een e-mail met inlogcode verstuurd. <br> Het kan tot een minuut duren voor u deze ontvangt.")
|
||||
vm.optieTekst("Verstuur nogmaals een inlogcode? Klik hier.")
|
||||
vm.kanKlik(true)
|
||||
vm.tempHoe("EMAIL")
|
||||
}
|
||||
} ,'json');
|
||||
|
||||
},
|
||||
|
||||
fClose: function(){
|
||||
let vm = ls.TwoFactorService
|
||||
|
||||
if (typeof vm.callback() == 'function') {
|
||||
vm.callback()()
|
||||
}
|
||||
let dialog = document.getElementById( "twoFactorDialog" )
|
||||
dialog.close()
|
||||
}
|
||||
} ; // definition van model
|
||||
ls.TwoFactorService.initBindings(hoe, callback);
|
||||
}; // else
|
||||
}// function initTwoFactorService
|
||||
});
|
||||
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user