summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 3535265)
raw | patch | inline | side by side (parent: 3535265)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Thu, 27 Nov 2008 09:01:41 +0000 (09:01 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Thu, 27 Nov 2008 09:01:41 +0000 (09:01 +0000) |
-Keep entries locked
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@13053 594d385d-05f5-0310-b6e9-bd551577e9d8
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@13053 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-core/include/functions.inc | patch | blob | history |
index 991f63e3e427b5c3380927988f3f3f0d1cc080a5..efed58c996b1e672bdc6aba08d0635ea8500caf2 100644 (file)
$ldap->cat ($dn, array("shadowLastChange", "userPassword", "uid"));
$attrs = $ldap->fetch ();
- // Check if user account was deactivated, indicated by ! after } ... {crypt}!###
- if(isset($attrs['userPassword'][0]) && preg_match("/^[^\}]*+\}!/",$attrs['userPassword'][0])){
- $deactivated = TRUE;
- }else{
- $deactivated = FALSE;
- }
-
/* Is ensure that clear passwords will stay clear */
if($hash == "" && isset($attrs['userPassword'][0]) && !preg_match ("/^{([^}]+)}(.+)/", $attrs['userPassword'][0])){
$hash = "clear";
if($test instanceOf passwordMethod){
+ $deactivated = $test->is_locked($config,$dn);
+
/* Feed password backends with information */
$test->dn= $dn;
$test->attrs= $attrs;
$attrs= generate_smb_nt_hash($password);
}
- /* Read ! if user was deactivated */
- if($deactivated){
- $newpass = preg_replace("/(^[^\}]+\})(.*$)/","\\1!\\2",$newpass);
- }
-
$attrs['userPassword']= array();
$attrs['userPassword']= $newpass;
$ldap->modify($attrs);
+ /* Read ! if user was deactivated */
+ if($deactivated){
+ $test->lock_account($config,$dn);
+ }
+
new log("modify","users/passwordMethod",$dn,array_keys($attrs),$ldap->get_error());
if (!$ldap->success()) {