3 # Show the current OS according to Webmin, and some environment settings
5 require './webmin-lib.pl';
6 &ui_print_header(undef, $text{'os_title'}, "");
7 &get_miniserv_config(\%miniserv);
9 print $text{'os_desc3'},"<br>\n";
10 print $text{'os_desc2'},"<p>\n";
12 print &ui_form_start("change_os.cgi", "post");
13 print &ui_table_start($text{'os_header'}, undef, 2, [ "width=30%" ]);
15 # OS according to Webmin
16 print &ui_table_row($text{'os_webmin'},
17 &ui_select("type", $gconfig{'real_os_type'},
18 [ map { [ $_ ] } sort { $a cmp $b } &unique(map { $_->{'realtype'} }
19 &list_operating_systems()) ])." ".
20 &ui_textbox("version", $gconfig{'real_os_version'}, 10));
23 print &ui_table_row($text{'os_iwebmin'},
24 &ui_select("itype", $gconfig{'os_type'},
25 [ map { [ $_ ] } sort { $a cmp $b } &unique(map { $_->{'type'} }
26 &list_operating_systems()) ])." ".
27 &ui_textbox("iversion", $gconfig{'os_version'}, 10));
30 %osinfo = &detect_operating_system();
31 if ($osinfo{'real_os_type'}) {
32 print &ui_table_row($text{'os_detect'},
33 "$osinfo{'real_os_type'} $osinfo{'real_os_version'}\n".
34 ($osinfo{'os_type'} ne $gconfig{'os_type'} ||
35 $osinfo{'os_version'} ne $gconfig{'os_version'} ?
36 "<br>".&ui_checkbox("update", 1, $text{'os_update'}) :
40 print &ui_table_row($text{'os_detect'},
41 "<i>$text{'os_cannot'}</i>");
47 print &ui_table_row($text{'os_path'},
49 join("\n", split($path_separator, $gconfig{'path'})),
51 &ui_checkbox("syspath", 1, $text{'os_syspath'}, !$gconfig{'syspath'}));
54 if ($gconfig{'ld_env'}) {
55 print &ui_table_row($text{'os_ld_path'},
56 &ui_textarea("ld_path",
57 join("\n", split($path_separator, $gconfig{'ld_path'})),
62 print &ui_table_row($text{'os_perllib'},
63 &ui_textarea("perllib",
64 join("\n", split(":", $miniserv{'perllib'})), 3, 30));
66 # Global environment variables
67 $atable = &ui_columns_start([ $text{'os_name'}, $text{'os_value'} ]);
69 foreach $e (keys %miniserv) {
70 if ($e =~ /^env_(\S+)$/ &&
71 $1 ne "WEBMIN_CONFIG" && $1 ne "WEBMIN_VAR") {
72 $atable .= &ui_columns_row([
73 &ui_textbox("name_$i", $1, 20),
74 &ui_textbox("value_$i", $miniserv{$e}, 30)
79 $atable .= &ui_columns_row([ &ui_textbox("name_$i", undef, 20),
80 &ui_textbox("value_$i", undef, 30) ]);
81 $atable .= &ui_columns_end();
82 print &ui_table_row($text{'os_envs'}, $atable);
84 print &ui_table_end();
85 print &ui_form_end([ [ "", $text{'save'} ] ]);
87 &ui_print_footer("", $text{'index_return'});