mirror of
https://gitlab.com/bmcgonag/get_my.git
synced 2026-03-27 00:08:49 +00:00
Added ability for ystem admin to disable registration.
This commit is contained in:
parent
45b78101c8
commit
bc8df48389
10 changed files with 145 additions and 32 deletions
40
client/AdminMgmt/SystemAdmin/systemAdmin.js
Normal file
40
client/AdminMgmt/SystemAdmin/systemAdmin.js
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
import { SysConfig } from '../../../imports/api/systemConfig.js';
|
||||
|
||||
Template.systemAdmin.onCreated(function() {
|
||||
this.subscribe("SystemConfig");
|
||||
});
|
||||
|
||||
Template.systemAdmin.onRendered(function() {
|
||||
this.autorun(() => {
|
||||
let curr = SysConfig.findOne({});
|
||||
if (typeof curr != 'undefined') {
|
||||
$("#allowGenReg").prop('checked', curr.allowReg);
|
||||
$("#allAdmReg").prop('checked', curr.SysAdminReg);
|
||||
} else {
|
||||
console.log(" ---- unable to find current system configuration.");
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
Template.systemAdmin.helpers({
|
||||
currConfigs: function() {
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
Template.systemAdmin.events({
|
||||
'change #allowGenReg, change #allowAdmReg' (evnnt) {
|
||||
let genReg = $("#allowGenReg").prop('checked');
|
||||
let admReg = $("#allowAdmReg").prop('checked');
|
||||
// console.log("General Reg set to: " + genReg);
|
||||
Meteor.call("add.noSysAdminReg", admReg, genReg, function(err, result) {
|
||||
if (err) {
|
||||
console.log(" ERROR updating permission to allow general registration: " + err);
|
||||
showSnackbar("Registration Permission Change Failed.", "red");
|
||||
} else {
|
||||
console.log(" Successfully updated permission to allow general registration.");
|
||||
showSnackbar("Registration Permission Successfully Changed.", "green")
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue