#!/usr/local/bin/perl # edit_hostsentry.cgi # Display hostsentry options require './sentry-lib.pl'; &ui_print_header(undef, $text{'hostsentry_title'}, "", "hostsentry", 0, 0, undef, &help_search_link("hostsentry", "man", "doc")); if (!-r $config{'hostsentry'}) { print "

",&text('hostsentry_ecommand', "$config{'hostsentry'}", "@{[&get_webprefix()]}/config.cgi?$module_name"),"

\n"; &ui_print_footer("", $text{'index_return'}); exit; } # Show configuration form $conf = &get_hostsentry_config(); print "

\n"; print "\n"; print "\n"; print "
$text{'hostsentry_header'}
\n"; # Show wtmp file print "\n"; printf "\n", &find_value("WTMP_FILE", $conf), &file_chooser_button("wtmp"); # Show users to ignore $ign = &find_value("IGNORE_FILE", $conf); print "\n"; print "\n"; # Show configured modules $mods = &find_value("MODULE_FILE", $conf); open(MODS, $mods); while() { s/\r|\n//g; s/#.*$//; push(@mods, $_) if (/\S/); } close(MODS); @allmods = &list_hostsentry_modules($conf); print "\n"; print "\n"; # Show module-specific options print "
$text{'hostsentry_wtmp'} %s
$text{'hostsentry_ignore'}
$text{'hostsentry_mods'}\n"; for($i=0; $i<@allmods || $i<@mods; $i++) { print $i+1,". "; print "\n"; print "
\n" if ($i%2); print "  " if (!($i%2)); } print "
\n"; print "\n"; $basedir = &get_hostsentry_dir(); if (&indexof("moduleForeignDomain", @mods) >= 0) { print "\n"; } if (&indexof("moduleMultipleLogins", @mods) >= 0) { print "\n"; } print "\n"; print "
$text{'hostsentry_foreign'}
\n"; print "
$text{'hostsentry_multiple'}
\n"; print "
\n"; $pid = &get_hostsentry_pid(); if ($pid) { print "
\n"; } else { print "\n"; } # Show start/stop buttons print &ui_hr(); print "\n"; $cmd = &hostsentry_start_cmd(); if ($pid) { # Running .. offer to stop print "\n"; print "\n"; print "\n"; print "\n"; } else { # Not running .. offer to start print "\n"; print "\n"; print "\n"; } print "
$text{'hostsentry_stopdesc'}
",&text('hostsentry_startdesc', "$cmd"), "
\n"; &ui_print_footer("", $text{'index_return'});