mirror of
https://github.com/webmin/webmin.git
synced 2025-07-20 16:48:46 +00:00
Force change at next login fixes
https://sourceforge.net/tracker/?func=detail&aid=3415467&group_id=17457&atid=367457
This commit is contained in:
@ -61,8 +61,14 @@ LINE: foreach $line (split(/[\r\n]+/, $data)) {
|
||||
$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 {
|
||||
@ -422,8 +428,11 @@ LINE: foreach $line (split(/[\r\n]+/, $data)) {
|
||||
$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
|
||||
|
@ -70,6 +70,10 @@ print &ui_table_row($text{'batch_delhome'},
|
||||
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));
|
||||
|
@ -259,6 +259,12 @@ if (&in_schema($schema, "shadowLastChange")) {
|
||||
&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();
|
||||
}
|
||||
|
||||
|
@ -863,11 +863,20 @@ if (&in_schema($schema, "shadowLastChange")) {
|
||||
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 {
|
||||
|
Reference in New Issue
Block a user