hide forgot password if smtp is not configured

This commit is contained in:
yuri
2019-09-16 14:04:50 +03:00
parent 087ab2b954
commit ef48999614
3 changed files with 7 additions and 2 deletions

View File

@@ -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) {

View File

@@ -18,7 +18,7 @@
<input type="password" name="password" id="field-password" class="form-control" tabindex="2" autocomplete="current-password">
</div>
<div>
<a href="javascript:" class="btn btn-link pull-right" data-action="passwordChangeRequest" tabindex="4">{{translate 'Forgot Password?' scope='User'}}</a>
{{#if showForgotPassword}}<a href="javascript:" class="btn btn-link pull-right" data-action="passwordChangeRequest" tabindex="4">{{translate 'Forgot Password?' scope='User'}}</a>{{/if}}
<button type="submit" class="btn btn-primary" id="btn-login" tabindex="3">{{translate 'Login' scope='User'}}</button>
</div>
</form>

View File

@@ -51,7 +51,8 @@ define('views/login', 'view', function (Dep) {
data: function () {
return {
logoSrc: this.getLogoSrc()
logoSrc: this.getLogoSrc(),
showForgotPassword: this.getConfig().get('passwordRecoveryEnabled'),
};
},