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

+ 1 - 0
resource/locales/en-US/translation.json

@@ -531,6 +531,7 @@
     },
     "SAML": {
       "name": "SAML",
+      "enable_saml":"enable SAML",
       "id_detail": "Specification of the name of attribute which can identify the user in SAML Identity Provider",
       "username_detail": "Specification of mappings for <code>username</code> when creating new users",
       "mapping_detail": "Specification of mappings for %s when creating new users",

+ 1 - 0
resource/locales/ja/translation.json

@@ -526,6 +526,7 @@
     },
     "SAML": {
       "name": "SAML",
+      "enable_saml": "SAML を有効にする",
       "id_detail": "SAML Identity プロバイダ内で一意に識別可能な値を格納している属性",
       "username_detail": "新規ユーザーのアカウント名(<code>username</code>)に関連付ける属性",
       "mapping_detail": "新規ユーザーの%sに関連付ける属性",

+ 17 - 0
src/client/js/components/Admin/Security/SamlSecuritySetting.jsx

@@ -24,6 +24,23 @@ class SamlSecurityManagement extends React.Component {
         />
         )}
 
+        <div className="row mb-5">
+          <strong className="col-xs-3 text-right">{ t('security_setting.SAML.name') }</strong>
+          <div className="col-xs-6 text-left">
+            <div className="checkbox checkbox-success">
+              <input
+                id="isSamlEnabled"
+                type="checkbox"
+                checked={adminGeneralSecurityContainer.state.isSamlEnabled}
+                onChange={() => { adminGeneralSecurityContainer.switchIsSamlEnabled() }}
+              />
+              <label htmlFor="isSamlEnabled">
+                { t('security_setting.SAML.enable_saml') }
+              </label>
+            </div>
+          </div>
+        </div>
+
 
       </React.Fragment>
     );

+ 9 - 3
src/client/js/services/AdminGeneralSecurityContainer.js

@@ -23,6 +23,7 @@ export default class AdminGeneralSecurityContainer extends Container {
       registrationMode: 'open',
       registrationWhiteList: '',
       isLdapEnabled: true,
+      isSamlEnabled: true,
     };
 
     this.init();
@@ -57,13 +58,18 @@ export default class AdminGeneralSecurityContainer extends Container {
     this.setState({ registrationMode: value });
   }
 
-  // LDAP function
-
   /**
-   * Switch local enabled
+   * Switch LDAP enabled
    */
   switchIsLdapEnabled() {
     this.setState({ isLdapEnabled: !this.state.isLdapEnabled });
   }
 
+  /**
+   * Switch SAML enabled
+   */
+  switchIsSamlEnabled() {
+    this.setState({ isSamlEnabled: !this.state.isSamlEnabled });
+  }
+
 }