Code

- Corrected debian bugnumbers
[gosa.git] / 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 != ""){