summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 06db888)
raw | patch | inline | side by side (parent: 06db888)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 7 Jul 2010 10:57:14 +0000 (10:57 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 7 Jul 2010 10:57:14 +0000 (10:57 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@18948 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-plugins/samba/personal/samba/class_sambaAccount.inc | patch | blob | history | |
gosa-plugins/samba/personal/samba/samba3.tpl | patch | blob | history |
diff --git a/gosa-plugins/samba/personal/samba/class_sambaAccount.inc b/gosa-plugins/samba/personal/samba/class_sambaAccount.inc
index a867c7ed68cd11266814fc9c2d555b79697a56dd..9730f7dfd90716ca876a52b1fd8a629adb28def7 100644 (file)
var $no_expiry = FALSE;
var $multiple_sambaUserWorkstations = array();
+ var $enforce_passwordChange = FALSE;
+
function sambaAccount (&$config, $dn= NULL)
{
$this->mungedObject= new sambaMungedDial;
#TODO: use date format
$this->sambaKickoffTime= $this->sambaKickoffTime == 0?"":date('d.m.Y', $this->sambaKickoffTime);
$this->sambaPwdMustChange= $this->sambaPwdMustChange == 2147483647?"":date('d.m.Y', $this->sambaPwdMustChange);
+
+
+ // Enforce password change?
+ // ------------------------
+ // Check if we've the attribute 'sambaPwdLastSet' set and if its value is 0,
+ // in this case a password change is forced for this account.
+ $this->enforce_passwordChange = (isset($this->attrs['sambaPwdLastSet']) && $this->attrs['sambaPwdLastSet'][0] == '0');
}
function execute()
/* Show main page */
$smarty->assign("multiple_support",$this->multiple_support_active);
+ $smarty->assign('enforce_passwordChange', $this->enforce_passwordChange);
$display.= $smarty->fetch (get_template_path('samba3.tpl', TRUE, dirname(__FILE__)));
-
return ($display);
}
if (isset($_POST['sambaTab'])){
plugin::save_object();
+
+ $this->enforce_passwordChange = (isset($_POST['enforce_passwordChange']));
+
if(isset($_POST['display_information'])){
msg_dialog::display(_("Information"),
$this->get_samba_information(),
}
$this->attrs['objectClass']= $tmp;
+ // Enforce password change
+ if($this->enforce_passwordChange){
+ $this->attrs['sambaPwdLastSet'] = 0;
+ }else{
+ if ($this->sambaPwdLastSet != "0"){
+ $this->attrs['sambaPwdLastSet']= $this->sambaPwdLastSet;
+ } else {
+ $this->attrs['sambaPwdLastSet']= array();
+ }
+ }
+
/* Generate rid / primaryGroupId */
if (!isset($this->config->data['SERVERS']['SAMBA'][$this->sambaDomainName]['SID'])){
msg_dialog::display(_("Warning"), _("Undefined Samba SID detected. Please fix this problem manually!"), WARNING_DIALOG);
} else {
$this->attrs['sambaPwdMustChange']= array();
}
- /* Make sure not to save zero in sambaPwdLastset */
- if ($this->sambaPwdLastSet != "0"){
- $this->attrs['sambaPwdLastSet']= $this->sambaPwdLastSet;
- } else {
- $this->attrs['sambaPwdLastSet']= array();
- }
/* Account expiery */
if ($this->logon_time_set == "1"){
$this->attrs['sambaLogonTime']= $this->sambaLogonTime;
diff --git a/gosa-plugins/samba/personal/samba/samba3.tpl b/gosa-plugins/samba/personal/samba/samba3.tpl
index 9fd484f5b2439bae052dada3c01dd2fbd9aaf264..751e5aba8101d850a74329992e9fa11b41fc86c0 100644 (file)
<td style='width:50%; ' colspan="2">
+ <table>
+ <tr>
+ <td><input type='checkbox' value='1' name='enforce_passwordChange'
+ {if $enforce_passwordChange} checked {/if} id='enforce_passwordChange'>
+ <td><label for='enforce_passwordChange'>{t}Enforce password change{/t}</label></td>
+ </tr>
+ </table>
+
<div>
<div style='float:left;'>