mirror of
https://github.com/wekan/wekan.git
synced 2025-09-22 01:50:48 +02:00
parent
4bcddcc98a
commit
3076547cee
3 changed files with 30 additions and 22 deletions
|
@ -53,6 +53,18 @@ Template.userFormsLayout.onCreated(function() {
|
||||||
$('.at-pwd-form').hide();
|
$('.at-pwd-form').hide();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Meteor.call('isDisableRegistration', (_, result) => {
|
||||||
|
if (result) {
|
||||||
|
$('.at-signUp').hide();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
Meteor.call('isDisableForgotPassword', (_, data) => {
|
||||||
|
if (result) {
|
||||||
|
$('.at-forgotPwd').hide();
|
||||||
|
}
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
Template.userFormsLayout.onRendered(() => {
|
Template.userFormsLayout.onRendered(() => {
|
||||||
|
|
|
@ -1,19 +1,19 @@
|
||||||
const passwordField = AccountsTemplates.removeField('password');
|
const passwordField = AccountsTemplates.removeField('password');
|
||||||
const emailField = AccountsTemplates.removeField('email');
|
const emailField = AccountsTemplates.removeField('email');
|
||||||
let disableRegistration = true;
|
let disableRegistration = false;
|
||||||
let disableForgotPassword = true;
|
let disableForgotPassword = false;
|
||||||
|
|
||||||
Meteor.call('getDisableRegistration', (err, data) => {
|
Meteor.call('isDisableRegistration', (err, data) => {
|
||||||
if (!err) {
|
if (!err) {
|
||||||
disableRegistration = data;
|
disableRegistration = data;
|
||||||
//console.log(data);
|
console.log(data);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
Meteor.call('getDisableForgotPassword', (err, data) => {
|
Meteor.call('isDisableForgotPassword', (err, data) => {
|
||||||
if (!err) {
|
if (!err) {
|
||||||
disableForgotPassword = data;
|
disableForgotPassword = data;
|
||||||
//console.log(data);
|
console.log(data);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -43,8 +43,8 @@ AccountsTemplates.configure({
|
||||||
confirmPassword: true,
|
confirmPassword: true,
|
||||||
enablePasswordChange: true,
|
enablePasswordChange: true,
|
||||||
sendVerificationEmail: true,
|
sendVerificationEmail: true,
|
||||||
showForgotPasswordLink: !disableForgotPassword,
|
showForgotPasswordLink: disableForgotPassword === false,
|
||||||
forbidClientAccountCreation: disableRegistration,
|
forbidClientAccountCreation: disableRegistration === true,
|
||||||
onLogoutHook() {
|
onLogoutHook() {
|
||||||
const homePage = 'home';
|
const homePage = 'home';
|
||||||
if (FlowRouter.getRouteName() === homePage) {
|
if (FlowRouter.getRouteName() === homePage) {
|
||||||
|
@ -55,14 +55,14 @@ AccountsTemplates.configure({
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
if (!disableForgotPassword) {
|
if (disableForgotPassword === false) {
|
||||||
[
|
[
|
||||||
'forgotPwd',
|
'forgotPwd',
|
||||||
'resetPwd',
|
'resetPwd',
|
||||||
].forEach(routeName => AccountsTemplates.configureRoute(routeName));
|
].forEach(routeName => AccountsTemplates.configureRoute(routeName));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!disableRegistration) {
|
if (disableRegistration === false) {
|
||||||
[
|
[
|
||||||
'signUp',
|
'signUp',
|
||||||
].forEach(routeName => AccountsTemplates.configureRoute(routeName));
|
].forEach(routeName => AccountsTemplates.configureRoute(routeName));
|
||||||
|
|
|
@ -442,25 +442,21 @@ if (Meteor.isServer) {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
getDisableRegistration() {
|
isDisableRegistration() {
|
||||||
const setting = Settings.findOne({});
|
const setting = Settings.findOne({});
|
||||||
if (!setting.disableRegistration) {
|
if (setting.disableRegistration === 'true') {
|
||||||
return false;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
return {
|
return false;
|
||||||
disableRegistration: `${setting.disableRegistration}`,
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
getDisableForgotPassword() {
|
isDisableForgotPassword() {
|
||||||
const setting = Settings.findOne({});
|
const setting = Settings.findOne({});
|
||||||
if (!setting.disableForgotPassword) {
|
if (setting.disableForgotPassword === 'true') {
|
||||||
return false;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
return {
|
return false;
|
||||||
disableForgotPassword: `${setting.disableForgotPassword}`,
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue