From a6bed30da4a5d6393fb0d0becad4bb07adb7467c Mon Sep 17 00:00:00 2001 From: hickert Date: Thu, 18 Dec 2008 07:20:50 +0000 Subject: [PATCH] Updated generate_smb_nt_hash() function, to be more verbose in case of an error. git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@13309 594d385d-05f5-0310-b6e9-bd551577e9d8 --- gosa-core/include/functions.inc | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/gosa-core/include/functions.inc b/gosa-core/include/functions.inc index b604e7c1b..726b3ea4b 100644 --- a/gosa-core/include/functions.inc +++ b/gosa-core/include/functions.inc @@ -2574,6 +2574,11 @@ function generate_smb_nt_hash($password) } else { $hash= ""; } + + if ($hash == "") { + msg_dialog::display(_("Configuration error"), _("Cannot generate samba hash!"), ERROR_DIALOG); + return (""); + } } else { $tmp= $config->get_cfg_value('sambaHashHook')." ".escapeshellarg($password); @DEBUG (DEBUG_LDAP, __LINE__, __FUNCTION__, __FILE__, $tmp, "Execute"); @@ -2582,11 +2587,11 @@ function generate_smb_nt_hash($password) flush(); reset($ar); $hash= current($ar); - } - if ($hash == "") { - msg_dialog::display(_("Configuration error"), _("Cannot generate samba hash!"), ERROR_DIALOG); - return (""); + if ($hash == "") { + msg_dialog::display(_("Configuration error"), sprintf(_("Cannot generate samba hash! Couldn't execute '%s', check the configuration attribute 'sambaHashHook' in your gosa.conf!"),$config->get_cfg_value('sambaHashHook')), ERROR_DIALOG); + return (""); + } } list($lm,$nt)= split (":", trim($hash)); -- 2.30.2