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

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

@@ -48,6 +48,7 @@ class SecurityLdapSetting extends React.Component {
                   type="text"
                   name="serverUrl"
                   value={ldapConfig.serverUrl}
+                  onChange={e => adminSecurityContainer.changeServerUrl(e.target.value)}
                 />
                 <small>
                   <p
@@ -81,11 +82,23 @@ class SecurityLdapSetting extends React.Component {
                       </li>
                     </ul>
                   </div>
-                  {/* TODO */}
                 </div>
               </div>
             </div>
 
+            <div className="row mb-5">
+              <strong className="col-xs-3 text-right">Bind DN</strong>
+              <div className="col-xs-6">
+                <input
+                  className="form-control"
+                  type="text"
+                  name="bindDN"
+                  value={ldapConfig.bindDN}
+                  onChange={e => adminSecurityContainer.changeBindDN(e.target.value)}
+                />
+              </div>
+            </div>
+
           </React.Fragment>
         )}
 

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

@@ -26,6 +26,7 @@ export default class AdminSecurityContainer extends Container {
         isEnabled: true,
         serverUrl: '',
         bindMode: 'manager',
+        bindDN: '',
       },
     };
 
@@ -63,6 +64,8 @@ export default class AdminSecurityContainer extends Container {
     this.setState({ registrationMode: value });
   }
 
+  // LDAP function
+
   /**
    * Switch local enabled
    */
@@ -72,6 +75,15 @@ export default class AdminSecurityContainer extends Container {
     this.setState({ newLdapConfig });
   }
 
+  /**
+   * Change server url
+   */
+  changeServerUrl(inputValue) {
+    const newLdapConfig = this.state.ldapConfig;
+    newLdapConfig.serverUrl = inputValue;
+    this.setState({ newLdapConfig });
+  }
+
   /**
    * Change ldap bind mode
    */
@@ -81,4 +93,13 @@ export default class AdminSecurityContainer extends Container {
     this.setState({ newLdapConfig });
   }
 
+  /**
+   * Change bind DN
+   */
+  changeBindDN(inputValue) {
+    const newLdapConfig = this.state.ldapConfig;
+    newLdapConfig.bindDN = inputValue;
+    this.setState({ newLdapConfig });
+  }
+
 }