Fail if password change prompt is checked but won't work
authorJamie Cameron <jcameron@webmin.com>
Tue, 25 Aug 2009 04:13:39 +0000 (21:13 -0700)
committerJamie Cameron <jcameron@webmin.com>
Tue, 25 Aug 2009 04:13:39 +0000 (21:13 -0700)
acl/lang/en
acl/save_user.cgi

index bb9ffb9..a1eeb25 100644 (file)
@@ -125,6 +125,7 @@ save_eminsize=Missing or non-numeric minimum password length
 save_edays=No days to allow selected
 save_ehours=Missing or invalid times to allow
 save_ehours2=Start time to allow must be before end
+save_etemp=The option to force a password change at next login cannot be used unless <a href='$1'>prompting users to enter new passwords</a> is enabled
 
 delete_err=Failed to delete user
 delete_eself=You cannot delete yourself
index d729ca3..7da0bfd 100755 (executable)
@@ -314,6 +314,11 @@ elsif ($in{'lock'} && $user{'pass'} !~ /^\!/ && $in{'pass_def'} <= 1) {
 
 # Check for force change
 $user{'temppass'} = $in{'temp'};
+if ($in{'temp'}) {
+       &get_miniserv_config(\%miniserv);
+       $miniserv{'passwd_mode'} == 2 ||
+               &error(&text('save_etemp', '../webmin/edit_session.cgi'));
+       }
 
 if ($in{'old'}) {
        # update user and all ACLs