do not allow password changes if local logins disabled

This commit is contained in:
Shiv Kumar 2014-07-25 14:27:27 -07:00
parent f4f46aea48
commit aac9c24639
2 changed files with 6 additions and 2 deletions

View File

@ -35,6 +35,10 @@ export default Discourse.ObjectController.extend({
return Discourse.SiteSettings.enable_badges && this.get('model.has_title_badges'); return Discourse.SiteSettings.enable_badges && this.get('model.has_title_badges');
}.property('model.badge_count'), }.property('model.badge_count'),
canChangePassword: function() {
return !Discourse.SiteSettings.enable_sso && Discourse.SiteSettings.enable_local_logins;
}.property(),
availableLocales: function() { availableLocales: function() {
return Discourse.SiteSettings.available_locales.split('|').map( function(s) { return Discourse.SiteSettings.available_locales.split('|').map( function(s) {
return {name: s, value: s}; return {name: s, value: s};

View File

@ -60,7 +60,7 @@
</div> </div>
</div> </div>
{{#unless Discourse.SiteSettings.enable_sso }} {{#if canChangePassword}}
<div class="control-group pref-password"> <div class="control-group pref-password">
<label class="control-label">{{i18n user.password.title}}</label> <label class="control-label">{{i18n user.password.title}}</label>
<div class="controls"> <div class="controls">
@ -74,7 +74,7 @@
{{passwordProgress}} {{passwordProgress}}
</div> </div>
</div> </div>
{{/unless}} {{/if}}
<div class="control-group pref-avatar"> <div class="control-group pref-avatar">
<label class="control-label">{{i18n user.avatar.title}}</label> <label class="control-label">{{i18n user.avatar.title}}</label>