change password

This commit is contained in:
2019-05-07 21:41:49 +02:00
parent 2738f8aa78
commit b3e8eecca6
5 changed files with 105 additions and 12 deletions
+13
View File
@@ -269,4 +269,17 @@ top: -2px;
margin-right:10px
}
label.change-password {
float: right;
margin-top: 8px;;
}
label.change-password:hover {
color: #fff;
cursor: pointer;
}
div.change-password {
margin-right: 140px;
float: right;
}
@@ -58,6 +58,13 @@ dbo.userDataService = {
} );
},
savePassword: function ( password, callback ) {
$.post( '/index.php/beheer/usersController/savePassword', {password: password} )
.done( function () {
callback();
} );
},
archiveUser: function ( userID, status, callback ) {
$.get( 'index.php/beheer/usersController/archiveUser/' + userID + '/' + status )
.done( function () {
+49 -9
View File
@@ -10,8 +10,11 @@ $( function () {
dbo.menuModel = {
pages : ko.observable(),
initialized: ko.observable( false ),
pages : ko.observable(),
initialized : ko.observable( false ),
hidePasswordinput: ko.observable(true),
newPassword : ko.observable(),
validPassword : ko.observable(),
init: function () {
@@ -32,11 +35,48 @@ $( function () {
} );
},
logOut : function(){
dbo.userDataService.logOut(function(){
location.reload();
});
checkPassword: function () {
var vm = dbo.menuModel;
if ( vm.newPassword().length >= 8 ) {
vm.validPassword( true );
} else {
vm.validPassword( false );
}
},
logOut: function () {
dbo.userDataService.logOut( function () {
location.reload();
} );
},
togglePasswordinput: function () {
if ( dbo.menuModel.hidePasswordinput() == true ) {
var tellMeOptions = {
title : 'Wijzig wachtwoord',
message : 'Uw gewijzigde wachtwoord dient uit tenminste 8 tekens te bestaan',
modalClass: 'modal-warning'
}
tellMe( tellMeOptions )
}
dbo.menuModel.hidePasswordinput( !dbo.menuModel.hidePasswordinput() );
},
savePassword: function () {
var vm = dbo.menuModel;
dbo.userDataService.savePassword( vm.newPassword, function () {
var tellMeOptions = {
title : 'Uw wachtwoord is gewijzigd',
message : 'U kunt nu met uw gewijzigde wachtwoord inloggen',
modalClass: 'modal-warning'
}
tellMe( tellMeOptions );
dbo.menuModel.hidePasswordinput( !dbo.menuModel.hidePasswordinput() );
} )
},
setPage: function ( page ) {
@@ -59,9 +99,9 @@ $( function () {
dbo.menuModel.init();
$(".open-submenu").click(function(){
$("#sub-" + $(this).attr('id')).slideToggle('slow');
});
$( ".open-submenu" ).click( function () {
$( "#sub-" + $( this ).attr( 'id' ) ).slideToggle( 'slow' );
} );
} );