mirror of
https://github.com/webmin/webmin.git
synced 2026-02-08 16:29:58 +00:00
120 lines
4.8 KiB
Perl
Executable File
120 lines
4.8 KiB
Perl
Executable File
#!/usr/local/bin/perl
|
|
# edit_session.cgi
|
|
# Edit session login options
|
|
|
|
require './webmin-lib.pl';
|
|
print "Set-Cookie: sessiontest=1; path=/\n";
|
|
ui_print_header(undef, $text{'session_title'}, "");
|
|
get_miniserv_config(\%miniserv);
|
|
|
|
print "$text{'session_desc1'}<p>\n";
|
|
print "$text{'session_desc2'}<p>\n";
|
|
|
|
print ui_form_start("change_session.cgi", "post");
|
|
print ui_table_start($text{'session_header'});
|
|
print "<tr $cb> <td nowrap>\n";
|
|
|
|
# Bad password delay
|
|
printf "<input type=radio name=passdelay value=0 %s> %s<br>\n",
|
|
$miniserv{'passdelay'} ? '' : 'checked', $text{'session_pdisable'};
|
|
printf "<input type=radio name=passdelay value=1 %s> %s<br>\n",
|
|
$miniserv{'passdelay'} ? 'checked' : '', $text{'session_penable'};
|
|
|
|
# Block bad hosts
|
|
printf " <input type=checkbox name=blockhost_on value=1 %s>\n",
|
|
$miniserv{'blockhost_failures'} ? "checked" : "";
|
|
print text('session_blockhost',
|
|
ui_textbox("blockhost_failures", $miniserv{'blockhost_failures'}, 4),
|
|
ui_textbox("blockhost_time", $miniserv{'blockhost_time'}, 4)),"<br>\n";
|
|
|
|
# Block bad users
|
|
printf " <input type=checkbox name=blockuser_on value=1 %s>\n",
|
|
$miniserv{'blockuser_failures'} ? "checked" : "";
|
|
print text('session_blockuser',
|
|
ui_textbox("blockuser_failures", $miniserv{'blockuser_failures'}, 4),
|
|
ui_textbox("blockuser_time", $miniserv{'blockuser_time'}, 4)),"<br>\n";
|
|
|
|
# Lock bad users
|
|
print " \n",
|
|
ui_checkbox("blocklock", 1, $text{'session_blocklock'},
|
|
$miniserv{'blocklock'}),"<br>\n";
|
|
|
|
# Log to syslog
|
|
eval "use Sys::Syslog qw(:DEFAULT setlogsock)";
|
|
if (!$@) {
|
|
print ui_checkbox('syslog', 1, $text{'session_syslog2'},
|
|
$miniserv{'syslog'});
|
|
}
|
|
else {
|
|
print ui_hidden('syslog', $miniserv{'syslog'});
|
|
}
|
|
print "<p>\n";
|
|
|
|
printf "<input type=radio name=session value=0 %s> %s<br>\n",
|
|
!$miniserv{'session'} ? "checked" : "", $text{'session_disable'};
|
|
printf "<input type=radio name=session value=1 %s> %s<br>\n",
|
|
$miniserv{'session'} ? "checked" : "", $text{'session_enable'};
|
|
printf " <input type=checkbox name=logouttime_on value=1 %s>\n",
|
|
$miniserv{'logouttime'} ? "checked" : "";
|
|
print text('session_logout',
|
|
"<input name=logouttime value='$miniserv{'logouttime'}' size=10>"),"<br>\n";
|
|
#printf " <input type=checkbox name=locking value=1 %s>\n",
|
|
# $gconfig{'locking'} ? "checked" : "";
|
|
#print "$text{'session_locking'}<br>\n";
|
|
print ' ', ui_checkbox('remember', 1, $text{'session_remember'},
|
|
!$gconfig{'noremember'}), "<br>\n";
|
|
print ' ', ui_checkbox('realname', 1,
|
|
$text{'session_realname'}, $gconfig{'realname'}), "<br>\n";
|
|
print ' ', ui_checkbox('utmp', 1, $text{'session_utmp'},
|
|
$miniserv{'utmp'}), "<br>\n";
|
|
printf " <input type=radio name=banner_def value=1 %s> %s\n",
|
|
$gconfig{'loginbanner'} ? "" : "checked", $text{'session_banner1'};
|
|
printf "<input type=radio name=banner_def value=0 %s> %s\n",
|
|
$gconfig{'loginbanner'} ? "checked" : "", $text{'session_banner0'};
|
|
printf "<input name=banner size=30 value='%s'> %s<br>\n",
|
|
$gconfig{'loginbanner'}, &file_chooser_button("banner");
|
|
print "<p>\n";
|
|
|
|
printf "<input type=radio name=localauth value=0 %s> %s<br>\n",
|
|
!$miniserv{'localauth'} ? "checked" : "", $text{'session_localoff'};
|
|
printf "<input type=radio name=localauth value=1 %s> %s<br>\n",
|
|
$miniserv{'localauth'} ? "checked" : "", $text{'session_localon'};
|
|
print "<p>\n";
|
|
|
|
printf "<input type=radio name=no_pam value=0 %s> %s<br>\n",
|
|
!$miniserv{'no_pam'} ? "checked" : "", $text{'session_pamon'};
|
|
printf "<input type=radio name=no_pam value=1 %s> %s<br>\n",
|
|
$miniserv{'no_pam'} ? "checked" : "", $text{'session_pamoff'};
|
|
print " ",&text('session_pfile',
|
|
"<input name=passwd_file size=20 value='$miniserv{'passwd_file'}'>",
|
|
"<input name=passwd_uindex size=2 value='$miniserv{'passwd_uindex'}'>",
|
|
"<input name=passwd_pindex size=2 value='$miniserv{'passwd_pindex'}'>"),
|
|
"<br>\n";
|
|
print " ",
|
|
ui_checkbox("pam_conv", 1, $text{'session_pamconv'},
|
|
$miniserv{'pam_conv'}),"<p>\n";
|
|
|
|
print "$text{'session_pmodedesc3'}<br>\n";
|
|
foreach $m (0 .. 2) {
|
|
printf "<input type=radio name=passwd_mode value=%d %s> %s\n",
|
|
$m, $miniserv{'passwd_mode'} == $m ? "checked" : "",
|
|
$text{'session_pmode'.$m};
|
|
print $m == 2 ? "<p>\n" : "<br>\n";
|
|
}
|
|
|
|
# Squid-style authentication program
|
|
print "$text{'session_extauth'} ",
|
|
"<input name=extauth size=40 value='$miniserv{'extauth'}'><p>\n";
|
|
|
|
# Password encryption format
|
|
printf "<input type=radio name=md5pass value=0 %s> %s<br>\n",
|
|
!$gconfig{'md5pass'} ? "checked" : "", $text{'session_md5off'};
|
|
printf "<input type=radio name=md5pass value=1 %s> %s<br>\n",
|
|
$gconfig{'md5pass'} ? "checked" : "", $text{'session_md5on'};
|
|
|
|
print ui_table_end();
|
|
print ui_form_end([ [ "save", $text{'save'} ] ]);
|
|
|
|
ui_print_footer("", $text{'index_return'});
|
|
|