2007-04-12 20:24:50 +00:00
|
|
|
#!/usr/local/bin/perl
|
|
|
|
# password_form.cgi
|
|
|
|
# Display the form that allows users to change their passwords at login time
|
|
|
|
|
2018-07-04 12:24:02 -07:00
|
|
|
BEGIN { push(@INC, "."); };
|
2009-03-01 07:49:52 +00:00
|
|
|
use WebminCore;
|
|
|
|
|
2011-05-09 11:48:17 -07:00
|
|
|
$pragma_no_cache = 1;
|
2007-04-12 20:24:50 +00:00
|
|
|
$ENV{'MINISERV_INTERNAL'} || die "Can only be called by miniserv.pl";
|
|
|
|
&init_config();
|
|
|
|
&ReadParse();
|
|
|
|
&header(undef, undef, undef, undef, 1, 1);
|
|
|
|
|
|
|
|
print "<center>\n";
|
2008-03-20 17:51:05 +00:00
|
|
|
if ($in{'expired'} == 2) {
|
|
|
|
print &ui_subheading($text{'password_temp'});
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
print &ui_subheading($text{'password_expired'});
|
|
|
|
}
|
|
|
|
|
|
|
|
# Start of the form
|
2007-04-12 20:24:50 +00:00
|
|
|
print "$text{'password_prefix'}\n";
|
2021-09-28 16:30:05 +03:00
|
|
|
print &ui_form_start("@{[&get_webprefix()]}/password_change.cgi", "post");
|
2008-03-20 17:51:05 +00:00
|
|
|
print &ui_hidden("user", $in{'user'});
|
|
|
|
print &ui_hidden("pam", $in{'pam'});
|
|
|
|
print &ui_hidden("expired", $in{'expired'});
|
2008-11-08 01:46:50 +00:00
|
|
|
print &ui_table_start($text{'password_header'}, undef, 2);
|
2008-03-20 17:51:05 +00:00
|
|
|
|
|
|
|
# Current username
|
|
|
|
print &ui_table_row($text{'password_user'},
|
|
|
|
&html_escape($in{'user'}));
|
|
|
|
|
|
|
|
# Old password
|
|
|
|
print &ui_table_row($text{'password_old'},
|
|
|
|
&ui_password("old", undef, 20));
|
|
|
|
|
|
|
|
# New password, twice
|
|
|
|
print &ui_table_row($text{'password_new1'},
|
|
|
|
&ui_password("new1", undef, 20));
|
|
|
|
print &ui_table_row($text{'password_new2'},
|
|
|
|
&ui_password("new2", undef, 20));
|
|
|
|
|
|
|
|
# End of form
|
|
|
|
print &ui_table_end();
|
|
|
|
print &ui_form_end([ [ undef, $text{'password_ok'} ] ]);
|
|
|
|
print "</center>\n";
|
2007-04-12 20:24:50 +00:00
|
|
|
print "$text{'password_postfix'}\n";
|
2008-03-20 17:51:05 +00:00
|
|
|
|
2007-04-12 20:24:50 +00:00
|
|
|
&footer();
|
|
|
|
|