diff --git a/controllers/auth.go b/controllers/auth.go index 45150963..8127993f 100644 --- a/controllers/auth.go +++ b/controllers/auth.go @@ -399,10 +399,14 @@ func (c *ApiController) Login() { c.ResponseError(fmt.Sprintf(c.T("auth:The application: %s does not exist"), authForm.Application)) return } - if !application.IsPasswordEnabled() { + if authForm.SigninMethod == "Password" && !application.IsPasswordEnabled() { c.ResponseError(c.T("auth:The login method: login with password is not enabled for the application")) return } + if authForm.SigninMethod == "LDAP" && !application.IsLdapEnabled() { + c.ResponseError(c.T("auth:The login method: login with LDAP is not enabled for the application")) + return + } var enableCaptcha bool if enableCaptcha, err = object.CheckToEnableCaptcha(application, authForm.Organization, authForm.Username); err != nil { c.ResponseError(err.Error()) @@ -432,7 +436,14 @@ func (c *ApiController) Login() { } password := authForm.Password - user, err = object.CheckUserPassword(authForm.Organization, authForm.Username, password, c.GetAcceptLanguage(), enableCaptcha) + isSigninViaLdap := authForm.SigninMethod == "LDAP" + var isPasswordWithLdapEnabled bool + if authForm.SigninMethod == "Password" { + isPasswordWithLdapEnabled = application.IsPasswordWithLdapEnabled() + } else { + isPasswordWithLdapEnabled = false + } + user, err = object.CheckUserPassword(authForm.Organization, authForm.Username, password, c.GetAcceptLanguage(), enableCaptcha, isSigninViaLdap, isPasswordWithLdapEnabled) } if err != nil { diff --git a/form/auth.go b/form/auth.go index 02b209fa..464a3135 100644 --- a/form/auth.go +++ b/form/auth.go @@ -15,7 +15,8 @@ package form type AuthForm struct { - Type string `json:"type"` + Type string `json:"type"` + SigninMethod string `json:"signinMethod"` Organization string `json:"organization"` Username string `json:"username"` diff --git a/i18n/locales/ar/data.json b/i18n/locales/ar/data.json index 2987a3f8..e5f85f3e 100644 --- a/i18n/locales/ar/data.json +++ b/i18n/locales/ar/data.json @@ -15,6 +15,7 @@ "The account for provider: %s and username: %s (%s) does not exist and is not allowed to sign up as new account, please contact your IT support": "The account for provider: %s and username: %s (%s) does not exist and is not allowed to sign up as new account, please contact your IT support", "The account for provider: %s and username: %s (%s) is already linked to another account: %s (%s)": "The account for provider: %s and username: %s (%s) is already linked to another account: %s (%s)", "The application: %s does not exist": "The application: %s does not exist", + "The login method: login with LDAP is not enabled for the application": "The login method: login with LDAP is not enabled for the application", "The login method: login with SMS is not enabled for the application": "The login method: login with SMS is not enabled for the application", "The login method: login with email is not enabled for the application": "The login method: login with email is not enabled for the application", "The login method: login with password is not enabled for the application": "The login method: login with password is not enabled for the application", diff --git a/i18n/locales/de/data.json b/i18n/locales/de/data.json index a07d102d..d6422063 100644 --- a/i18n/locales/de/data.json +++ b/i18n/locales/de/data.json @@ -15,6 +15,7 @@ "The account for provider: %s and username: %s (%s) does not exist and is not allowed to sign up as new account, please contact your IT support": "Das Konto für den Anbieter %s und Benutzernamen %s (%s) existiert nicht und es ist nicht erlaubt, ein neues Konto anzumelden. Bitte wenden Sie sich an Ihren IT-Support", "The account for provider: %s and username: %s (%s) is already linked to another account: %s (%s)": "Das Konto für den Anbieter %s und Benutzernamen %s (%s) ist bereits mit einem anderen Konto verknüpft: %s (%s)", "The application: %s does not exist": "Die Anwendung: %s existiert nicht", + "The login method: login with LDAP is not enabled for the application": "The login method: login with LDAP is not enabled for the application", "The login method: login with SMS is not enabled for the application": "The login method: login with SMS is not enabled for the application", "The login method: login with email is not enabled for the application": "The login method: login with email is not enabled for the application", "The login method: login with password is not enabled for the application": "Die Anmeldeart \"Anmeldung mit Passwort\" ist für die Anwendung nicht aktiviert", diff --git a/i18n/locales/en/data.json b/i18n/locales/en/data.json index 2987a3f8..e5f85f3e 100644 --- a/i18n/locales/en/data.json +++ b/i18n/locales/en/data.json @@ -15,6 +15,7 @@ "The account for provider: %s and username: %s (%s) does not exist and is not allowed to sign up as new account, please contact your IT support": "The account for provider: %s and username: %s (%s) does not exist and is not allowed to sign up as new account, please contact your IT support", "The account for provider: %s and username: %s (%s) is already linked to another account: %s (%s)": "The account for provider: %s and username: %s (%s) is already linked to another account: %s (%s)", "The application: %s does not exist": "The application: %s does not exist", + "The login method: login with LDAP is not enabled for the application": "The login method: login with LDAP is not enabled for the application", "The login method: login with SMS is not enabled for the application": "The login method: login with SMS is not enabled for the application", "The login method: login with email is not enabled for the application": "The login method: login with email is not enabled for the application", "The login method: login with password is not enabled for the application": "The login method: login with password is not enabled for the application", diff --git a/i18n/locales/es/data.json b/i18n/locales/es/data.json index 5510005d..bc0781d3 100644 --- a/i18n/locales/es/data.json +++ b/i18n/locales/es/data.json @@ -15,6 +15,7 @@ "The account for provider: %s and username: %s (%s) does not exist and is not allowed to sign up as new account, please contact your IT support": "La cuenta para el proveedor: %s y el nombre de usuario: %s (%s) no existe y no se permite registrarse como una nueva cuenta, por favor contacte a su soporte de TI", "The account for provider: %s and username: %s (%s) is already linked to another account: %s (%s)": "La cuenta para proveedor: %s y nombre de usuario: %s (%s) ya está vinculada a otra cuenta: %s (%s)", "The application: %s does not exist": "La aplicación: %s no existe", + "The login method: login with LDAP is not enabled for the application": "The login method: login with LDAP is not enabled for the application", "The login method: login with SMS is not enabled for the application": "The login method: login with SMS is not enabled for the application", "The login method: login with email is not enabled for the application": "The login method: login with email is not enabled for the application", "The login method: login with password is not enabled for the application": "El método de inicio de sesión: inicio de sesión con contraseña no está habilitado para la aplicación", diff --git a/i18n/locales/fa/data.json b/i18n/locales/fa/data.json index 2987a3f8..e5f85f3e 100644 --- a/i18n/locales/fa/data.json +++ b/i18n/locales/fa/data.json @@ -15,6 +15,7 @@ "The account for provider: %s and username: %s (%s) does not exist and is not allowed to sign up as new account, please contact your IT support": "The account for provider: %s and username: %s (%s) does not exist and is not allowed to sign up as new account, please contact your IT support", "The account for provider: %s and username: %s (%s) is already linked to another account: %s (%s)": "The account for provider: %s and username: %s (%s) is already linked to another account: %s (%s)", "The application: %s does not exist": "The application: %s does not exist", + "The login method: login with LDAP is not enabled for the application": "The login method: login with LDAP is not enabled for the application", "The login method: login with SMS is not enabled for the application": "The login method: login with SMS is not enabled for the application", "The login method: login with email is not enabled for the application": "The login method: login with email is not enabled for the application", "The login method: login with password is not enabled for the application": "The login method: login with password is not enabled for the application", diff --git a/i18n/locales/fi/data.json b/i18n/locales/fi/data.json index 2987a3f8..e5f85f3e 100644 --- a/i18n/locales/fi/data.json +++ b/i18n/locales/fi/data.json @@ -15,6 +15,7 @@ "The account for provider: %s and username: %s (%s) does not exist and is not allowed to sign up as new account, please contact your IT support": "The account for provider: %s and username: %s (%s) does not exist and is not allowed to sign up as new account, please contact your IT support", "The account for provider: %s and username: %s (%s) is already linked to another account: %s (%s)": "The account for provider: %s and username: %s (%s) is already linked to another account: %s (%s)", "The application: %s does not exist": "The application: %s does not exist", + "The login method: login with LDAP is not enabled for the application": "The login method: login with LDAP is not enabled for the application", "The login method: login with SMS is not enabled for the application": "The login method: login with SMS is not enabled for the application", "The login method: login with email is not enabled for the application": "The login method: login with email is not enabled for the application", "The login method: login with password is not enabled for the application": "The login method: login with password is not enabled for the application", diff --git a/i18n/locales/fr/data.json b/i18n/locales/fr/data.json index 36a83edc..b5e80391 100644 --- a/i18n/locales/fr/data.json +++ b/i18n/locales/fr/data.json @@ -15,6 +15,7 @@ "The account for provider: %s and username: %s (%s) does not exist and is not allowed to sign up as new account, please contact your IT support": "Le compte pour le fournisseur : %s et le nom d'utilisateur : %s (%s) n'existe pas et n'est pas autorisé à s'inscrire comme nouveau compte, veuillez contacter votre support informatique", "The account for provider: %s and username: %s (%s) is already linked to another account: %s (%s)": "Le compte du fournisseur : %s et le nom d'utilisateur : %s (%s) sont déjà liés à un autre compte : %s (%s)", "The application: %s does not exist": "L'application : %s n'existe pas", + "The login method: login with LDAP is not enabled for the application": "The login method: login with LDAP is not enabled for the application", "The login method: login with SMS is not enabled for the application": "The login method: login with SMS is not enabled for the application", "The login method: login with email is not enabled for the application": "The login method: login with email is not enabled for the application", "The login method: login with password is not enabled for the application": "La méthode de connexion : connexion avec mot de passe n'est pas activée pour l'application", diff --git a/i18n/locales/he/data.json b/i18n/locales/he/data.json index 2987a3f8..e5f85f3e 100644 --- a/i18n/locales/he/data.json +++ b/i18n/locales/he/data.json @@ -15,6 +15,7 @@ "The account for provider: %s and username: %s (%s) does not exist and is not allowed to sign up as new account, please contact your IT support": "The account for provider: %s and username: %s (%s) does not exist and is not allowed to sign up as new account, please contact your IT support", "The account for provider: %s and username: %s (%s) is already linked to another account: %s (%s)": "The account for provider: %s and username: %s (%s) is already linked to another account: %s (%s)", "The application: %s does not exist": "The application: %s does not exist", + "The login method: login with LDAP is not enabled for the application": "The login method: login with LDAP is not enabled for the application", "The login method: login with SMS is not enabled for the application": "The login method: login with SMS is not enabled for the application", "The login method: login with email is not enabled for the application": "The login method: login with email is not enabled for the application", "The login method: login with password is not enabled for the application": "The login method: login with password is not enabled for the application", diff --git a/i18n/locales/id/data.json b/i18n/locales/id/data.json index 32c91a1d..5804eabc 100644 --- a/i18n/locales/id/data.json +++ b/i18n/locales/id/data.json @@ -15,6 +15,7 @@ "The account for provider: %s and username: %s (%s) does not exist and is not allowed to sign up as new account, please contact your IT support": "Akun untuk penyedia: %s dan nama pengguna: %s (%s) tidak ada dan tidak diizinkan untuk mendaftar sebagai akun baru, silakan hubungi dukungan IT Anda", "The account for provider: %s and username: %s (%s) is already linked to another account: %s (%s)": "Akun untuk provider: %s dan username: %s (%s) sudah terhubung dengan akun lain: %s (%s)", "The application: %s does not exist": "Aplikasi: %s tidak ada", + "The login method: login with LDAP is not enabled for the application": "The login method: login with LDAP is not enabled for the application", "The login method: login with SMS is not enabled for the application": "The login method: login with SMS is not enabled for the application", "The login method: login with email is not enabled for the application": "The login method: login with email is not enabled for the application", "The login method: login with password is not enabled for the application": "Metode login: login dengan kata sandi tidak diaktifkan untuk aplikasi tersebut", diff --git a/i18n/locales/it/data.json b/i18n/locales/it/data.json index 2987a3f8..e5f85f3e 100644 --- a/i18n/locales/it/data.json +++ b/i18n/locales/it/data.json @@ -15,6 +15,7 @@ "The account for provider: %s and username: %s (%s) does not exist and is not allowed to sign up as new account, please contact your IT support": "The account for provider: %s and username: %s (%s) does not exist and is not allowed to sign up as new account, please contact your IT support", "The account for provider: %s and username: %s (%s) is already linked to another account: %s (%s)": "The account for provider: %s and username: %s (%s) is already linked to another account: %s (%s)", "The application: %s does not exist": "The application: %s does not exist", + "The login method: login with LDAP is not enabled for the application": "The login method: login with LDAP is not enabled for the application", "The login method: login with SMS is not enabled for the application": "The login method: login with SMS is not enabled for the application", "The login method: login with email is not enabled for the application": "The login method: login with email is not enabled for the application", "The login method: login with password is not enabled for the application": "The login method: login with password is not enabled for the application", diff --git a/i18n/locales/ja/data.json b/i18n/locales/ja/data.json index fab0884f..56e298d8 100644 --- a/i18n/locales/ja/data.json +++ b/i18n/locales/ja/data.json @@ -15,6 +15,7 @@ "The account for provider: %s and username: %s (%s) does not exist and is not allowed to sign up as new account, please contact your IT support": "プロバイダー名:%sとユーザー名:%s(%s)のアカウントは存在しません。新しいアカウントとしてサインアップすることはできません。 ITサポートに連絡してください", "The account for provider: %s and username: %s (%s) is already linked to another account: %s (%s)": "プロバイダのアカウント:%s とユーザー名:%s (%s) は既に別のアカウント:%s (%s) にリンクされています", "The application: %s does not exist": "アプリケーション: %sは存在しません", + "The login method: login with LDAP is not enabled for the application": "The login method: login with LDAP is not enabled for the application", "The login method: login with SMS is not enabled for the application": "The login method: login with SMS is not enabled for the application", "The login method: login with email is not enabled for the application": "The login method: login with email is not enabled for the application", "The login method: login with password is not enabled for the application": "ログイン方法:パスワードでのログインはアプリケーションで有効になっていません", diff --git a/i18n/locales/kk/data.json b/i18n/locales/kk/data.json index 2987a3f8..e5f85f3e 100644 --- a/i18n/locales/kk/data.json +++ b/i18n/locales/kk/data.json @@ -15,6 +15,7 @@ "The account for provider: %s and username: %s (%s) does not exist and is not allowed to sign up as new account, please contact your IT support": "The account for provider: %s and username: %s (%s) does not exist and is not allowed to sign up as new account, please contact your IT support", "The account for provider: %s and username: %s (%s) is already linked to another account: %s (%s)": "The account for provider: %s and username: %s (%s) is already linked to another account: %s (%s)", "The application: %s does not exist": "The application: %s does not exist", + "The login method: login with LDAP is not enabled for the application": "The login method: login with LDAP is not enabled for the application", "The login method: login with SMS is not enabled for the application": "The login method: login with SMS is not enabled for the application", "The login method: login with email is not enabled for the application": "The login method: login with email is not enabled for the application", "The login method: login with password is not enabled for the application": "The login method: login with password is not enabled for the application", diff --git a/i18n/locales/ko/data.json b/i18n/locales/ko/data.json index 22597506..bd3cb5c3 100644 --- a/i18n/locales/ko/data.json +++ b/i18n/locales/ko/data.json @@ -15,6 +15,7 @@ "The account for provider: %s and username: %s (%s) does not exist and is not allowed to sign up as new account, please contact your IT support": "공급자 계정 %s과 사용자 이름 %s (%s)는 존재하지 않으며 새 계정으로 등록할 수 없습니다. IT 지원팀에 문의하십시오", "The account for provider: %s and username: %s (%s) is already linked to another account: %s (%s)": "공급자 계정 %s과 사용자 이름 %s(%s)는 이미 다른 계정 %s(%s)에 연결되어 있습니다", "The application: %s does not exist": "해당 애플리케이션(%s)이 존재하지 않습니다", + "The login method: login with LDAP is not enabled for the application": "The login method: login with LDAP is not enabled for the application", "The login method: login with SMS is not enabled for the application": "The login method: login with SMS is not enabled for the application", "The login method: login with email is not enabled for the application": "The login method: login with email is not enabled for the application", "The login method: login with password is not enabled for the application": "어플리케이션에서는 암호를 사용한 로그인 방법이 활성화되어 있지 않습니다", diff --git a/i18n/locales/ms/data.json b/i18n/locales/ms/data.json index 2987a3f8..e5f85f3e 100644 --- a/i18n/locales/ms/data.json +++ b/i18n/locales/ms/data.json @@ -15,6 +15,7 @@ "The account for provider: %s and username: %s (%s) does not exist and is not allowed to sign up as new account, please contact your IT support": "The account for provider: %s and username: %s (%s) does not exist and is not allowed to sign up as new account, please contact your IT support", "The account for provider: %s and username: %s (%s) is already linked to another account: %s (%s)": "The account for provider: %s and username: %s (%s) is already linked to another account: %s (%s)", "The application: %s does not exist": "The application: %s does not exist", + "The login method: login with LDAP is not enabled for the application": "The login method: login with LDAP is not enabled for the application", "The login method: login with SMS is not enabled for the application": "The login method: login with SMS is not enabled for the application", "The login method: login with email is not enabled for the application": "The login method: login with email is not enabled for the application", "The login method: login with password is not enabled for the application": "The login method: login with password is not enabled for the application", diff --git a/i18n/locales/nl/data.json b/i18n/locales/nl/data.json index 2987a3f8..e5f85f3e 100644 --- a/i18n/locales/nl/data.json +++ b/i18n/locales/nl/data.json @@ -15,6 +15,7 @@ "The account for provider: %s and username: %s (%s) does not exist and is not allowed to sign up as new account, please contact your IT support": "The account for provider: %s and username: %s (%s) does not exist and is not allowed to sign up as new account, please contact your IT support", "The account for provider: %s and username: %s (%s) is already linked to another account: %s (%s)": "The account for provider: %s and username: %s (%s) is already linked to another account: %s (%s)", "The application: %s does not exist": "The application: %s does not exist", + "The login method: login with LDAP is not enabled for the application": "The login method: login with LDAP is not enabled for the application", "The login method: login with SMS is not enabled for the application": "The login method: login with SMS is not enabled for the application", "The login method: login with email is not enabled for the application": "The login method: login with email is not enabled for the application", "The login method: login with password is not enabled for the application": "The login method: login with password is not enabled for the application", diff --git a/i18n/locales/pl/data.json b/i18n/locales/pl/data.json index 2987a3f8..e5f85f3e 100644 --- a/i18n/locales/pl/data.json +++ b/i18n/locales/pl/data.json @@ -15,6 +15,7 @@ "The account for provider: %s and username: %s (%s) does not exist and is not allowed to sign up as new account, please contact your IT support": "The account for provider: %s and username: %s (%s) does not exist and is not allowed to sign up as new account, please contact your IT support", "The account for provider: %s and username: %s (%s) is already linked to another account: %s (%s)": "The account for provider: %s and username: %s (%s) is already linked to another account: %s (%s)", "The application: %s does not exist": "The application: %s does not exist", + "The login method: login with LDAP is not enabled for the application": "The login method: login with LDAP is not enabled for the application", "The login method: login with SMS is not enabled for the application": "The login method: login with SMS is not enabled for the application", "The login method: login with email is not enabled for the application": "The login method: login with email is not enabled for the application", "The login method: login with password is not enabled for the application": "The login method: login with password is not enabled for the application", diff --git a/i18n/locales/pt/data.json b/i18n/locales/pt/data.json index 2987a3f8..e5f85f3e 100644 --- a/i18n/locales/pt/data.json +++ b/i18n/locales/pt/data.json @@ -15,6 +15,7 @@ "The account for provider: %s and username: %s (%s) does not exist and is not allowed to sign up as new account, please contact your IT support": "The account for provider: %s and username: %s (%s) does not exist and is not allowed to sign up as new account, please contact your IT support", "The account for provider: %s and username: %s (%s) is already linked to another account: %s (%s)": "The account for provider: %s and username: %s (%s) is already linked to another account: %s (%s)", "The application: %s does not exist": "The application: %s does not exist", + "The login method: login with LDAP is not enabled for the application": "The login method: login with LDAP is not enabled for the application", "The login method: login with SMS is not enabled for the application": "The login method: login with SMS is not enabled for the application", "The login method: login with email is not enabled for the application": "The login method: login with email is not enabled for the application", "The login method: login with password is not enabled for the application": "The login method: login with password is not enabled for the application", diff --git a/i18n/locales/ru/data.json b/i18n/locales/ru/data.json index 0ea39d34..02bd58e8 100644 --- a/i18n/locales/ru/data.json +++ b/i18n/locales/ru/data.json @@ -15,6 +15,7 @@ "The account for provider: %s and username: %s (%s) does not exist and is not allowed to sign up as new account, please contact your IT support": "Аккаунт для провайдера: %s и имя пользователя: %s (%s) не существует и не может быть зарегистрирован как новый аккаунт. Пожалуйста, обратитесь в службу поддержки IT", "The account for provider: %s and username: %s (%s) is already linked to another account: %s (%s)": "Аккаунт поставщика: %s и имя пользователя: %s (%s) уже связаны с другим аккаунтом: %s (%s)", "The application: %s does not exist": "Приложение: %s не существует", + "The login method: login with LDAP is not enabled for the application": "The login method: login with LDAP is not enabled for the application", "The login method: login with SMS is not enabled for the application": "The login method: login with SMS is not enabled for the application", "The login method: login with email is not enabled for the application": "The login method: login with email is not enabled for the application", "The login method: login with password is not enabled for the application": "Метод входа: вход с паролем не включен для приложения", diff --git a/i18n/locales/sv/data.json b/i18n/locales/sv/data.json index 2987a3f8..e5f85f3e 100644 --- a/i18n/locales/sv/data.json +++ b/i18n/locales/sv/data.json @@ -15,6 +15,7 @@ "The account for provider: %s and username: %s (%s) does not exist and is not allowed to sign up as new account, please contact your IT support": "The account for provider: %s and username: %s (%s) does not exist and is not allowed to sign up as new account, please contact your IT support", "The account for provider: %s and username: %s (%s) is already linked to another account: %s (%s)": "The account for provider: %s and username: %s (%s) is already linked to another account: %s (%s)", "The application: %s does not exist": "The application: %s does not exist", + "The login method: login with LDAP is not enabled for the application": "The login method: login with LDAP is not enabled for the application", "The login method: login with SMS is not enabled for the application": "The login method: login with SMS is not enabled for the application", "The login method: login with email is not enabled for the application": "The login method: login with email is not enabled for the application", "The login method: login with password is not enabled for the application": "The login method: login with password is not enabled for the application", diff --git a/i18n/locales/tr/data.json b/i18n/locales/tr/data.json index 2987a3f8..e5f85f3e 100644 --- a/i18n/locales/tr/data.json +++ b/i18n/locales/tr/data.json @@ -15,6 +15,7 @@ "The account for provider: %s and username: %s (%s) does not exist and is not allowed to sign up as new account, please contact your IT support": "The account for provider: %s and username: %s (%s) does not exist and is not allowed to sign up as new account, please contact your IT support", "The account for provider: %s and username: %s (%s) is already linked to another account: %s (%s)": "The account for provider: %s and username: %s (%s) is already linked to another account: %s (%s)", "The application: %s does not exist": "The application: %s does not exist", + "The login method: login with LDAP is not enabled for the application": "The login method: login with LDAP is not enabled for the application", "The login method: login with SMS is not enabled for the application": "The login method: login with SMS is not enabled for the application", "The login method: login with email is not enabled for the application": "The login method: login with email is not enabled for the application", "The login method: login with password is not enabled for the application": "The login method: login with password is not enabled for the application", diff --git a/i18n/locales/uk/data.json b/i18n/locales/uk/data.json index 2987a3f8..e5f85f3e 100644 --- a/i18n/locales/uk/data.json +++ b/i18n/locales/uk/data.json @@ -15,6 +15,7 @@ "The account for provider: %s and username: %s (%s) does not exist and is not allowed to sign up as new account, please contact your IT support": "The account for provider: %s and username: %s (%s) does not exist and is not allowed to sign up as new account, please contact your IT support", "The account for provider: %s and username: %s (%s) is already linked to another account: %s (%s)": "The account for provider: %s and username: %s (%s) is already linked to another account: %s (%s)", "The application: %s does not exist": "The application: %s does not exist", + "The login method: login with LDAP is not enabled for the application": "The login method: login with LDAP is not enabled for the application", "The login method: login with SMS is not enabled for the application": "The login method: login with SMS is not enabled for the application", "The login method: login with email is not enabled for the application": "The login method: login with email is not enabled for the application", "The login method: login with password is not enabled for the application": "The login method: login with password is not enabled for the application", diff --git a/i18n/locales/vi/data.json b/i18n/locales/vi/data.json index 9f276de0..16bb4597 100644 --- a/i18n/locales/vi/data.json +++ b/i18n/locales/vi/data.json @@ -15,6 +15,7 @@ "The account for provider: %s and username: %s (%s) does not exist and is not allowed to sign up as new account, please contact your IT support": "Tài khoản cho nhà cung cấp: %s và tên người dùng: %s (%s) không tồn tại và không được phép đăng ký như một tài khoản mới, vui lòng liên hệ với bộ phận hỗ trợ công nghệ thông tin của bạn", "The account for provider: %s and username: %s (%s) is already linked to another account: %s (%s)": "Tài khoản cho nhà cung cấp: %s và tên người dùng: %s (%s) đã được liên kết với tài khoản khác: %s (%s)", "The application: %s does not exist": "Ứng dụng: %s không tồn tại", + "The login method: login with LDAP is not enabled for the application": "The login method: login with LDAP is not enabled for the application", "The login method: login with SMS is not enabled for the application": "The login method: login with SMS is not enabled for the application", "The login method: login with email is not enabled for the application": "The login method: login with email is not enabled for the application", "The login method: login with password is not enabled for the application": "Phương thức đăng nhập: đăng nhập bằng mật khẩu không được kích hoạt cho ứng dụng", diff --git a/i18n/locales/zh/data.json b/i18n/locales/zh/data.json index a52e42b9..76e2c924 100644 --- a/i18n/locales/zh/data.json +++ b/i18n/locales/zh/data.json @@ -15,6 +15,7 @@ "The account for provider: %s and username: %s (%s) does not exist and is not allowed to sign up as new account, please contact your IT support": "提供商账户: %s 与用户名: %s (%s) 不存在且 不允许注册新账户, 请联系IT支持", "The account for provider: %s and username: %s (%s) is already linked to another account: %s (%s)": "提供商账户: %s与用户名: %s (%s)已经与其他账户绑定: %s (%s)", "The application: %s does not exist": "应用%s不存在", + "The login method: login with LDAP is not enabled for the application": "该应用禁止采用LDAP登录方式", "The login method: login with SMS is not enabled for the application": "该应用禁止采用短信登录方式", "The login method: login with email is not enabled for the application": "该应用禁止采用邮箱登录方式", "The login method: login with password is not enabled for the application": "该应用禁止采用密码登录方式", diff --git a/init_data.json.template b/init_data.json.template index 872a5abe..41c09d62 100644 --- a/init_data.json.template +++ b/init_data.json.template @@ -49,7 +49,7 @@ { "name": "Password", "displayName": "Password", - "rule": "None", + "rule": "All", }, { "name": "Verification code", @@ -61,6 +61,11 @@ "displayName": "WebAuthn", "rule": "None", }, + { + "name": "LDAP", + "displayName": "LDAP", + "rule": "None", + }, ], "signupItems": [ { diff --git a/object/application.go b/object/application.go index b68adb07..e64bafbd 100644 --- a/object/application.go +++ b/object/application.go @@ -201,7 +201,7 @@ func extendApplicationWithOrg(application *Application) (err error) { func extendApplicationWithSigninMethods(application *Application) (err error) { if len(application.SigninMethods) == 0 { if application.EnablePassword { - signinMethod := &SigninMethod{Name: "Password", DisplayName: "Password", Rule: "None"} + signinMethod := &SigninMethod{Name: "Password", DisplayName: "Password", Rule: "All"} application.SigninMethods = append(application.SigninMethods, signinMethod) } if application.EnableCodeSignin { @@ -212,10 +212,12 @@ func extendApplicationWithSigninMethods(application *Application) (err error) { signinMethod := &SigninMethod{Name: "WebAuthn", DisplayName: "WebAuthn", Rule: "None"} application.SigninMethods = append(application.SigninMethods, signinMethod) } + signinMethod := &SigninMethod{Name: "LDAP", DisplayName: "LDAP", Rule: "None"} + application.SigninMethods = append(application.SigninMethods, signinMethod) } if len(application.SigninMethods) == 0 { - signinMethod := &SigninMethod{Name: "Password", DisplayName: "Password", Rule: "None"} + signinMethod := &SigninMethod{Name: "Password", DisplayName: "Password", Rule: "All"} application.SigninMethods = append(application.SigninMethods, signinMethod) } @@ -544,6 +546,19 @@ func (application *Application) IsPasswordEnabled() bool { } } +func (application *Application) IsPasswordWithLdapEnabled() bool { + if len(application.SigninMethods) == 0 { + return application.EnablePassword + } else { + for _, signinMethod := range application.SigninMethods { + if signinMethod.Name == "Password" && signinMethod.Rule == "All" { + return true + } + } + return false + } +} + func (application *Application) IsCodeSigninViaEmailEnabled() bool { if len(application.SigninMethods) == 0 { return application.EnableCodeSignin @@ -570,6 +585,17 @@ func (application *Application) IsCodeSigninViaSmsEnabled() bool { } } +func (application *Application) IsLdapEnabled() bool { + if len(application.SigninMethods) > 0 { + for _, signinMethod := range application.SigninMethods { + if signinMethod.Name == "LDAP" { + return true + } + } + } + return false +} + func IsOriginAllowed(origin string) (bool, error) { applications, err := GetApplications("") if err != nil { diff --git a/object/check.go b/object/check.go index fdbb7b71..2166f592 100644 --- a/object/check.go +++ b/object/check.go @@ -278,8 +278,12 @@ func checkLdapUserPassword(user *User, password string, lang string) error { func CheckUserPassword(organization string, username string, password string, lang string, options ...bool) (*User, error) { enableCaptcha := false + isSigninViaLdap := false + isPasswordWithLdapEnabled := false if len(options) > 0 { enableCaptcha = options[0] + isSigninViaLdap = options[1] + isPasswordWithLdapEnabled = options[2] } user, err := GetUserByFields(organization, username) if err != nil { @@ -294,7 +298,16 @@ func CheckUserPassword(organization string, username string, password string, la return nil, fmt.Errorf(i18n.Translate(lang, "check:The user is forbidden to sign in, please contact the administrator")) } + if isSigninViaLdap { + if user.Ldap == "" { + return nil, fmt.Errorf(i18n.Translate(lang, "check:The user: %s doesn't exist in LDAP server"), username) + } + } + if user.Ldap != "" { + if !isSigninViaLdap && !isPasswordWithLdapEnabled { + return nil, fmt.Errorf(i18n.Translate(lang, "check:password or code is incorrect")) + } // only for LDAP users err = checkLdapUserPassword(user, password, lang) if err != nil { diff --git a/object/init.go b/object/init.go index edd9da25..2da23fa5 100644 --- a/object/init.go +++ b/object/init.go @@ -184,6 +184,7 @@ func initBuiltInApplication() { {Name: "Password", DisplayName: "Password", Rule: "None"}, {Name: "Verification code", DisplayName: "Verification code", Rule: "All"}, {Name: "WebAuthn", DisplayName: "WebAuthn", Rule: "None"}, + {Name: "LDAP", DisplayName: "LDAP", Rule: "None"}, }, SignupItems: []*SignupItem{ {Name: "ID", Visible: false, Required: true, Prompted: false, Rule: "Random"}, diff --git a/web/src/ApplicationEditPage.js b/web/src/ApplicationEditPage.js index 156934d1..ca2f644e 100644 --- a/web/src/ApplicationEditPage.js +++ b/web/src/ApplicationEditPage.js @@ -1034,7 +1034,7 @@ class ApplicationEditPage extends React.Component { submitApplicationEdit(exitAfterSave) { const application = Setting.deepCopy(this.state.application); application.providers = application.providers?.filter(provider => this.state.providers.map(provider => provider.name).includes(provider.name)); - application.signinMethods = application.signinMethods?.filter(signinMethod => ["Password", "Verification code", "WebAuthn"].includes(signinMethod.name)); + application.signinMethods = application.signinMethods?.filter(signinMethod => ["Password", "Verification code", "WebAuthn", "LDAP"].includes(signinMethod.name)); ApplicationBackend.updateApplication("admin", this.state.applicationName, application) .then((res) => { diff --git a/web/src/ApplicationListPage.js b/web/src/ApplicationListPage.js index 9a0438c5..6f3ebeb4 100644 --- a/web/src/ApplicationListPage.js +++ b/web/src/ApplicationListPage.js @@ -47,9 +47,10 @@ class ApplicationListPage extends BaseListPage { {name: "provider_captcha_default", canSignUp: false, canSignIn: false, canUnlink: false, prompted: false, signupGroup: "", rule: ""}, ], SigninMethods: [ - {name: "Password", displayName: "Password", rule: "None"}, + {name: "Password", displayName: "Password", rule: "All"}, {name: "Verification code", displayName: "Verification code", rule: "All"}, {name: "WebAuthn", displayName: "WebAuthn", rule: "None"}, + {name: "LDAP", displayName: "LDAP", rule: "None"}, ], signupItems: [ {name: "ID", visible: false, required: true, rule: "Random"}, diff --git a/web/src/Setting.js b/web/src/Setting.js index 5dd960ef..0666d549 100644 --- a/web/src/Setting.js +++ b/web/src/Setting.js @@ -1155,6 +1155,14 @@ export function isWebAuthnEnabled(application) { } } +export function isLdapEnabled(application) { + if (application) { + return application.signinMethods.filter(item => item.name === "LDAP").length > 0; + } else { + return false; + } +} + export function getLoginLink(application) { let url; if (application === null) { diff --git a/web/src/auth/LoginPage.js b/web/src/auth/LoginPage.js index ea660e83..3f077b7a 100644 --- a/web/src/auth/LoginPage.js +++ b/web/src/auth/LoginPage.js @@ -213,6 +213,7 @@ class LoginPage extends React.Component { break; } case "WebAuthn": return "webAuthn"; + case "LDAP": return "ldap"; } } @@ -224,6 +225,7 @@ class LoginPage extends React.Component { case "verificationCode": return i18next.t("login:Email or phone"); case "verificationCodeEmail": return i18next.t("login:Email"); case "verificationCodePhone": return i18next.t("login:Phone"); + case "ldap": return i18next.t("login:LDAP username, Email or phone"); default: return i18next.t("login:username, Email or phone"); } } @@ -253,6 +255,15 @@ class LoginPage extends React.Component { values["organization"] = this.getApplicationObj().organization; } + if (this.state.loginMethod === "password") { + values["signinMethod"] = "Password"; + } else if (this.state.loginMethod?.includes("verificationCode")) { + values["signinMethod"] = "Verification code"; + } else if (this.state.loginMethod === "webAuthn") { + values["signinMethod"] = "WebAuthn"; + } else if (this.state.loginMethod === "ldap") { + values["signinMethod"] = "LDAP"; + } const oAuthParams = Util.getOAuthGetParameters(); values["type"] = oAuthParams?.responseType ?? this.state.type; @@ -329,7 +340,7 @@ class LoginPage extends React.Component { this.signInWithWebAuthn(username, values); return; } - if (this.state.loginMethod === "password") { + if (this.state.loginMethod === "password" || this.state.loginMethod === "ldap") { if (this.state.enableCaptchaModal === CaptchaRule.Always) { this.setState({ openCaptchaModal: true, @@ -507,7 +518,7 @@ class LoginPage extends React.Component { ); } - const showForm = Setting.isPasswordEnabled(application) || Setting.isCodeSigninEnabled(application) || Setting.isWebAuthnEnabled(application); + const showForm = Setting.isPasswordEnabled(application) || Setting.isCodeSigninEnabled(application) || Setting.isWebAuthnEnabled(application) || Setting.isLdapEnabled(application); if (showForm) { let loginWidth = 320; if (Setting.getLanguage() === "fr") { @@ -570,6 +581,7 @@ class LoginPage extends React.Component { switch (this.state.loginMethod) { case "verificationCodeEmail": return i18next.t("login:Please input your Email!"); case "verificationCodePhone": return i18next.t("login:Please input your Phone!"); + case "ldap": return i18next.t("login:Please input your LDAP username!"); default: return i18next.t("login:Please input your Email or Phone!"); } }, @@ -870,7 +882,7 @@ class LoginPage extends React.Component { renderPasswordOrCodeInput() { const application = this.getApplicationObj(); - if (this.state.loginMethod === "password") { + if (this.state.loginMethod === "password" || this.state.loginMethod === "ldap") { return ( } type="password" placeholder={i18next.t("general:Password")} - disabled={!Setting.isPasswordEnabled(application)} + disabled={this.state.loginMethod === "password" ? !Setting.isPasswordEnabled(application) : !Setting.isLdapEnabled(application)} /> @@ -916,11 +928,13 @@ class LoginPage extends React.Component { }; const itemsMap = new Map([ - [generateItemKey("Password", "None"), {label: i18next.t("general:Password"), key: "password"}], + [generateItemKey("Password", "All"), {label: i18next.t("general:Password"), key: "password"}], + [generateItemKey("Password", "Non-LDAP"), {label: i18next.t("general:Password"), key: "password"}], [generateItemKey("Verification code", "All"), {label: i18next.t("login:Verification code"), key: "verificationCode"}], [generateItemKey("Verification code", "Email only"), {label: i18next.t("login:Verification code"), key: "verificationCodeEmail"}], [generateItemKey("Verification code", "Phone only"), {label: i18next.t("login:Verification code"), key: "verificationCodePhone"}], [generateItemKey("WebAuthn", "None"), {label: i18next.t("login:WebAuthn"), key: "webAuthn"}], + [generateItemKey("LDAP", "None"), {label: i18next.t("login:LDAP"), key: "ldap"}], ]); application?.signinMethods.forEach((signinMethod) => { @@ -1059,7 +1073,7 @@ class LoginPage extends React.Component { } const visibleOAuthProviderItems = (application.providers === null) ? [] : application.providers.filter(providerItem => this.isProviderVisible(providerItem)); - if (this.props.preview !== "auto" && !Setting.isPasswordEnabled(application) && !Setting.isCodeSigninEnabled(application) && !Setting.isWebAuthnEnabled(application) && visibleOAuthProviderItems.length === 1) { + if (this.props.preview !== "auto" && !Setting.isPasswordEnabled(application) && !Setting.isCodeSigninEnabled(application) && !Setting.isWebAuthnEnabled(application) && !Setting.isLdapEnabled(application) && visibleOAuthProviderItems.length === 1) { Setting.goToLink(Provider.getAuthUrl(application, visibleOAuthProviderItems[0].provider, "signup")); return (
diff --git a/web/src/locales/ar/data.json b/web/src/locales/ar/data.json index f94732a4..c98279a8 100644 --- a/web/src/locales/ar/data.json +++ b/web/src/locales/ar/data.json @@ -265,6 +265,7 @@ "Models": "Models", "Name": "Name", "Name - Tooltip": "Unique, string-based ID", + "Non-LDAP": "Non-LDAP", "None": "None", "OAuth providers": "OAuth providers", "OK": "OK", @@ -431,6 +432,8 @@ "Failed to obtain MetaMask authorization": "Failed to obtain MetaMask authorization", "Failed to obtain Web3-Onboard authorization": "Failed to obtain Web3-Onboard authorization", "Forgot password?": "Forgot password?", + "LDAP": "LDAP", + "LDAP username, Email or phone": "LDAP username, Email or phone", "Loading": "Loading", "Logging out...": "Logging out...", "MetaMask plugin not detected": "MetaMask plugin not detected", @@ -439,6 +442,7 @@ "Phone": "Phone", "Please input your Email or Phone!": "Please input your Email or Phone!", "Please input your Email!": "Please input your Email!", + "Please input your LDAP username!": "Please input your LDAP username!", "Please input your Phone!": "Please input your Phone!", "Please input your code!": "Please input your code!", "Please input your organization name!": "Please input your organization name!", diff --git a/web/src/locales/de/data.json b/web/src/locales/de/data.json index 2ae05431..cc2c2ec2 100644 --- a/web/src/locales/de/data.json +++ b/web/src/locales/de/data.json @@ -265,6 +265,7 @@ "Models": "Modelle", "Name": "Name", "Name - Tooltip": "Eindeutige, auf Strings basierende ID", + "Non-LDAP": "Non-LDAP", "None": "None", "OAuth providers": "OAuth-Provider", "OK": "OK", @@ -431,6 +432,8 @@ "Failed to obtain MetaMask authorization": "Failed to obtain MetaMask authorization", "Failed to obtain Web3-Onboard authorization": "Failed to obtain Web3-Onboard authorization", "Forgot password?": "Passwort vergessen?", + "LDAP": "LDAP", + "LDAP username, Email or phone": "LDAP username, Email or phone", "Loading": "Laden", "Logging out...": "Ausloggen...", "MetaMask plugin not detected": "MetaMask plugin not detected", @@ -439,6 +442,7 @@ "Phone": "Phone", "Please input your Email or Phone!": "Bitte geben Sie Ihre E-Mail oder Telefonnummer ein!", "Please input your Email!": "Please input your Email!", + "Please input your LDAP username!": "Please input your LDAP username!", "Please input your Phone!": "Please input your Phone!", "Please input your code!": "Bitte geben Sie Ihren Code ein!", "Please input your organization name!": "Please input your organization name!", diff --git a/web/src/locales/en/data.json b/web/src/locales/en/data.json index 130a1602..aec54886 100644 --- a/web/src/locales/en/data.json +++ b/web/src/locales/en/data.json @@ -265,6 +265,7 @@ "Models": "Models", "Name": "Name", "Name - Tooltip": "Unique, string-based ID", + "Non-LDAP": "Non-LDAP", "None": "None", "OAuth providers": "OAuth providers", "OK": "OK", @@ -431,6 +432,8 @@ "Failed to obtain MetaMask authorization": "Failed to obtain MetaMask authorization", "Failed to obtain Web3-Onboard authorization": "Failed to obtain Web3-Onboard authorization", "Forgot password?": "Forgot password?", + "LDAP": "LDAP", + "LDAP username, Email or phone": "LDAP username, Email or phone", "Loading": "Loading", "Logging out...": "Logging out...", "MetaMask plugin not detected": "MetaMask plugin not detected", @@ -439,6 +442,7 @@ "Phone": "Phone", "Please input your Email or Phone!": "Please input your Email or Phone!", "Please input your Email!": "Please input your Email!", + "Please input your LDAP username!": "Please input your LDAP username!", "Please input your Phone!": "Please input your Phone!", "Please input your code!": "Please input your code!", "Please input your organization name!": "Please input your organization name!", diff --git a/web/src/locales/es/data.json b/web/src/locales/es/data.json index 99c630c8..6bbd5c24 100644 --- a/web/src/locales/es/data.json +++ b/web/src/locales/es/data.json @@ -265,6 +265,7 @@ "Models": "Modelos", "Name": "Nombre", "Name - Tooltip": "ID único basado en cadenas", + "Non-LDAP": "Non-LDAP", "None": "None", "OAuth providers": "Proveedores de OAuth", "OK": "Vale", @@ -431,6 +432,8 @@ "Failed to obtain MetaMask authorization": "Failed to obtain MetaMask authorization", "Failed to obtain Web3-Onboard authorization": "Failed to obtain Web3-Onboard authorization", "Forgot password?": "¿Olvidaste tu contraseña?", + "LDAP": "LDAP", + "LDAP username, Email or phone": "LDAP username, Email or phone", "Loading": "Cargando", "Logging out...": "Cerrando sesión...", "MetaMask plugin not detected": "MetaMask plugin not detected", @@ -439,6 +442,7 @@ "Phone": "Phone", "Please input your Email or Phone!": "¡Por favor introduzca su correo electrónico o teléfono!", "Please input your Email!": "Please input your Email!", + "Please input your LDAP username!": "Please input your LDAP username!", "Please input your Phone!": "Please input your Phone!", "Please input your code!": "¡Por favor ingrese su código!", "Please input your organization name!": "Please input your organization name!", diff --git a/web/src/locales/fa/data.json b/web/src/locales/fa/data.json index f94732a4..c98279a8 100644 --- a/web/src/locales/fa/data.json +++ b/web/src/locales/fa/data.json @@ -265,6 +265,7 @@ "Models": "Models", "Name": "Name", "Name - Tooltip": "Unique, string-based ID", + "Non-LDAP": "Non-LDAP", "None": "None", "OAuth providers": "OAuth providers", "OK": "OK", @@ -431,6 +432,8 @@ "Failed to obtain MetaMask authorization": "Failed to obtain MetaMask authorization", "Failed to obtain Web3-Onboard authorization": "Failed to obtain Web3-Onboard authorization", "Forgot password?": "Forgot password?", + "LDAP": "LDAP", + "LDAP username, Email or phone": "LDAP username, Email or phone", "Loading": "Loading", "Logging out...": "Logging out...", "MetaMask plugin not detected": "MetaMask plugin not detected", @@ -439,6 +442,7 @@ "Phone": "Phone", "Please input your Email or Phone!": "Please input your Email or Phone!", "Please input your Email!": "Please input your Email!", + "Please input your LDAP username!": "Please input your LDAP username!", "Please input your Phone!": "Please input your Phone!", "Please input your code!": "Please input your code!", "Please input your organization name!": "Please input your organization name!", diff --git a/web/src/locales/fi/data.json b/web/src/locales/fi/data.json index f94732a4..c98279a8 100644 --- a/web/src/locales/fi/data.json +++ b/web/src/locales/fi/data.json @@ -265,6 +265,7 @@ "Models": "Models", "Name": "Name", "Name - Tooltip": "Unique, string-based ID", + "Non-LDAP": "Non-LDAP", "None": "None", "OAuth providers": "OAuth providers", "OK": "OK", @@ -431,6 +432,8 @@ "Failed to obtain MetaMask authorization": "Failed to obtain MetaMask authorization", "Failed to obtain Web3-Onboard authorization": "Failed to obtain Web3-Onboard authorization", "Forgot password?": "Forgot password?", + "LDAP": "LDAP", + "LDAP username, Email or phone": "LDAP username, Email or phone", "Loading": "Loading", "Logging out...": "Logging out...", "MetaMask plugin not detected": "MetaMask plugin not detected", @@ -439,6 +442,7 @@ "Phone": "Phone", "Please input your Email or Phone!": "Please input your Email or Phone!", "Please input your Email!": "Please input your Email!", + "Please input your LDAP username!": "Please input your LDAP username!", "Please input your Phone!": "Please input your Phone!", "Please input your code!": "Please input your code!", "Please input your organization name!": "Please input your organization name!", diff --git a/web/src/locales/fr/data.json b/web/src/locales/fr/data.json index 429bbc43..4c3da755 100644 --- a/web/src/locales/fr/data.json +++ b/web/src/locales/fr/data.json @@ -265,6 +265,7 @@ "Models": "Modèles", "Name": "Nom", "Name - Tooltip": "Identifiant unique à base de chaîne", + "Non-LDAP": "Non-LDAP", "None": "Aucun", "OAuth providers": "Fournisseurs OAuth", "OK": "Ok", @@ -431,6 +432,8 @@ "Failed to obtain MetaMask authorization": "Échec de l'obtention de l'autorisation MetaMask", "Failed to obtain Web3-Onboard authorization": "Échec de l'obtention de l'autorisation MetaMask", "Forgot password?": "Mot de passe oublié ?", + "LDAP": "LDAP", + "LDAP username, Email or phone": "LDAP username, Email or phone", "Loading": "Chargement", "Logging out...": "Déconnexion...", "MetaMask plugin not detected": "Le plugin MetaMask n'a pas été détecté", @@ -439,6 +442,7 @@ "Phone": "Phone", "Please input your Email or Phone!": "Veuillez saisir votre adresse e-mail ou votre numéro de téléphone !", "Please input your Email!": "Please input your Email!", + "Please input your LDAP username!": "Please input your LDAP username!", "Please input your Phone!": "Please input your Phone!", "Please input your code!": "Veuillez saisir votre code !", "Please input your organization name!": "Veuillez saisir le nom de votre organisation !", diff --git a/web/src/locales/he/data.json b/web/src/locales/he/data.json index f94732a4..c98279a8 100644 --- a/web/src/locales/he/data.json +++ b/web/src/locales/he/data.json @@ -265,6 +265,7 @@ "Models": "Models", "Name": "Name", "Name - Tooltip": "Unique, string-based ID", + "Non-LDAP": "Non-LDAP", "None": "None", "OAuth providers": "OAuth providers", "OK": "OK", @@ -431,6 +432,8 @@ "Failed to obtain MetaMask authorization": "Failed to obtain MetaMask authorization", "Failed to obtain Web3-Onboard authorization": "Failed to obtain Web3-Onboard authorization", "Forgot password?": "Forgot password?", + "LDAP": "LDAP", + "LDAP username, Email or phone": "LDAP username, Email or phone", "Loading": "Loading", "Logging out...": "Logging out...", "MetaMask plugin not detected": "MetaMask plugin not detected", @@ -439,6 +442,7 @@ "Phone": "Phone", "Please input your Email or Phone!": "Please input your Email or Phone!", "Please input your Email!": "Please input your Email!", + "Please input your LDAP username!": "Please input your LDAP username!", "Please input your Phone!": "Please input your Phone!", "Please input your code!": "Please input your code!", "Please input your organization name!": "Please input your organization name!", diff --git a/web/src/locales/id/data.json b/web/src/locales/id/data.json index 06a35d48..808dceb0 100644 --- a/web/src/locales/id/data.json +++ b/web/src/locales/id/data.json @@ -265,6 +265,7 @@ "Models": "Model-model", "Name": "Nama", "Name - Tooltip": "ID unik berbasis string", + "Non-LDAP": "Non-LDAP", "None": "None", "OAuth providers": "Penyedia OAuth", "OK": "Baik atau Oke", @@ -431,6 +432,8 @@ "Failed to obtain MetaMask authorization": "Failed to obtain MetaMask authorization", "Failed to obtain Web3-Onboard authorization": "Failed to obtain Web3-Onboard authorization", "Forgot password?": "Lupa kata sandi?", + "LDAP": "LDAP", + "LDAP username, Email or phone": "LDAP username, Email or phone", "Loading": "Memuat", "Logging out...": "Keluar...", "MetaMask plugin not detected": "MetaMask plugin not detected", @@ -439,6 +442,7 @@ "Phone": "Phone", "Please input your Email or Phone!": "Silahkan masukkan email atau nomor telepon Anda!", "Please input your Email!": "Please input your Email!", + "Please input your LDAP username!": "Please input your LDAP username!", "Please input your Phone!": "Please input your Phone!", "Please input your code!": "Silakan masukkan kode Anda!", "Please input your organization name!": "Please input your organization name!", diff --git a/web/src/locales/it/data.json b/web/src/locales/it/data.json index 05f3c894..8eaac5ee 100644 --- a/web/src/locales/it/data.json +++ b/web/src/locales/it/data.json @@ -265,6 +265,7 @@ "Models": "Models", "Name": "Name", "Name - Tooltip": "Unique, string-based ID", + "Non-LDAP": "Non-LDAP", "None": "None", "OAuth providers": "OAuth providers", "OK": "OK", @@ -431,6 +432,8 @@ "Failed to obtain MetaMask authorization": "Failed to obtain MetaMask authorization", "Failed to obtain Web3-Onboard authorization": "Failed to obtain Web3-Onboard authorization", "Forgot password?": "Forgot password?", + "LDAP": "LDAP", + "LDAP username, Email or phone": "LDAP username, Email or phone", "Loading": "Loading", "Logging out...": "Logging out...", "MetaMask plugin not detected": "MetaMask plugin not detected", @@ -439,6 +442,7 @@ "Phone": "Phone", "Please input your Email or Phone!": "Please input your Email or Phone!", "Please input your Email!": "Please input your Email!", + "Please input your LDAP username!": "Please input your LDAP username!", "Please input your Phone!": "Please input your Phone!", "Please input your code!": "Please input your code!", "Please input your organization name!": "Please input your organization name!", diff --git a/web/src/locales/ja/data.json b/web/src/locales/ja/data.json index 51ec7a67..93fddf39 100644 --- a/web/src/locales/ja/data.json +++ b/web/src/locales/ja/data.json @@ -265,6 +265,7 @@ "Models": "モデル", "Name": "名前", "Name - Tooltip": "ユニークで文字列ベースのID", + "Non-LDAP": "Non-LDAP", "None": "None", "OAuth providers": "OAuthプロバイダー", "OK": "了解", @@ -431,6 +432,8 @@ "Failed to obtain MetaMask authorization": "Failed to obtain MetaMask authorization", "Failed to obtain Web3-Onboard authorization": "Failed to obtain Web3-Onboard authorization", "Forgot password?": "パスワードを忘れましたか?", + "LDAP": "LDAP", + "LDAP username, Email or phone": "LDAP username, Email or phone", "Loading": "ローディング", "Logging out...": "ログアウト中...", "MetaMask plugin not detected": "MetaMask plugin not detected", @@ -439,6 +442,7 @@ "Phone": "Phone", "Please input your Email or Phone!": "あなたのメールアドレスまたは電話番号を入力してください!", "Please input your Email!": "Please input your Email!", + "Please input your LDAP username!": "Please input your LDAP username!", "Please input your Phone!": "Please input your Phone!", "Please input your code!": "あなたのコードを入力してください!", "Please input your organization name!": "Please input your organization name!", diff --git a/web/src/locales/kk/data.json b/web/src/locales/kk/data.json index f94732a4..c98279a8 100644 --- a/web/src/locales/kk/data.json +++ b/web/src/locales/kk/data.json @@ -265,6 +265,7 @@ "Models": "Models", "Name": "Name", "Name - Tooltip": "Unique, string-based ID", + "Non-LDAP": "Non-LDAP", "None": "None", "OAuth providers": "OAuth providers", "OK": "OK", @@ -431,6 +432,8 @@ "Failed to obtain MetaMask authorization": "Failed to obtain MetaMask authorization", "Failed to obtain Web3-Onboard authorization": "Failed to obtain Web3-Onboard authorization", "Forgot password?": "Forgot password?", + "LDAP": "LDAP", + "LDAP username, Email or phone": "LDAP username, Email or phone", "Loading": "Loading", "Logging out...": "Logging out...", "MetaMask plugin not detected": "MetaMask plugin not detected", @@ -439,6 +442,7 @@ "Phone": "Phone", "Please input your Email or Phone!": "Please input your Email or Phone!", "Please input your Email!": "Please input your Email!", + "Please input your LDAP username!": "Please input your LDAP username!", "Please input your Phone!": "Please input your Phone!", "Please input your code!": "Please input your code!", "Please input your organization name!": "Please input your organization name!", diff --git a/web/src/locales/ko/data.json b/web/src/locales/ko/data.json index 72f6c40a..b6c9dfe2 100644 --- a/web/src/locales/ko/data.json +++ b/web/src/locales/ko/data.json @@ -265,6 +265,7 @@ "Models": "모델들", "Name": "이름", "Name - Tooltip": "고유한 문자열 기반 ID", + "Non-LDAP": "Non-LDAP", "None": "None", "OAuth providers": "OAuth 공급자", "OK": "예", @@ -431,6 +432,8 @@ "Failed to obtain MetaMask authorization": "Failed to obtain MetaMask authorization", "Failed to obtain Web3-Onboard authorization": "Failed to obtain Web3-Onboard authorization", "Forgot password?": "비밀번호를 잊으셨나요?", + "LDAP": "LDAP", + "LDAP username, Email or phone": "LDAP username, Email or phone", "Loading": "로딩 중입니다", "Logging out...": "로그아웃 중...", "MetaMask plugin not detected": "MetaMask plugin not detected", @@ -439,6 +442,7 @@ "Phone": "Phone", "Please input your Email or Phone!": "이메일 또는 전화번호를 입력해주세요!", "Please input your Email!": "Please input your Email!", + "Please input your LDAP username!": "Please input your LDAP username!", "Please input your Phone!": "Please input your Phone!", "Please input your code!": "코드를 입력해주세요!", "Please input your organization name!": "Please input your organization name!", diff --git a/web/src/locales/ms/data.json b/web/src/locales/ms/data.json index f94732a4..c98279a8 100644 --- a/web/src/locales/ms/data.json +++ b/web/src/locales/ms/data.json @@ -265,6 +265,7 @@ "Models": "Models", "Name": "Name", "Name - Tooltip": "Unique, string-based ID", + "Non-LDAP": "Non-LDAP", "None": "None", "OAuth providers": "OAuth providers", "OK": "OK", @@ -431,6 +432,8 @@ "Failed to obtain MetaMask authorization": "Failed to obtain MetaMask authorization", "Failed to obtain Web3-Onboard authorization": "Failed to obtain Web3-Onboard authorization", "Forgot password?": "Forgot password?", + "LDAP": "LDAP", + "LDAP username, Email or phone": "LDAP username, Email or phone", "Loading": "Loading", "Logging out...": "Logging out...", "MetaMask plugin not detected": "MetaMask plugin not detected", @@ -439,6 +442,7 @@ "Phone": "Phone", "Please input your Email or Phone!": "Please input your Email or Phone!", "Please input your Email!": "Please input your Email!", + "Please input your LDAP username!": "Please input your LDAP username!", "Please input your Phone!": "Please input your Phone!", "Please input your code!": "Please input your code!", "Please input your organization name!": "Please input your organization name!", diff --git a/web/src/locales/nl/data.json b/web/src/locales/nl/data.json index f94732a4..c98279a8 100644 --- a/web/src/locales/nl/data.json +++ b/web/src/locales/nl/data.json @@ -265,6 +265,7 @@ "Models": "Models", "Name": "Name", "Name - Tooltip": "Unique, string-based ID", + "Non-LDAP": "Non-LDAP", "None": "None", "OAuth providers": "OAuth providers", "OK": "OK", @@ -431,6 +432,8 @@ "Failed to obtain MetaMask authorization": "Failed to obtain MetaMask authorization", "Failed to obtain Web3-Onboard authorization": "Failed to obtain Web3-Onboard authorization", "Forgot password?": "Forgot password?", + "LDAP": "LDAP", + "LDAP username, Email or phone": "LDAP username, Email or phone", "Loading": "Loading", "Logging out...": "Logging out...", "MetaMask plugin not detected": "MetaMask plugin not detected", @@ -439,6 +442,7 @@ "Phone": "Phone", "Please input your Email or Phone!": "Please input your Email or Phone!", "Please input your Email!": "Please input your Email!", + "Please input your LDAP username!": "Please input your LDAP username!", "Please input your Phone!": "Please input your Phone!", "Please input your code!": "Please input your code!", "Please input your organization name!": "Please input your organization name!", diff --git a/web/src/locales/pl/data.json b/web/src/locales/pl/data.json index f94732a4..c98279a8 100644 --- a/web/src/locales/pl/data.json +++ b/web/src/locales/pl/data.json @@ -265,6 +265,7 @@ "Models": "Models", "Name": "Name", "Name - Tooltip": "Unique, string-based ID", + "Non-LDAP": "Non-LDAP", "None": "None", "OAuth providers": "OAuth providers", "OK": "OK", @@ -431,6 +432,8 @@ "Failed to obtain MetaMask authorization": "Failed to obtain MetaMask authorization", "Failed to obtain Web3-Onboard authorization": "Failed to obtain Web3-Onboard authorization", "Forgot password?": "Forgot password?", + "LDAP": "LDAP", + "LDAP username, Email or phone": "LDAP username, Email or phone", "Loading": "Loading", "Logging out...": "Logging out...", "MetaMask plugin not detected": "MetaMask plugin not detected", @@ -439,6 +442,7 @@ "Phone": "Phone", "Please input your Email or Phone!": "Please input your Email or Phone!", "Please input your Email!": "Please input your Email!", + "Please input your LDAP username!": "Please input your LDAP username!", "Please input your Phone!": "Please input your Phone!", "Please input your code!": "Please input your code!", "Please input your organization name!": "Please input your organization name!", diff --git a/web/src/locales/pt/data.json b/web/src/locales/pt/data.json index 8f33b7d4..2da308a5 100644 --- a/web/src/locales/pt/data.json +++ b/web/src/locales/pt/data.json @@ -265,6 +265,7 @@ "Models": "Modelos", "Name": "Nome", "Name - Tooltip": "ID único em formato de string", + "Non-LDAP": "Non-LDAP", "None": "None", "OAuth providers": "Provedores OAuth", "OK": "OK", @@ -431,6 +432,8 @@ "Failed to obtain MetaMask authorization": "Failed to obtain MetaMask authorization", "Failed to obtain Web3-Onboard authorization": "Failed to obtain Web3-Onboard authorization", "Forgot password?": "Esqueceu a senha?", + "LDAP": "LDAP", + "LDAP username, Email or phone": "LDAP username, Email or phone", "Loading": "Carregando", "Logging out...": "Saindo...", "MetaMask plugin not detected": "MetaMask plugin not detected", @@ -439,6 +442,7 @@ "Phone": "Phone", "Please input your Email or Phone!": "Por favor, informe seu email ou telefone!", "Please input your Email!": "Please input your Email!", + "Please input your LDAP username!": "Please input your LDAP username!", "Please input your Phone!": "Please input your Phone!", "Please input your code!": "Por favor, informe o código!", "Please input your organization name!": "Please input your organization name!", diff --git a/web/src/locales/ru/data.json b/web/src/locales/ru/data.json index 8d329c41..2135b067 100644 --- a/web/src/locales/ru/data.json +++ b/web/src/locales/ru/data.json @@ -265,6 +265,7 @@ "Models": "Модели", "Name": "Имя", "Name - Tooltip": "Уникальный идентификатор на основе строки", + "Non-LDAP": "Non-LDAP", "None": "None", "OAuth providers": "Провайдеры OAuth", "OK": "OK - Хорошо", @@ -431,6 +432,8 @@ "Failed to obtain MetaMask authorization": "Failed to obtain MetaMask authorization", "Failed to obtain Web3-Onboard authorization": "Failed to obtain Web3-Onboard authorization", "Forgot password?": "Забыли пароль?", + "LDAP": "LDAP", + "LDAP username, Email or phone": "LDAP username, Email or phone", "Loading": "Загрузка", "Logging out...": "Выход...", "MetaMask plugin not detected": "MetaMask plugin not detected", @@ -439,6 +442,7 @@ "Phone": "Phone", "Please input your Email or Phone!": "Пожалуйста, введите свой адрес электронной почты или номер телефона!", "Please input your Email!": "Please input your Email!", + "Please input your LDAP username!": "Please input your LDAP username!", "Please input your Phone!": "Please input your Phone!", "Please input your code!": "Пожалуйста, введите свой код!", "Please input your organization name!": "Please input your organization name!", diff --git a/web/src/locales/sv/data.json b/web/src/locales/sv/data.json index f94732a4..c98279a8 100644 --- a/web/src/locales/sv/data.json +++ b/web/src/locales/sv/data.json @@ -265,6 +265,7 @@ "Models": "Models", "Name": "Name", "Name - Tooltip": "Unique, string-based ID", + "Non-LDAP": "Non-LDAP", "None": "None", "OAuth providers": "OAuth providers", "OK": "OK", @@ -431,6 +432,8 @@ "Failed to obtain MetaMask authorization": "Failed to obtain MetaMask authorization", "Failed to obtain Web3-Onboard authorization": "Failed to obtain Web3-Onboard authorization", "Forgot password?": "Forgot password?", + "LDAP": "LDAP", + "LDAP username, Email or phone": "LDAP username, Email or phone", "Loading": "Loading", "Logging out...": "Logging out...", "MetaMask plugin not detected": "MetaMask plugin not detected", @@ -439,6 +442,7 @@ "Phone": "Phone", "Please input your Email or Phone!": "Please input your Email or Phone!", "Please input your Email!": "Please input your Email!", + "Please input your LDAP username!": "Please input your LDAP username!", "Please input your Phone!": "Please input your Phone!", "Please input your code!": "Please input your code!", "Please input your organization name!": "Please input your organization name!", diff --git a/web/src/locales/tr/data.json b/web/src/locales/tr/data.json index f94732a4..c98279a8 100644 --- a/web/src/locales/tr/data.json +++ b/web/src/locales/tr/data.json @@ -265,6 +265,7 @@ "Models": "Models", "Name": "Name", "Name - Tooltip": "Unique, string-based ID", + "Non-LDAP": "Non-LDAP", "None": "None", "OAuth providers": "OAuth providers", "OK": "OK", @@ -431,6 +432,8 @@ "Failed to obtain MetaMask authorization": "Failed to obtain MetaMask authorization", "Failed to obtain Web3-Onboard authorization": "Failed to obtain Web3-Onboard authorization", "Forgot password?": "Forgot password?", + "LDAP": "LDAP", + "LDAP username, Email or phone": "LDAP username, Email or phone", "Loading": "Loading", "Logging out...": "Logging out...", "MetaMask plugin not detected": "MetaMask plugin not detected", @@ -439,6 +442,7 @@ "Phone": "Phone", "Please input your Email or Phone!": "Please input your Email or Phone!", "Please input your Email!": "Please input your Email!", + "Please input your LDAP username!": "Please input your LDAP username!", "Please input your Phone!": "Please input your Phone!", "Please input your code!": "Please input your code!", "Please input your organization name!": "Please input your organization name!", diff --git a/web/src/locales/uk/data.json b/web/src/locales/uk/data.json index f94732a4..c98279a8 100644 --- a/web/src/locales/uk/data.json +++ b/web/src/locales/uk/data.json @@ -265,6 +265,7 @@ "Models": "Models", "Name": "Name", "Name - Tooltip": "Unique, string-based ID", + "Non-LDAP": "Non-LDAP", "None": "None", "OAuth providers": "OAuth providers", "OK": "OK", @@ -431,6 +432,8 @@ "Failed to obtain MetaMask authorization": "Failed to obtain MetaMask authorization", "Failed to obtain Web3-Onboard authorization": "Failed to obtain Web3-Onboard authorization", "Forgot password?": "Forgot password?", + "LDAP": "LDAP", + "LDAP username, Email or phone": "LDAP username, Email or phone", "Loading": "Loading", "Logging out...": "Logging out...", "MetaMask plugin not detected": "MetaMask plugin not detected", @@ -439,6 +442,7 @@ "Phone": "Phone", "Please input your Email or Phone!": "Please input your Email or Phone!", "Please input your Email!": "Please input your Email!", + "Please input your LDAP username!": "Please input your LDAP username!", "Please input your Phone!": "Please input your Phone!", "Please input your code!": "Please input your code!", "Please input your organization name!": "Please input your organization name!", diff --git a/web/src/locales/vi/data.json b/web/src/locales/vi/data.json index 6b40f710..c211d5bc 100644 --- a/web/src/locales/vi/data.json +++ b/web/src/locales/vi/data.json @@ -265,6 +265,7 @@ "Models": "Mô hình", "Name": "Tên", "Name - Tooltip": "ID duy nhất dựa trên chuỗi", + "Non-LDAP": "Non-LDAP", "None": "None", "OAuth providers": "Nhà cung cấp OAuth", "OK": "Được rồi", @@ -431,6 +432,8 @@ "Failed to obtain MetaMask authorization": "Failed to obtain MetaMask authorization", "Failed to obtain Web3-Onboard authorization": "Failed to obtain Web3-Onboard authorization", "Forgot password?": "Quên mật khẩu?", + "LDAP": "LDAP", + "LDAP username, Email or phone": "LDAP username, Email or phone", "Loading": "Đang tải", "Logging out...": "Đăng xuất ...", "MetaMask plugin not detected": "MetaMask plugin not detected", @@ -439,6 +442,7 @@ "Phone": "Phone", "Please input your Email or Phone!": "Vui lòng nhập địa chỉ Email hoặc số điện thoại của bạn!", "Please input your Email!": "Please input your Email!", + "Please input your LDAP username!": "Please input your LDAP username!", "Please input your Phone!": "Please input your Phone!", "Please input your code!": "Vui lòng nhập mã của bạn!", "Please input your organization name!": "Please input your organization name!", diff --git a/web/src/locales/zh/data.json b/web/src/locales/zh/data.json index 72adf01b..757be67e 100644 --- a/web/src/locales/zh/data.json +++ b/web/src/locales/zh/data.json @@ -265,6 +265,7 @@ "Models": "Casbin模型", "Name": "名称", "Name - Tooltip": "唯一的、字符串式的ID", + "Non-LDAP": "禁用LDAP", "None": "无", "OAuth providers": "OAuth提供方", "OK": "OK", @@ -431,6 +432,8 @@ "Failed to obtain MetaMask authorization": "获取MetaMask授权失败", "Failed to obtain Web3-Onboard authorization": "获取 Web3-Onboard 授权失败", "Forgot password?": "忘记密码?", + "LDAP": "LDAP登录", + "LDAP username, Email or phone": "LDAP用户名, Email或手机号", "Loading": "加载中", "Logging out...": "正在退出登录...", "MetaMask plugin not detected": "未检测到MetaMask插件", @@ -439,6 +442,7 @@ "Phone": "手机号", "Please input your Email or Phone!": "请输入您的Email或手机号!", "Please input your Email!": "请输入您的Email!", + "Please input your LDAP username!": "请输入您的LDAP用户名!", "Please input your Phone!": "请输入您的手机号!", "Please input your code!": "请输入您的验证码!", "Please input your organization name!": "请输入组织的名字!", diff --git a/web/src/table/SigninTable.js b/web/src/table/SigninTable.js index 1c583302..75615512 100644 --- a/web/src/table/SigninTable.js +++ b/web/src/table/SigninTable.js @@ -70,6 +70,7 @@ class SigninTable extends React.Component { {name: "Password", displayName: i18next.t("general:Password")}, {name: "Verification code", displayName: i18next.t("login:Verification code")}, {name: "WebAuthn", displayName: i18next.t("login:WebAuthn")}, + {name: "LDAP", displayName: i18next.t("login:LDAP")}, ]; const columns = [ { @@ -91,7 +92,7 @@ class SigninTable extends React.Component { onChange={value => { this.updateField(table, index, "name", value); this.updateField(table, index, "displayName", value); - if (value === "Verification code") { + if (value === "Verification code" || value === "Password") { this.updateField(table, index, "rule", "All"); } else { this.updateField(table, index, "rule", "None"); @@ -130,6 +131,11 @@ class SigninTable extends React.Component { {id: "Email only", name: i18next.t("general:Email only")}, {id: "Phone only", name: i18next.t("general:Phone only")}, ]; + } else if (record.name === "Password") { + options = [ + {id: "All", name: i18next.t("general:All")}, + {id: "Non-LDAP", name: i18next.t("general:Non-LDAP")}, + ]; } if (options.length === 0) {