3 # Display sshd option categories
5 require './sshd-lib.pl';
7 # Check if config file exists
8 if (!-r $config{'sshd_config'}) {
9 &ui_print_header(undef, $text{'index_title'}, "", "intro", 1, 1);
10 print &text('index_econfig', "<tt>$config{'sshd_config'}</tt>",
11 "$gconfig{'webprefix'}/config.cgi?$module_name"),"<p>\n";
12 &ui_print_footer("/", $text{"index"});
16 # Check if sshd exists
17 if (!&has_command($config{'sshd_path'})) {
18 &ui_print_header(undef, $text{'index_title'}, "", "intro", 1, 1);
19 print &text('index_esshd', "<tt>$config{'sshd_path'}</tt>",
20 "$gconfig{'webprefix'}/config.cgi?$module_name"),"<p>\n";
21 &ui_print_footer("/", $text{"index"});
25 # Check if sshd is the right version
26 %version = &get_sshd_version();
29 &ui_print_header(undef, $text{'index_title'}, "", "intro", 1, 1);
30 print &text('index_eversion', "<tt>$config{'sshd_path'}</tt>",
31 "$gconfig{'webprefix'}/config.cgi?$module_name",
32 "<tt>$config{'sshd_path'} -h</tt>",
33 "<pre>$out</pre>"),"<p>\n";
34 &ui_print_footer("/", $text{"index"});
37 &write_file("$module_config_directory/version", \%version);
39 &ui_print_header(undef, $text{'index_title'}, "", "intro", 1, 1, 0,
40 &help_search_link("ssh", "man", "doc", "google"), undef, undef,
41 &text('index_version', $version{'full'}));
43 # Display icons for options
44 foreach $i ('users', 'net', 'access', 'misc') {
45 push(@links, "edit_$i.cgi");
46 push(@titles, $text{$i.'_title'});
47 push(@icons, "images/$i.gif");
49 if (-r $config{'client_config'}) {
50 push(@links, "list_hosts.cgi");
51 push(@titles, $text{'hosts_title'});
52 push(@icons, "images/hosts.gif");
54 push(@links, "edit_sync.cgi");
55 push(@titles, $text{'sync_title'});
56 push(@icons, "images/sync.gif");
58 push(@links, "edit_keys.cgi");
59 push(@titles, $text{'keys_title'});
60 push(@icons, "images/keys.gif");
62 push(@links, "edit_manual.cgi");
63 push(@titles, $text{'manual_title'});
64 push(@icons, "images/manual.gif");
65 &icons_table(\@links, \@titles, \@icons, 4);
67 # Check if sshd is running
68 $pid = &get_sshd_pid();
70 print &ui_buttons_start();
72 # Running .. offer to apply changes and stop
73 print &ui_buttons_row("apply.cgi",
75 $config{'restart_cmd'} ?
76 &text('index_applymsg2', "<tt>$config{'restart_cmd'}</tt>") :
77 $text{'index_applymsg'});
79 print &ui_buttons_row("stop.cgi",
80 $text{'index_stop'}, $text{'index_stopmsg'});
83 # Not running .. offer to start
84 print &ui_buttons_row("start.cgi", $text{'index_start'},
85 $text{'index_startmsg'});
87 print &ui_buttons_end();
89 &ui_print_footer("/", $text{"index"});