diff --git a/application/Espo/Services/Settings.php b/application/Espo/Services/Settings.php index d54d35304f..27af265a50 100644 --- a/application/Espo/Services/Settings.php +++ b/application/Espo/Services/Settings.php @@ -111,6 +111,10 @@ class Settings extends \Espo\Core\Services\Base } } + if ($this->getConfig()->get('smtpServer')) { + $data->passwordRecoveryEnabled = true; + } + $fieldDefs = $this->getMetadata()->get(['entityDefs', 'Settings', 'fields']); foreach ($fieldDefs as $field => $fieldParams) { diff --git a/client/res/templates/login.tpl b/client/res/templates/login.tpl index 1e39f39c06..67ac29f0d6 100644 --- a/client/res/templates/login.tpl +++ b/client/res/templates/login.tpl @@ -18,7 +18,7 @@
- {{translate 'Forgot Password?' scope='User'}} + {{#if showForgotPassword}}{{translate 'Forgot Password?' scope='User'}}{{/if}}
diff --git a/client/src/views/login.js b/client/src/views/login.js index 3def28961c..50db30cbe8 100644 --- a/client/src/views/login.js +++ b/client/src/views/login.js @@ -51,7 +51,8 @@ define('views/login', 'view', function (Dep) { data: function () { return { - logoSrc: this.getLogoSrc() + logoSrc: this.getLogoSrc(), + showForgotPassword: this.getConfig().get('passwordRecoveryEnabled'), }; },