Code

Ensure that clear passwords will stay clear after they were changed-
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 25 Oct 2007 05:44:22 +0000 (05:44 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 25 Oct 2007 05:44:22 +0000 (05:44 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@7648 594d385d-05f5-0310-b6e9-bd551577e9d8

include/functions.inc

index 8da921a7bba6c23c87ce6c7de905e140ce6a8969..423fb28e3659626511b236c2f878d65323333669 100644 (file)
@@ -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 */