From e6b2f3113b92252e1b86763c38c73f15d1ab4bb7 Mon Sep 17 00:00:00 2001 From: hickert Date: Wed, 24 Oct 2007 13:12:27 +0000 Subject: [PATCH] Ensure that clear passwords will stay clear git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.5@7641 594d385d-05f5-0310-b6e9-bd551577e9d8 --- include/class_password-methods.inc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/include/class_password-methods.inc b/include/class_password-methods.inc index 97546decf..8d9021a4c 100644 --- a/include/class_password-methods.inc +++ b/include/class_password-methods.inc @@ -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 != ""){ -- 2.30.2