Code

Ensure that clear passwords will stay clear
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 24 Oct 2007 13:12:27 +0000 (13:12 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 24 Oct 2007 13:12:27 +0000 (13:12 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.5@7641 594d385d-05f5-0310-b6e9-bd551577e9d8

include/class_password-methods.inc

index 97546decf7b12b173c6ef93a5af86dfd7c527eea..8d9021a4cf8d481fbbd91366dd12bc5787be349a 100644 (file)
@@ -124,6 +124,11 @@ function change_password ($dn, $password, $mode=0, $hash= "")
 #    $hash= "clear";
 #  }
 
+  /* 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 != ""){