3 # Operating system config form
5 require './usermin-lib.pl';
6 $access{'os'} || &error($text{'acl_ecannot'});
7 &ui_print_header(undef, $text{'os_title'}, "");
9 print $text{'os_desc3'},"<br>\n";
10 print $text{'os_desc2'},"<br>\n";
12 &get_usermin_config(\%uconfig);
13 &get_usermin_miniserv_config(\%miniserv);
15 print &ui_form_start("change_os.cgi", "post");
16 print &ui_table_start($text{'os_header'}, undef, 2, [ "width=30%" ]);
18 # OS according to Usermin
19 $osfile = "$miniserv{'root'}/os_list.txt";
20 print &ui_table_row($text{'os_usermin'},
21 &ui_select("type", $uconfig{'real_os_type'},
22 [ map { [ $_ ] } sort { $a cmp $b } &unique(map { $_->{'realtype'} }
23 &webmin::list_operating_systems($os_file)) ])." ".
24 &ui_textbox("version", $uconfig{'real_os_version'}, 10));
27 print &ui_table_row($text{'os_iusermin'},
28 &ui_select("itype", $uconfig{'os_type'},
29 [ map { [ $_ ] } sort { $a cmp $b } &unique(map { $_->{'type'} }
30 &webmin::list_operating_systems($os_file)) ])." ".
31 &ui_textbox("iversion", $uconfig{'os_version'}, 10));
34 %osinfo = &webmin::detect_operating_system($osfile);
35 if ($osinfo{'real_os_type'}) {
38 "$osinfo{'real_os_type'} $osinfo{'real_os_version'}\n".
39 ($osinfo{'os_type'} ne $uconfig{'os_type'} ||
40 $osinfo{'os_version'} ne $uconfig{'os_version'} ?
41 "<br>".&ui_checkbox("update", 1, $text{'os_update'}) :
45 print &ui_table_row($text{'os_detect'},
46 "<i>$text{'os_cannot'}</i>");
51 print &ui_table_row($text{'os_path'},
53 join("\n", split($path_separator, $uconfig{'path'})),
56 "syspath", 1, $text{'os_syspath'}, !$uconfig{'syspath'}));
59 if ($uconfig{'ld_env'}) {
60 print &ui_table_row($text{'os_ld_path'},
61 &ui_textarea("ld_path",
62 join("\n", split($path_separator, $uconfig{'ld_path'})),
67 print &ui_table_row($text{'os_perllib'},
68 &ui_textarea("perllib",
69 join("\n", split(":", $miniserv{'perllib'})), 3, 30));
71 # Global environment variables
72 $atable = &ui_columns_start([ $text{'os_name'},
75 foreach $e (keys %miniserv) {
76 if ($e =~ /^env_(\S+)$/ &&
77 $1 ne "WEBMIN_CONFIG" && $1 ne "WEBMIN_VAR") {
78 $atable .= &ui_columns_row([
79 &ui_textbox("name_$i", $1, 20),
80 &ui_textbox("value_$i", $miniserv{$e}, 30)
85 $atable .= &ui_columns_row([ &ui_textbox("name_$i", undef, 20),
86 &ui_textbox("value_$i", undef, 30) ]);
87 $atable .= &ui_columns_end();
88 print &ui_table_row($text{'os_envs'}, $atable);
90 print &ui_table_end();
91 print &ui_form_end([ [ "", $text{'save'} ] ]);
93 &ui_print_footer("", $text{'index_return'});