#!/usr/local/bin/perl # edit_access.cgi # Display access control SSHd options require './sshd-lib.pl'; &ui_print_header(undef, $text{'access_title'}, "", "access"); $conf = &get_sshd_config(); print "
\n"; print "\n"; print "\n"; print "
$text{'access_header'}
\n"; if ($version{'type'} eq 'ssh') { &scmd(1); @allowh = &find_value("AllowHosts", $conf); print "\n", join(" ", @allowh); &ecmd(); &scmd(1); @denyh = &find_value("DenyHosts", $conf); print "\n", join(" ", @denyh); &ecmd(); &scmd(1); print "\n"; &ecmd(); } $commas = $version{'type'} eq 'ssh' && $version{'number'} >= 3.2; &scmd(1); @allowu = &find_value("AllowUsers", $conf); $allowu = $commas ? join(" ", split(/,/, $allowu[0])) : join(" ", @allowu); print "\n", $allowu, &user_chooser_button("allowu", 1); &ecmd(); &scmd(1); @allowg = &find_value("AllowGroups", $conf); $allowg = $commas ? join(" ", split(/,/, $allowg[0])) : join(" ", @allowg); print "\n", $allowg, &group_chooser_button("allowg", 1); &ecmd(); &scmd(1); @denyu = &find_value("DenyUsers", $conf); $denyu = $commas ? join(" ", split(/,/, $denyu[0])) : join(" ", @denyu); print "\n", $denyu, &user_chooser_button("denyu", 1); &ecmd(); &scmd(1); @denyg = &find_value("DenyGroups", $conf); $denyg = $commas ? join(" ", split(/,/, $denyg[0])) : join(" ", @denyg); print "\n", $denyg, &group_chooser_button("denyg", 1); &ecmd(); if ($version{'type'} eq 'ssh' && $version{'number'} < 2) { &scmd(1); print "\n"; &ecmd(); &scmd(); $silent = &find_value("SilentDeny", $conf); print "\n", lc($silent) eq 'yes' ? "" : "checked", $text{'no'}; &ecmd(); } print "
$text{'access_allowh'} \n"; printf " %s\n", @allowh ? "" : "checked", $text{'access_all'}; printf "\n", @allowh ? "checked" : ""; printf "$text{'access_denyh'} \n"; printf " %s\n", @denyh ? "" : "checked", $text{'access_none'}; printf "\n", @denyh ? "checked" : ""; printf "
$text{'access_allowu'} \n"; printf " %s\n", $allowu ? "" : "checked", $text{'access_all'}; printf "\n", $allowu ? "checked" : ""; printf " %s$text{'access_allowg'} \n"; printf " %s\n", $allowg ? "" : "checked", $text{'access_all'}; printf "\n", $allowg ? "checked" : ""; printf " %s$text{'access_denyu'} \n"; printf " %s\n", $denyu ? "" : "checked", $text{'access_none'}; printf "\n", $denyu ? "checked" : ""; printf " %s$text{'access_denyg'} \n"; printf " %s\n", $denyg ? "" : "checked", $text{'access_none'}; printf "\n", $denyg ? "checked" : ""; printf " %s
$text{'access_silent'} \n"; printf " %s\n", lc($silent) eq 'yes' ? "checked" : "", $text{'yes'}; printf " %s
\n"; print "
\n"; &ui_print_footer("", $text{'index_return'});