Merge pull request #2105 from steven-zou/fix/change_pwd_ldap

Allow admin to change password when auth mode is 'ldap_auth'
This commit is contained in:
Steven Zou 2017-04-21 18:49:19 +08:00 committed by GitHub
commit 2fe243cc25

View File

@ -93,9 +93,10 @@ export class NavigatorComponent implements OnInit {
}
public get canChangePassword(): boolean {
return this.session.getCurrentUser() &&
this.appConfigService.getConfig() &&
this.appConfigService.getConfig().auth_mode != 'ldap_auth';
let user = this.session.getCurrentUser();
let config = this.appConfigService.getConfig();
return user && ((config && config.auth_mode != 'ldap_auth') || (user.user_id === 1 && user.username === 'admin'));
}
matchLang(lang: string): boolean {