From: hickert Date: Thu, 25 Oct 2007 05:44:22 +0000 (+0000) Subject: Ensure that clear passwords will stay clear after they were changed- X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=f2482bbbe91d009629cd2dcfd0410b3a4516878b;p=gosa.git 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 --- 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 */