Merge pull request #2129 from steven-zou/fix/ldap_configurations

remove ‘required’ flag from 'searchDN and search password' of ldap
This commit is contained in:
Steven Zou 2017-04-25 14:44:38 +08:00 committed by GitHub
commit 59845416ef
3 changed files with 24 additions and 6 deletions

12
.gitignore vendored
View File

@ -27,5 +27,17 @@ src/ui_ng/typings/
**/node_modules **/node_modules
**/ssl/ **/ssl/
**/proxy.config.json **/proxy.config.json
src/ui_ng/src/**/*.js
src/ui_ng/src/**/*.js.map
src/ui_ng/src/**/*.json
**/npm*.log **/npm*.log
src/ui_ng/aot/**/*.js
src/ui_ng/aot/**/*.js.map
src/ui_ng/aot/**/*.json
**/*ngsummary.json
**/*ngfactory.ts
**/aot

View File

@ -29,10 +29,9 @@
</label> </label>
</div> </div>
<div class="form-group"> <div class="form-group">
<label for="ldapSearchDN" class="required">{{'CONFIG.LDAP.SEARCH_DN' | translate}}</label> <label for="ldapSearchDN">{{'CONFIG.LDAP.SEARCH_DN' | translate}}</label>
<label for="ldapSearchDN" aria-haspopup="true" role="tooltip" class="tooltip tooltip-validation tooltip-md tooltip-top-right" [class.invalid]="ldapSearchDNInput.invalid && (ldapSearchDNInput.dirty || ldapSearchDNInput.touched)"> <label for="ldapSearchDN" aria-haspopup="true" role="tooltip" class="tooltip tooltip-validation tooltip-md tooltip-top-right">
<input name="ldapSearchDN" type="text" #ldapSearchDNInput="ngModel" [(ngModel)]="currentConfig.ldap_search_dn.value" <input name="ldapSearchDN" type="text" #ldapSearchDNInput="ngModel" [(ngModel)]="currentConfig.ldap_search_dn.value"
required
id="ldapSearchDN" id="ldapSearchDN"
size="40" [disabled]="disabled(currentConfig.ldap_search_dn)"> size="40" [disabled]="disabled(currentConfig.ldap_search_dn)">
<span class="tooltip-content"> <span class="tooltip-content">
@ -45,10 +44,9 @@
</a> </a>
</div> </div>
<div class="form-group"> <div class="form-group">
<label for="ldapSearchPwd" class="required">{{'CONFIG.LDAP.SEARCH_PWD' | translate}}</label> <label for="ldapSearchPwd">{{'CONFIG.LDAP.SEARCH_PWD' | translate}}</label>
<label for="ldapSearchPwd" aria-haspopup="true" role="tooltip" class="tooltip tooltip-validation tooltip-md tooltip-top-right" [class.invalid]="ldapSearchPwdInput.invalid && (ldapSearchPwdInput.dirty || ldapSearchPwdInput.touched)"> <label for="ldapSearchPwd" aria-haspopup="true" role="tooltip" class="tooltip tooltip-validation tooltip-md tooltip-top-right">
<input name="ldapSearchPwd" type="password" #ldapSearchPwdInput="ngModel" [(ngModel)]="currentConfig.ldap_search_password.value" <input name="ldapSearchPwd" type="password" #ldapSearchPwdInput="ngModel" [(ngModel)]="currentConfig.ldap_search_password.value"
required
id="ldapSearchPwd" id="ldapSearchPwd"
size="40" [disabled]="disabled(currentConfig.ldap_search_password)"> size="40" [disabled]="disabled(currentConfig.ldap_search_password)">
<span class="tooltip-content"> <span class="tooltip-content">

View File

@ -315,6 +315,9 @@ export class ConfigurationComponent implements OnInit, OnDestroy {
delete ldapSettings['ldap_search_password']; delete ldapSettings['ldap_search_password'];
} }
//Fix: Confirm ldap scope is number
ldapSettings['ldap_scope'] = +ldapSettings['ldap_scope'];
this.testingLDAPOnGoing = true; this.testingLDAPOnGoing = true;
this.configService.testLDAPServer(ldapSettings) this.configService.testLDAPServer(ldapSettings)
.then(respone => { .then(respone => {
@ -402,6 +405,11 @@ export class ConfigurationComponent implements OnInit, OnDestroy {
if (typeof field.value === "boolean") { if (typeof field.value === "boolean") {
changes[prop] = changes[prop] ? "1" : "0"; changes[prop] = changes[prop] ? "1" : "0";
} }
//Trim string value
if(typeof field.value === "string") {
changes[prop] = (''+changes[prop]).trim();
}
} }
} }
} }