From 026ad4ccdf285abed3e46c3d7e56f3c1b3d25609 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Sat, 29 Jun 2013 08:51:37 +0000 Subject: [PATCH] * Admin/Preferences/ADS: give explicit error, that AD requires SSL or TLS to change passwords (not just failing with unspecific error) --- phpgwapi/inc/class.auth_ads.inc.php | 11 ++++++++--- phpgwapi/lang/egw_de.lang | 1 + phpgwapi/lang/egw_en.lang | 1 + 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/phpgwapi/inc/class.auth_ads.inc.php b/phpgwapi/inc/class.auth_ads.inc.php index 0cc8b69c63..bda84b6cce 100644 --- a/phpgwapi/inc/class.auth_ads.inc.php +++ b/phpgwapi/inc/class.auth_ads.inc.php @@ -103,10 +103,15 @@ class auth_ads implements auth_backend */ function change_password($old_passwd, $new_passwd, $account_id=0) { - if (!($adldap = accounts_ads::get_adldap()) || !($adldap->getUseSSL() || $adldap->getUseTLS())) + if (!($adldap = accounts_ads::get_adldap())) { - error_log(__METHOD__."('$old_passwd', '$new_passwd', $account_id) adldap=".array2string($adldap)." returning false"); - return false; // Cant change passwd in ADS + error_log(__METHOD__."(\$old_passwd, \$new_passwd, $account_id) accounts_ads::get_adldap() returned false"); + return false; + } + + if (!($adldap->getUseSSL() || $adldap->getUseTLS())) + { + throw new egw_exception(lang('Failed to change password. Please contact your administrator.').' '.lang('Active directory requires SSL or TLS to change passwords!')); } if(!$account_id || $GLOBALS['egw_info']['flags']['currentapp'] == 'login') diff --git a/phpgwapi/lang/egw_de.lang b/phpgwapi/lang/egw_de.lang index 37061cd633..68b6cc144d 100644 --- a/phpgwapi/lang/egw_de.lang +++ b/phpgwapi/lang/egw_de.lang @@ -40,6 +40,7 @@ action common de Aktion action when category is an email address groupdav de Aktion wenn Kategorie eine E-Mail Adresse ist actions common de Befehle active common de Aktiv +active directory requires ssl or tls to change passwords! common de Active Directory benötigt eine SSL oder TLS Verbindung um Passwörter zu ändern! add common de Hinzufügen add %1 category for common de %1 Kategorie hinzufügen für add category common de Kategorie hinzufügen diff --git a/phpgwapi/lang/egw_en.lang b/phpgwapi/lang/egw_en.lang index 76af56e0bb..5ea5c385e3 100644 --- a/phpgwapi/lang/egw_en.lang +++ b/phpgwapi/lang/egw_en.lang @@ -40,6 +40,7 @@ action common en Action action when category is an email address groupdav en Action when category is an EMail address actions common en Actions active common en Active +active directory requires ssl or tls to change passwords! common en Active directory requires SSL or TLS to change passwords! add common en Add add %1 category for common en Add %1 category for add category common en Add category