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
|
|
@ -32,9 +32,11 @@
|
|||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="card-action">
|
||||
<a href="#" id="reg">Register</a>
|
||||
</div>
|
||||
{{#if $eq canReg true}}
|
||||
<div class="card-action">
|
||||
<a href="#" id="reg">Register</a>
|
||||
</div>
|
||||
{{/if}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
Template.login.onCreated(function() {
|
||||
import { SysConfig } from '../../../imports/api/systemConfig.js';
|
||||
|
||||
Template.login.onCreated(function() {
|
||||
this.subscribe("SystemConfig");
|
||||
});
|
||||
|
||||
Template.login.onRendered(function() {
|
||||
|
|
@ -9,6 +11,14 @@ Template.login.onRendered(function() {
|
|||
Template.login.helpers({
|
||||
areFilled: function() {
|
||||
return Session.get("filledFields");
|
||||
},
|
||||
canReg: function() {
|
||||
let conf = SysConfig.findOne();
|
||||
if (typeof conf != 'undefined') {
|
||||
return conf.allowReg;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
<template name="reg">
|
||||
{{#if $not currentUser}}
|
||||
{{#if $eq allowReg true}}
|
||||
<div id="registrationForm">
|
||||
<div class="container">
|
||||
<h4>Register</h4>
|
||||
|
|
@ -47,5 +48,9 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{else}}
|
||||
<h4>Registration Disabled</h4>
|
||||
<p class="flow-text">The administrator of this system has disabled registration. If you believe you should be allowed to register to use this system, please contact the system administrator for assistance.</p>
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
</template>
|
||||
|
|
@ -1,6 +1,7 @@
|
|||
import { SysConfig } from "../../../imports/api/systemConfig.js";
|
||||
|
||||
Template.reg.onCreated(function() {
|
||||
|
||||
this.subscribe("SystemConfig");
|
||||
});
|
||||
|
||||
Template.reg.onRendered(function() {
|
||||
|
|
@ -27,6 +28,14 @@ Template.reg.helpers({
|
|||
},
|
||||
misReq: function() {
|
||||
return Session.get("missingReq");
|
||||
},
|
||||
allowReg: function() {
|
||||
let conf = SysConfig.findOne();
|
||||
if (typeof conf != 'undefined') {
|
||||
return conf.allowReg;
|
||||
} else {
|
||||
return true
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue