mirror of
https://gitlab.com/bmcgonag/get_my.git
synced 2026-03-27 00:08:49 +00:00
Adding edit and delete users from system.
This commit is contained in:
parent
07a8496542
commit
45b78101c8
5 changed files with 88 additions and 5 deletions
50
client/Accounts/UserMgmt/userInfoModal.js
Normal file
50
client/Accounts/UserMgmt/userInfoModal.js
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
Template.userInfoModal.onCreated(function() {
|
||||
|
||||
});
|
||||
|
||||
Template.userInfoModal.onRendered(function() {
|
||||
Session.set("passMatch", true);
|
||||
Session.set("passErr", false);
|
||||
$('.modal').modal();
|
||||
});
|
||||
|
||||
Template.userInfoModal.helpers({
|
||||
passMatch: function() {
|
||||
return Session.get("passMatch");
|
||||
}
|
||||
});
|
||||
|
||||
Template.userInfoModal.events({
|
||||
"click #chPass" (event) {
|
||||
event.preventDefault();
|
||||
let usersId = Session.get("usersId");
|
||||
let passwd = $("#newPass").val();
|
||||
let passMatch = Session.get("passMatch");
|
||||
if (passwd == null || passwd == "" || passMatch == false) {
|
||||
Session.set("passErr", true);
|
||||
return;
|
||||
} else {
|
||||
Meteor.call('change.userPass', usersId, passwd, function(err, result) {
|
||||
if (err) {
|
||||
console.log(" ERROR changing user passwrod:" + err);
|
||||
} else {
|
||||
console.log(" Password changed successfully!");
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
"click #closePass" (event) {;
|
||||
|
||||
},
|
||||
"keyup #newPassConf" (event) {
|
||||
let newPass = $("#newPass").val();
|
||||
let newPassConf = $("#newPassConf").val();
|
||||
if (newPassConf.length > 2 && (newPass != null || newPass != "")) {
|
||||
if (newPass != newPassConf) {
|
||||
Session.set("passMatch", false);
|
||||
} else {
|
||||
Session.set("passMatch", true);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue