Handle hostnames with upper-case letters
[webmin.git] / sshd / edit_misc.cgi
1 #!/usr/local/bin/perl
2 # edit_misc.cgi
3 # Display all other SSHd options
4
5 require './sshd-lib.pl';
6 &ui_print_header(undef, $text{'misc_title'}, "", "misc");
7 $conf = &get_sshd_config();
8
9 print &ui_form_start("save_misc.cgi");
10 print &ui_table_start($text{'misc_header'}, "width=100%", 2);
11
12 # X11 port forwarding
13 $x11 = &find_value("X11Forwarding", $conf);
14 print &ui_table_row($text{'misc_x11'},
15         &ui_yesno_radio("x11", lc($x11) eq 'no' ? 0 :
16                                lc($x11) eq 'yes' ? 1 :
17                                $version{'type'} eq 'ssh' ? 1 : 0));
18
19 if ($version{'type'} ne 'ssh' || $version{'number'} < 2) {
20         # X display offset
21         $xoff = &find_value("X11DisplayOffset", $conf);
22         print &ui_table_row($text{'misc_xoff'},
23                 &ui_opt_textbox("xoff", $xoff, 6, $text{'default'}));
24
25         if ($version{'type'} eq 'ssh' || $version{'number'} >= 2) {
26                 # Path to xauth
27                 $xauth = &find_value("XAuthLocation", $conf);
28                 print &ui_table_row($text{'misc_xauth'},
29                         &ui_opt_textbox("xauth", $xauth, 60, $text{'default'}).
30                         " ".&file_chooser_button("xauth"));
31                 }
32         }
33
34 if ($version{'type'} eq 'ssh' && $version{'number'} < 2) {
35         # Default umask
36         $umask = &find_value("Umask", $conf);
37         print &ui_table_row($text{'misc_umask'},
38                 &ui_opt_textbox("umask", $umask, 4, $text{'misc_umask_def'}));
39         }
40
41 # Syslog facility
42 $syslog = &find_value("SyslogFacility", $conf);
43 print &ui_table_row($text{'misc_syslog'},
44         &ui_radio("syslog_def", $syslog ? 0 : 1,
45                   [ [ 1, $text{'default'} ],
46                     [ 0, &ui_select("syslog", uc($syslog),
47                                 [ &list_syslog_facilities() ], 1, 0,
48                                 $syslog ? 1 : 0) ] ]));
49
50 if ($version{'type'} eq 'openssh') {
51         # Logging level
52         $loglevel = &find_value("LogLevel", $conf);
53         print &ui_table_row($text{'misc_loglevel'},
54                 &ui_radio("loglevel_def", $loglevel ? 0 : 1,
55                         [ [ 1, $text{'default'} ],
56                           [ 0, &ui_select("loglevel", uc($loglevel),
57                                 [ &list_logging_levels() ], 1, 0,
58                                 $loglevel ? 1 : 0) ] ]));
59         }
60
61 if ($version{'type'} ne 'ssh' || $version{'number'} < 2) {
62         # Bits in key
63         $bits = &find_value("ServerKeyBits", $conf);
64         print &ui_table_row($text{'misc_bits'},
65                 &ui_opt_textbox("bits", $bits, 4, $text{'default'})." ".
66                 $text{'bits'});
67         }
68
69 if ($version{'type'} eq 'ssh') {
70         # Quite mode
71         $quiet = &find_value("QuietMode", $conf);
72         print &ui_table_row($text{'misc_quiet'},
73                 &ui_yesno_radio("quiet", lc($quiet) ne 'no'));
74         }
75
76 if ($version{'type'} ne 'ssh' || $version{'number'} < 2) {
77         # Interval between key re-generation
78         $regen = &find_value("KeyRegenerationInterval", $conf);
79         print &ui_table_row($text{'misc_regen'},
80                 &ui_opt_textbox("regen", $regen, 6, $text{'misc_regen_def'}).
81                 " ".$text{'secs'});
82         }
83
84 if ($version{'type'} eq 'ssh' && $version{'number'} < 2) {
85         # Detailed logging
86         $fascist = &find_value("FascistLogging", $conf);
87         print &ui_table_row($text{'misc_fascist'},
88                 &ui_yesno_radio("fascist", lc($fascist) eq 'yes'));
89         }
90
91 if ($version{'type'} eq 'openssh' && $version{'number'} >= 2) {
92         # PID file
93         $pid = &find_value("PidFile", $conf);
94         print &ui_table_row($text{'misc_pid'},
95                 &ui_opt_textbox("pid", $pid, 60, $text{'default'}));
96         }
97
98 if ($version{'type'} eq 'openssh' && $version{'number'} >= 3.2) {
99         # Use separate users
100         $separ = &find_value("UsePrivilegeSeparation", $conf);
101         print &ui_table_row($text{'misc_separ'},
102                 &ui_yesno_radio("separ", lc($separ) ne 'no'));
103         }
104
105 print &ui_table_end();
106 print &ui_form_end([ [ undef, $text{'save'} ] ]);
107
108 &ui_print_footer("", $text{'index_return'});
109