From 0b859f62f0c62de2f3983a4131b2b9a9f8537253 Mon Sep 17 00:00:00 2001 From: Kristjan Kullerkann Date: Thu, 3 Dec 2015 17:11:39 +0200 Subject: [PATCH] Added option to disable "Forgot Password" link on login page. --- i18n/en.i18n.json | 1 + packages/rocketchat-lib/server/startup/settings.coffee | 2 ++ packages/rocketchat-ui-login/login/form.coffee | 3 +++ packages/rocketchat-ui-login/login/form.html | 2 ++ 4 files changed, 8 insertions(+) diff --git a/i18n/en.i18n.json b/i18n/en.i18n.json index 9dc586d6867d..ed6fdf939d99 100644 --- a/i18n/en.i18n.json +++ b/i18n/en.i18n.json @@ -57,6 +57,7 @@ "Accounts_RegistrationForm_SecretURL_Description" : "You must provide a random string that will be added to your registration URL. Example: https://demo.rocket.chat/register/[secret_hash]", "Accounts_RegistrationRequired" : "Registration Required", "Accounts_RequireNameForSignUp" : "Require Name For Signup", + "Accounts_PasswordReset" : "Password Reset", "Accounts_Enrollment_Email" : "Enrollment E-mail", "Accounts_Enrollment_Email_Description" : "You may use [name], [fname], [lname] for the user's full name, first name or last name, respectively.
You may use [email] for the user's e-mail.", "Activate" : "Activate", diff --git a/packages/rocketchat-lib/server/startup/settings.coffee b/packages/rocketchat-lib/server/startup/settings.coffee index 71c8244136c2..b5ac283749b4 100644 --- a/packages/rocketchat-lib/server/startup/settings.coffee +++ b/packages/rocketchat-lib/server/startup/settings.coffee @@ -12,6 +12,8 @@ RocketChat.settings.add 'Accounts_RegistrationForm_SecretURL', Random.id(), { ty RocketChat.settings.add 'Accounts_RegistrationForm_LinkReplacementText', 'New user registration is currently disabled', { type: 'string', group: 'Accounts', section: 'Registration', public: true } RocketChat.settings.add 'Accounts_Registration_AuthenticationServices_Enabled', true, { type: 'boolean', group: 'Accounts', section: 'Registration', public: true } +RocketChat.settings.add 'Accounts_PasswordReset', true, { type: 'boolean', group: 'Accounts', public: true, section: 'Registration' } + RocketChat.settings.add 'Accounts_AvatarStoreType', 'GridFS', { type: 'string', group: 'Accounts', section: 'Avatar' } RocketChat.settings.add 'Accounts_AvatarStorePath', '', { type: 'string', group: 'Accounts', section: 'Avatar' } RocketChat.settings.add 'Accounts_AvatarResize', false, { type: 'boolean', group: 'Accounts', section: 'Avatar' } diff --git a/packages/rocketchat-ui-login/login/form.coffee b/packages/rocketchat-ui-login/login/form.coffee index 2a74b14ccfe0..52ef48d4bcb9 100644 --- a/packages/rocketchat-ui-login/login/form.coffee +++ b/packages/rocketchat-ui-login/login/form.coffee @@ -57,6 +57,9 @@ Template.loginForm.helpers linkReplacementText: -> return RocketChat.settings.get('Accounts_RegistrationForm_LinkReplacementText') + passwordresetAllowed: -> + return RocketChat.settings.get 'Accounts_PasswordReset' + Template.loginForm.events 'submit #login-card': (event, instance) -> event.preventDefault() diff --git a/packages/rocketchat-ui-login/login/form.html b/packages/rocketchat-ui-login/login/form.html index ff4d59f903ff..575459711cf5 100644 --- a/packages/rocketchat-ui-login/login/form.html +++ b/packages/rocketchat-ui-login/login/form.html @@ -45,9 +45,11 @@

{{{_ "Registration_Succeeded"}}}

{{else}}{{#if linkReplacementText}} {{{linkReplacementText}}} {{/if}}{{/if}} + {{#if passwordresetAllowed}}
{{_ 'Forgot_password'}}
+ {{/if}} {{/if}}
{{_ 'Back_to_login'}}