Commit a5850d4b authored by jplang's avatar jplang
Browse files

Fixed that LDAP does not check the user and password when are defined in the...

Fixed that LDAP does not check the user and password when are defined in the method of authentication (#21674).

Patch by Helder Manuel Torres Vieira.

git-svn-id: https://svn.redmine.org/redmine/trunk@15086 e93f8b46-1217-0410-a6f0-8f06a7374b81
parent ccdb939a
......@@ -56,11 +56,16 @@ class AuthSourceLdap < AuthSource
raise AuthSourceException.new(e.message)
end
# test the connection to the LDAP
# Test the connection to the LDAP
def test_connection
with_timeout do
ldap_con = initialize_ldap_con(self.account, self.account_password)
ldap_con.open { }
if self.account.present? && self.account_password.present?
ldap_auth = authenticate_dn(self.account, self.account_password)
raise AuthSourceException.new(l(:error_ldap_bind_credentials)) if !ldap_auth
end
end
rescue *NETWORK_EXCEPTIONS => e
raise AuthSourceException.new(e.message)
......
......@@ -1182,3 +1182,4 @@ ar:
label_any_open_issues: any open issues
label_no_open_issues: no open issues
label_default_values_for_new_users: Default values for new users
error_ldap_bind_credentials: Invalid LDAP Account/Password
......@@ -1277,3 +1277,4 @@ az:
label_any_open_issues: any open issues
label_no_open_issues: no open issues
label_default_values_for_new_users: Default values for new users
error_ldap_bind_credentials: Invalid LDAP Account/Password
......@@ -1173,3 +1173,4 @@ bg:
description_date_from: Въведете начална дата
description_date_to: Въведете крайна дата
text_repository_identifier_info: 'Позволени са малки букви (a-z), цифри, тирета и _.<br />Промяна след създаването му не е възможна.'
error_ldap_bind_credentials: Invalid LDAP Account/Password
......@@ -1195,3 +1195,4 @@ bs:
label_any_open_issues: any open issues
label_no_open_issues: no open issues
label_default_values_for_new_users: Default values for new users
error_ldap_bind_credentials: Invalid LDAP Account/Password
......@@ -195,6 +195,7 @@ ca:
error_unable_delete_issue_status: "No s'ha pogut suprimir l'estat de l'assumpte"
error_unable_to_connect: "No s'ha pogut connectar (%{value})"
warning_attachments_not_saved: "No s'han pogut desar %{count} fitxers."
error_ldap_bind_credentials: "Compte/Contrasenya LDAP incorrecte"
mail_subject_lost_password: "Contrasenya de %{value}"
mail_body_lost_password: "Per a canviar la contrasenya, feu clic en l'enllaç següent:"
......
......@@ -1183,3 +1183,4 @@ cs:
label_any_open_issues: any open issues
label_no_open_issues: no open issues
label_default_values_for_new_users: Default values for new users
error_ldap_bind_credentials: Invalid LDAP Account/Password
......@@ -1199,3 +1199,4 @@ da:
label_any_open_issues: any open issues
label_no_open_issues: no open issues
label_default_values_for_new_users: Default values for new users
error_ldap_bind_credentials: Invalid LDAP Account/Password
......@@ -1191,3 +1191,4 @@ de:
label_any_open_issues: any open issues
label_no_open_issues: no open issues
label_default_values_for_new_users: Standardwerte für neue Benutzer
error_ldap_bind_credentials: Invalid LDAP Account/Password
......@@ -1182,3 +1182,4 @@ el:
label_any_open_issues: any open issues
label_no_open_issues: no open issues
label_default_values_for_new_users: Default values for new users
error_ldap_bind_credentials: Invalid LDAP Account/Password
......@@ -1184,3 +1184,4 @@ en-GB:
setting_attachment_extensions_allowed: Allowed extensions
setting_attachment_extensions_denied: Disallowed extensions
label_default_values_for_new_users: Default values for new users
error_ldap_bind_credentials: Invalid LDAP Account/Password
......@@ -212,6 +212,7 @@ en:
error_invalid_csv_file_or_settings: "The file is not a CSV file or does not match the settings below"
error_can_not_read_import_file: "An error occurred while reading the file to import"
error_attachment_extension_not_allowed: "Attachment extension %{extension} is not allowed"
error_ldap_bind_credentials: "Invalid LDAP Account/Password"
mail_subject_lost_password: "Your %{value} password"
mail_body_lost_password: 'To change your password, click on the following link:'
......
......@@ -255,6 +255,7 @@ es-PA:
error_scm_annotate_big_text_file: "La entrada no puede anotarse, al superar el tamaño máximo para archivos de texto."
error_scm_command_failed: "Se produjo un error al acceder al repositorio: %{value}"
error_scm_not_found: "La entrada y/o la revisión no existe en el repositorio."
error_ldap_bind_credentials: "Cuenta/Contraseña LDAP incorrecta"
field_account: Cuenta
field_activity: Actividad
field_admin: Administrador
......@@ -932,7 +933,7 @@ es-PA:
label_subtask_plural: Subtareas
label_project_copy_notifications: Enviar notificaciones por correo electrónico durante la copia del proyecto
error_can_not_delete_custom_field: Fue imposible eliminar el campo personalizado
error_unable_to_connect: Fue imposible conectar con (%{value})
error_unable_to_connect: Fue imposible conectarse (%{value})
error_can_not_remove_role: Este rol está en uso y no puede ser eliminado.
error_can_not_delete_tracker: Este tipo contiene incidencias y no puede ser eliminado.
field_principal: Principal
......
......@@ -253,6 +253,7 @@ es:
error_scm_annotate_big_text_file: "La entrada no puede anotarse, al superar el tamaño máximo para ficheros de texto."
error_scm_command_failed: "Se produjo un error al acceder al repositorio: %{value}"
error_scm_not_found: "La entrada y/o la revisión no existe en el repositorio."
error_ldap_bind_credentials: Cuenta/Contraseña LDAP incorrecta
field_account: Cuenta
field_activity: Actividad
field_admin: Administrador
......@@ -930,7 +931,7 @@ es:
label_subtask_plural: Subtareas
label_project_copy_notifications: Enviar notificaciones por correo electrónico durante la copia del proyecto
error_can_not_delete_custom_field: Fue imposible eliminar el campo personalizado
error_unable_to_connect: Fue imposible conectar con (%{value})
error_unable_to_connect: Fue imposible conectarse (%{value})
error_can_not_remove_role: Este rol está en uso y no puede ser eliminado.
error_can_not_delete_tracker: Este tipo contiene peticiones y no puede ser eliminado.
field_principal: Principal
......
......@@ -1186,3 +1186,4 @@ et:
label_any_open_issues: "Kõik avatud teemad"
label_no_open_issues: "Mitte ühtki avatud teemat"
label_default_values_for_new_users: Default values for new users
error_ldap_bind_credentials: Invalid LDAP Account/Password
......@@ -1183,3 +1183,4 @@ eu:
label_any_open_issues: any open issues
label_no_open_issues: no open issues
label_default_values_for_new_users: Default values for new users
error_ldap_bind_credentials: Invalid LDAP Account/Password
......@@ -1183,3 +1183,4 @@ fa:
label_any_open_issues: any open issues
label_no_open_issues: no open issues
label_default_values_for_new_users: Default values for new users
error_ldap_bind_credentials: Invalid LDAP Account/Password
......@@ -1203,3 +1203,4 @@ fi:
label_any_open_issues: any open issues
label_no_open_issues: no open issues
label_default_values_for_new_users: Default values for new users
error_ldap_bind_credentials: Invalid LDAP Account/Password
......@@ -232,6 +232,7 @@ fr:
error_invalid_csv_file_or_settings: "Le fichier n'est pas un fichier CSV ou n'est pas conforme aux paramètres sélectionnés"
error_can_not_read_import_file: "Une erreur est survenue lors de la lecture du fichier à importer"
error_attachment_extension_not_allowed: "L'extension %{extension} n'est pas autorisée"
error_ldap_bind_credentials: "Identifiant ou mot de passe LDAP incorrect"
mail_subject_lost_password: "Votre mot de passe %{value}"
mail_body_lost_password: 'Pour changer votre mot de passe, cliquez sur le lien suivant :'
......
......@@ -1190,3 +1190,4 @@ gl:
label_any_open_issues: any open issues
label_no_open_issues: no open issues
label_default_values_for_new_users: Default values for new users
error_ldap_bind_credentials: Invalid LDAP Account/Password
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment