summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 1aa7ee0)
raw | patch | inline | side by side (parent: 1aa7ee0)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Fri, 2 Jul 2010 08:48:17 +0000 (08:48 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Fri, 2 Jul 2010 08:48:17 +0000 (08:48 +0000) |
-Added ability to enforce a password change on the next login.
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@18916 594d385d-05f5-0310-b6e9-bd551577e9d8
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@18916 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-core/plugins/admin/users/class_userManagement.inc | patch | blob | history | |
gosa-core/plugins/admin/users/password.tpl | patch | blob | history |
diff --git a/gosa-core/plugins/admin/users/class_userManagement.inc b/gosa-core/plugins/admin/users/class_userManagement.inc
index e7191e26d631bbd06faee3663cb886d8a5104e53..74e9c392bad56c6a04bf5181459f3c47ab2b9b31 100644 (file)
// Generate new proposal
$this->refreshProposal();
$this->proposalSelected = ($this->proposal != "");
- $smarty->assign("proposal" , $this->proposal);
- $smarty->assign("proposalEnabled" , $this->proposalEnabled);
- $smarty->assign("proposalSelected" , $this->proposalSelected);
-
$this->dn = array_pop($this->pwd_change_queue);
// Check if we are able to enforce a password change
$this->passwordChangeForceable =
in_array('sambaAccount', $attrs['objectClass']) ||
in_array('posixAccount', $attrs['objectClass']);
-
$smarty->assign("passwordChangeForceable" , $this->passwordChangeForceable);
$smarty->assign("enforcePasswordChange" , $this->enforcePasswordChange);
+ // Assign proposal variables
+ $smarty->assign("proposal" , $this->proposal);
+ $smarty->assign("proposalEnabled" , $this->proposalEnabled);
+ $smarty->assign("proposalSelected" , $this->proposalSelected);
+
set_object_info($this->dn);
return ($smarty->fetch(get_template_path('password.tpl', TRUE)));
}
if ($this->config->get_cfg_value("core","passwordHook") != ""){
exec($this->config->get_cfg_value("core","passwordHook")." ".$username." ".$new_password, $resarr);
}
+
+ // The user has to change his password on next login
+ // - We are going to update samba and posix attributes here, to enforce
+ // such a password change.
+ if($this->passwordChangeForceable && $this->enforcePasswordChange){
+
+ // Check if we are able to enforce a password change
+ $ldap = $this->config->get_ldap_link();
+ $ldap->cd($this->config->current['BASE']);
+ $ldap->cat($this->dn);
+ $attrs = $ldap->fetch();
+ $samba = in_array('sambaSamAccount', $attrs['objectClass']);
+ $posix = in_array('posixAccount', $attrs['objectClass']);
+
+ // Update the posix shadow flag...
+ if($posix){
+ $posixAccount = new posixAccount($this->config, $this->dn);
+ $posixAccount->is_modified=TRUE;
+ $posixAccount->activate_shadowExpire=1;
+ $posixAccount->shadowExpire = date('d.m.Y', time() - (1 * 24 * 60 *60));
+ $posixAccount->save();
+ }
+
+ // Update the samba kickoff flag...
+ if($samba){
+ $sambaAccount = new sambaAccount($this->config, $this->dn);
+ $sambaAccount->is_modified=TRUE;
+ $sambaAccount->kickoff_time_set = "1";
+ $sambaAccount->sambaKickoffTime= date('d.m.Y', time() - (1 * 24 * 60 *60));
+ $sambaAccount->save();
+ }
+ }
+
new log("modify","users/".get_class($this),$this->dn,array(),"Password has been changed");
$this->dn ="";
diff --git a/gosa-core/plugins/admin/users/password.tpl b/gosa-core/plugins/admin/users/password.tpl
index a48f89fef10239c1ab62bb60e25dfb44d469bae2..3de11949dbb7a1076750d8577b6ad505f8ca1990 100644 (file)
{if $passwordChangeForceable}
<hr>
- <input type='checkbox' name='enforcePasswordChange' value='1'
- {if $enforcePasswordChange} checked {/if}> {t}Enforce password change on next login.{/t}
+ <input type='checkbox' name='enforcePasswordChange' value='1' id='enforcePasswordChange'
+ {if $enforcePasswordChange} checked {/if}>
+ <LABEL for='enforcePasswordChange'>{t}Enforce password change on next login.{/t}</LABEL>
{/if}
<br>