From: hickert Date: Wed, 24 Oct 2007 13:12:27 +0000 (+0000) Subject: Ensure that clear passwords will stay clear X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=e6b2f3113b92252e1b86763c38c73f15d1ab4bb7;p=gosa.git 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 --- 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 != ""){