itizawa 6 лет назад
Родитель
Сommit
92e66666ff

+ 21 - 3
src/client/js/components/Admin/Security/SecurityLdapSetting.jsx

@@ -179,7 +179,7 @@ class SecurityLdapSetting extends React.Component {
             </h3>
 
             <div className="row mb-5">
-              <label htmlFor="attrMapUsername" className="col-xs-3 text-right">{t('username')}</label>
+              <strong htmlFor="attrMapUsername" className="col-xs-3 text-right">{t('username')}</strong>
               <div className="col-xs-6">
                 <input
                   className="form-control"
@@ -219,14 +219,14 @@ class SecurityLdapSetting extends React.Component {
             </div>
 
             <div className="row mb-5">
-              <label htmlFor="attrMapMail" className="col-xs-3 text-right">Mail</label>
+              <strong htmlFor="attrMapMail" className="col-xs-3 text-right">Mail</strong>
               <div className="col-xs-6">
                 <input
                   className="form-control"
                   type="text"
                   placeholder="Default: mail"
                   name="attrMapMail"
-                  value={adminSecurityContainer.attrMapMail}
+                  value={ldapConfig.attrMapMail}
                   onChange={e => adminSecurityContainer.changeAttrMapMail(e.target.value)}
                 />
                 <p className="help-block">
@@ -237,6 +237,24 @@ class SecurityLdapSetting extends React.Component {
               </div>
             </div>
 
+            <div className="row mb-5">
+              <strong htmlFor="attrMapName" className="col-xs-3 text-right">Name</strong>
+              <div className="col-xs-6">
+                <input
+                  className="form-control"
+                  type="text"
+                  name="attrMapName"
+                  value={ldapConfig.attrMapName}
+                  onChange={e => adminSecurityContainer.changeAttrMapName(e.target.value)}
+                />
+                <p className="help-block">
+                  <small>
+                    { t('security_setting.ldap.name_detail') }
+                  </small>
+                </p>
+              </div>
+            </div>
+
 
             <h3 className="alert-anchor border-bottom">
               { t('security_setting.ldap.group_search_filter') } ({ t('security_setting.optional') })

+ 9 - 0
src/client/js/services/AdminSecurityContainer.js

@@ -32,6 +32,7 @@ export default class AdminSecurityContainer extends Container {
         attrMapUsername: '',
         cbSameUsernameTreatedAsIdenticalUser: true,
         attrMapMail: '',
+        attrMapName: '',
       },
     };
 
@@ -148,5 +149,13 @@ export default class AdminSecurityContainer extends Container {
     this.setState({ newLdapConfig });
   }
 
+  /**
+   * Change attr map name
+   */
+  changeAttrMapName(inputValue) {
+    const newLdapConfig = this.state.ldapConfig;
+    newLdapConfig.attrMapName = inputValue;
+    this.setState({ newLdapConfig });
+  }
 
 }