From f2482bbbe91d009629cd2dcfd0410b3a4516878b Mon Sep 17 00:00:00 2001 From: hickert Date: Thu, 25 Oct 2007 05:44:22 +0000 Subject: [PATCH] Ensure that clear passwords will stay clear after they were changed- git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@7648 594d385d-05f5-0310-b6e9-bd551577e9d8 --- include/functions.inc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/include/functions.inc b/include/functions.inc index 8da921a7b..423fb28e3 100644 --- a/include/functions.inc +++ b/include/functions.inc @@ -2465,7 +2465,12 @@ function change_password ($dn, $password, $mode=0, $hash= "") $deactivated = FALSE; } - // Detect the encryption Method + /* Is ensure that clear passwords will stay clear */ + if($hash == "" && isset($attrs['userPassword'][0]) && !preg_match ("/^{([^}]+)}(.+)/", $attrs['userPassword'][0])){ + $hash = "clear"; + } + + // Detect the encryption Method if ( (isset($attrs['userPassword'][0]) && preg_match ("/^{([^}]+)}(.+)/", $attrs['userPassword'][0], $matches)) || $hash != ""){ /* Check for supported algorithm */ -- 2.30.2