$user{'warn'} = $line[10];
$user{'inactive'} = $line[11];
$user{'expire'} = $line[12];
- $user{'change'} = $line[2] eq '' ? '' :
+ &webmin_debug_log('ldap-batch',"going to set shadow last change");
+ if ($in{'forcechange'} == 1){
+ $user{'change'} = 0;
+ } else {
+ $user{'change'} = $line[2] eq '' ? '' :
int(time() / (60*60*24));
+ }
+ &webmin_debug_log('ldap-batch',"finished to set change");
@attrs = @line[13 .. $#line];
}
else {
$user{'inactive'}=$line[12]
if ($line[12] ne '');
$user{'expire'}=$line[13] if ($line[13] ne '');
- $user{'change'}=int(time() / (60*60*24))
- if ($line[3] ne '');
+ if ($in{'forcechange'} == 1){
+ $user{'change'} = 0;
+ } elsif ($line[3] ne ''){
+ $user{'change'}= int(time() / (60*60*24));
+ }
}
# Work out Samba properties
print &ui_table_row($text{'batch_crypt'},
&ui_yesno_radio("crypt", 0));
+#Force change password at next login
+print &ui_table_row($text{'uedit_forcechange'},
+ &ui_yesno_radio("forcechange", 0));
+
# Create Samba account
print &ui_table_row($text{'batch_samba'},
&ui_yesno_radio("samba", $config{'samba_def'} ? 1 : 0));
&ui_textbox("inactive", $in{'new'} ?$mconfig{'default_inactive'}
: $inactive, 5));
+ # Force password change at next login
+ print &ui_table_row(
+ $text{'uedit_forcechange'},
+ &ui_yesno_radio("forcechange", 0));
+
+
print &ui_table_end();
}
else {
push(@rprops, "shadowInactive");
}
- if ($in{'passmode'} == 3 ||
- $in{'passmode'} == 2 && $pass ne $oldpass) {
+ if ($in{'forcechange'} == 1){
+ if ($in{'passmode'} != 1) {
+ push(@props, "shadowLastChange", 0);
+ }
+ } else {
+ if ($in{'passmode'} == 3 ||
+ $in{'passmode'} == 2 && $pass ne $oldpass) {
+
$daynow = int(time() / (60*60*24));
push(@props, "shadowLastChange", $daynow);
- }
+ }
+
+ }
+
return 1;
}
else {