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

+ 20 - 1
src/client/js/components/Admin/Security/SecurityLdapSetting.jsx

@@ -260,7 +260,26 @@ class SecurityLdapSetting extends React.Component {
               { t('security_setting.ldap.group_search_filter') } ({ t('security_setting.optional') })
             </h3>
 
-            {/* GW-617 create form */}
+            <div className="row mb-5">
+              <strong htmlFor="groupSearchBase" className="col-xs-3 text-right">{ t('security_setting.ldap.group_search_base_DN') }</strong>
+              <div className="col-xs-6">
+                <input
+                  className="form-control"
+                  type="text"
+                  name="groupSearchBase"
+                  value={ldapConfig.groupSearchBase}
+                  onChange={e => adminSecurityContainer.changeGroupSearchBase(e.target.value)}
+                />
+                <p className="help-block">
+                  <small>
+                    {/* eslint-disable-next-line react/no-danger */}
+                    <span dangerouslySetInnerHTML={{ __html: t('security_setting.ldap.group_search_base_DN_detail') }} /><br />
+                    { t('security_setting.example') }: <code>ou=groups,dc=domain,dc=com</code>
+                  </small>
+                </p>
+              </div>
+            </div>
+
 
           </React.Fragment>
         )}

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

@@ -33,6 +33,7 @@ export default class AdminSecurityContainer extends Container {
         cbSameUsernameTreatedAsIdenticalUser: true,
         attrMapMail: '',
         attrMapName: '',
+        groupSearchBase: '',
       },
     };
 
@@ -158,4 +159,13 @@ export default class AdminSecurityContainer extends Container {
     this.setState({ newLdapConfig });
   }
 
+  /**
+   * Change group search base
+   */
+  changeGroupSearchBase(inputValue) {
+    const newLdapConfig = this.state.ldapConfig;
+    newLdapConfig.groupSearchBase = inputValue;
+    this.setState({ newLdapConfig });
+  }
+
 }