mirror of
https://github.com/webmin/webmin.git
synced 2025-07-20 16:48:46 +00:00
Rename Webmin to WebminUI, to avoid clashes with webmin on OSX https://www.virtualmin.com/node/39987
This commit is contained in:
@ -78,7 +78,7 @@ else {
|
||||
"authentic-theme", "firewalld", "filemin",
|
||||
);
|
||||
}
|
||||
@dirlist = ( "Webmin" );
|
||||
@dirlist = ( "WebminUI" );
|
||||
|
||||
if (-d "/usr/local/webadmin") {
|
||||
chdir("/usr/local/webadmin");
|
||||
|
@ -5,7 +5,7 @@ require './zones-lib.pl';
|
||||
do 'forms-lib.pl';
|
||||
use Socket;
|
||||
&ReadParse();
|
||||
$p = new Webmin::Page(undef, $text{'create_title'}, "create");
|
||||
$p = new WebminUI::Page(undef, $text{'create_title'}, "create");
|
||||
$p->add_form(&get_create_form(\%in));
|
||||
$p->add_footer("index.cgi", $text{'index_return'});
|
||||
$p->print();
|
||||
|
@ -92,9 +92,9 @@ if ($in{'cfg'}) {
|
||||
}
|
||||
}
|
||||
|
||||
$p = new Webmin::Page(undef, $text{'create_title'});
|
||||
$p = new WebminUI::Page(undef, $text{'create_title'});
|
||||
|
||||
$d1 = new Webmin::DynamicHTML(\&execute_create, undef, $text{'create_adding'});
|
||||
$d1 = new WebminUI::DynamicHTML(\&execute_create, undef, $text{'create_adding'});
|
||||
$p->add_form($d1);
|
||||
sub execute_create
|
||||
{
|
||||
@ -104,7 +104,7 @@ $p->add_message_after($d1, $text{'create_done'});
|
||||
|
||||
if (!$in{'address_def'}) {
|
||||
# Set initial network address
|
||||
$d2 = new Webmin::DynamicHTML(\&execute_address, undef, $text{'create_addingnet'});
|
||||
$d2 = new WebminUI::DynamicHTML(\&execute_address, undef, $text{'create_addingnet'});
|
||||
$p->add_form($d2);
|
||||
sub execute_address
|
||||
{
|
||||
@ -119,7 +119,7 @@ if (!$in{'address_def'}) {
|
||||
# Add or remove extra package directories
|
||||
# add for sparse root zone and remove for whole root zone
|
||||
if ($in{'inherit'} eq '0' ) {
|
||||
$d3 = new Webmin::DynamicHTML(\&remove_pkgs, undef, $text{'create_removingpkgs'});
|
||||
$d3 = new WebminUI::DynamicHTML(\&remove_pkgs, undef, $text{'create_removingpkgs'});
|
||||
$p->add_form($d3);
|
||||
sub remove_pkgs
|
||||
{
|
||||
@ -130,7 +130,7 @@ if ($in{'inherit'} eq '0' ) {
|
||||
}
|
||||
else {
|
||||
if (@pkgs) {
|
||||
$d3 = new Webmin::DynamicHTML(\&execute_pkgs, undef, $text{'create_addingpkgs'});
|
||||
$d3 = new WebminUI::DynamicHTML(\&execute_pkgs, undef, $text{'create_addingpkgs'});
|
||||
$p->add_form($d3);
|
||||
sub execute_pkgs
|
||||
{
|
||||
@ -146,7 +146,7 @@ if ($in{'inherit'} eq '0' ) {
|
||||
|
||||
#set the brand
|
||||
if ($in{'brand'}) {
|
||||
$d4 = new Webmin::DynamicHTML(\&create_brand,undef, $text{'create_brandmsg'});
|
||||
$d4 = new WebminUI::DynamicHTML(\&create_brand,undef, $text{'create_brandmsg'});
|
||||
$p->add_form($d4);
|
||||
|
||||
sub create_brand
|
||||
@ -158,14 +158,14 @@ if ($in{'brand'}) {
|
||||
|
||||
if ($in{'install'}) {
|
||||
# Install software
|
||||
$d5 = new Webmin::DynamicText(\&execute_install);
|
||||
$d5 = new WebminUI::DynamicText(\&execute_install);
|
||||
$p->add_form($d5);
|
||||
$d5->set_message($text{'create_installing'});
|
||||
$d5->set_wait(1);
|
||||
sub execute_install
|
||||
{
|
||||
local $ok = &callback_zone_command($zinfo, "install",
|
||||
\&Webmin::DynamicText::add_line, [ $d5 ]);
|
||||
\&WebminUI::DynamicText::add_line, [ $d5 ]);
|
||||
if ($ok) {
|
||||
$p->add_message_after($d5, $text{'create_done'});
|
||||
}
|
||||
@ -194,7 +194,7 @@ else {
|
||||
|
||||
if ($in{'install'} && $in{'webmin'}) {
|
||||
# Create a Webmin setup script and run it
|
||||
$d6 = new Webmin::DynamicText(\&execute_webmin);
|
||||
$d6 = new WebminUI::DynamicText(\&execute_webmin);
|
||||
$p->add_form($d6);
|
||||
$d6->set_message($text{'create_webmining'});
|
||||
$d6->set_wait(1);
|
||||
@ -208,7 +208,7 @@ if ($in{'install'} && $in{'webmin'}) {
|
||||
}
|
||||
else {
|
||||
$ex = &run_in_zone_callback($zinfo, "/tmp/install-webmin",
|
||||
\&Webmin::DynamicText::add_line, [ $d ]);
|
||||
\&WebminUI::DynamicText::add_line, [ $d ]);
|
||||
if (!$ex) {
|
||||
$p->add_message($text{'create_done'});
|
||||
&post_webmin_install($zinfo);
|
||||
|
@ -11,7 +11,7 @@ if (!$in{'new'}) {
|
||||
($attr) = grep { $_->{'name'} eq $in{'old'} } @{$zinfo->{'attr'}};
|
||||
$attr || &error($text{'attr_egone'});
|
||||
}
|
||||
$p = new Webmin::Page(&zone_title($in{'zone'}),
|
||||
$p = new WebminUI::Page(&zone_title($in{'zone'}),
|
||||
$in{'new'} ? $text{'attr_title1'} : $text{'attr_title2'},
|
||||
"attr");
|
||||
$p->add_form(&get_attr_form(\%in, $zinfo, $attr));
|
||||
|
@ -11,7 +11,7 @@ if (!$in{'new'}) {
|
||||
($fs) = grep { $_->{'dir'} eq $in{'old'} } @{$zinfo->{'fs'}};
|
||||
$fs || &error($text{'fs_egone'});
|
||||
}
|
||||
$p = new Webmin::Page(&zone_title($in{'zone'}),
|
||||
$p = new WebminUI::Page(&zone_title($in{'zone'}),
|
||||
$in{'new'} ? $text{'fs_title1'} : $text{'fs_title2'}, "fs");
|
||||
$type = $in{'type'} || $fs->{'type'};
|
||||
$p->add_form(&get_fs_form(\%in, $zinfo, $fs, $type));
|
||||
|
@ -7,7 +7,7 @@ do 'forms-lib.pl';
|
||||
$zinfo = &get_zone($in{'zone'});
|
||||
$zinfo || &error($text{'edit_egone'});
|
||||
|
||||
$p = new Webmin::Page(&zone_title($in{'zone'}),
|
||||
$p = new WebminUI::Page(&zone_title($in{'zone'}),
|
||||
$in{'new'} ? $text{'net_title1'} : $text{'net_title2'},
|
||||
"net");
|
||||
if (!$in{'new'}) {
|
||||
|
@ -13,7 +13,7 @@ if (!$in{'new'}) {
|
||||
@{$zinfo->{'inherit-pkg-dir'}};
|
||||
$pkg || &error($text{'pkg_egone'});
|
||||
}
|
||||
$p = new Webmin::Page(&zone_title($in{'zone'}),
|
||||
$p = new WebminUI::Page(&zone_title($in{'zone'}),
|
||||
$in{'new'} ? $text{'pkg_title1'} : $text{'pkg_title2'},
|
||||
"pkg");
|
||||
$p->add_form(&get_pkg_form(\%in, $zinfo, $pkg));
|
||||
|
@ -11,7 +11,7 @@ if (!$in{'new'}) {
|
||||
($rctl) = grep { $_->{'name'} eq $in{'old'} } @{$zinfo->{'rctl'}};
|
||||
$rctl || &error($text{'rctl_egone'});
|
||||
}
|
||||
$p = new Webmin::Page(&zone_title($in{'zone'}),
|
||||
$p = new WebminUI::Page(&zone_title($in{'zone'}),
|
||||
$in{'new'} ? $text{'rctl_title1'} : $text{'rctl_title2'},
|
||||
"rctl");
|
||||
$p->add_form(&get_rctl_form(\%in, $zinfo, $rctl));
|
||||
|
@ -7,7 +7,7 @@ do 'forms-lib.pl';
|
||||
$zinfo = &get_zone($in{'zone'});
|
||||
$zinfo || &error($text{'edit_egone'});
|
||||
|
||||
$p = new Webmin::Page(&zone_title($in{'zone'}), $text{'edit_title'}, "edit");
|
||||
$p = new WebminUI::Page(&zone_title($in{'zone'}), $text{'edit_title'}, "edit");
|
||||
|
||||
# Show general information
|
||||
$gform = &get_zone_form(\%in, $zinfo);
|
||||
@ -15,10 +15,10 @@ $p->add_form($gform);
|
||||
|
||||
# Show network interfaces
|
||||
$p->add_separator();
|
||||
$nform = new Webmin::Form();
|
||||
$nform = new WebminUI::Form();
|
||||
$p->add_form($nform);
|
||||
$nform->set_input(\%in);
|
||||
$ntable = new Webmin::Table([ $text{'edit_netaddress'},
|
||||
$ntable = new WebminUI::Table([ $text{'edit_netaddress'},
|
||||
$text{'edit_netname'},
|
||||
$text{'edit_netmask'},
|
||||
$text{'edit_netbroad'} ], "100%", "ntable");
|
||||
@ -38,10 +38,10 @@ $ntable->add_link("edit_net.cgi?zone=$in{'zone'}&new=1", $text{'edit_netadd'});
|
||||
|
||||
# Show package directories
|
||||
$p->add_separator();
|
||||
$pform = new Webmin::Form();
|
||||
$pform = new WebminUI::Form();
|
||||
$p->add_form($pform);
|
||||
$pform->set_input(\%in);
|
||||
$ptable = new Webmin::Table([ $text{'edit_pkgdir'} ], "100%", "ptable");
|
||||
$ptable = new WebminUI::Table([ $text{'edit_pkgdir'} ], "100%", "ptable");
|
||||
$pform->add_section($ptable);
|
||||
$ptable->set_heading($text{'edit_pkg'});
|
||||
foreach $pkg (@{$zinfo->{'inherit-pkg-dir'}}) {
|
||||
@ -63,10 +63,10 @@ else {
|
||||
|
||||
# Show other filesystems
|
||||
$p->add_separator();
|
||||
$fform = new Webmin::Form("edit_fs.cgi");
|
||||
$fform = new WebminUI::Form("edit_fs.cgi");
|
||||
$p->add_form($fform);
|
||||
$fform->set_input(\%in);
|
||||
$ftable = new Webmin::Table([ $text{'edit_fsdir'},
|
||||
$ftable = new WebminUI::Table([ $text{'edit_fsdir'},
|
||||
$text{'edit_fsspecial'},
|
||||
$text{'edit_fstype'},
|
||||
$text{'edit_fsmounted'} ], "100%", "ftable");
|
||||
@ -82,18 +82,18 @@ foreach $fs (@{$zinfo->{'fs'}}) {
|
||||
]);
|
||||
}
|
||||
$ftable->set_emptymsg($text{'edit_fsnone'});
|
||||
$ftable->add_input(new Webmin::Submit($text{'edit_fsadd'}));
|
||||
$ftable->add_input(new Webmin::Select("type", "ufs",
|
||||
$ftable->add_input(new WebminUI::Submit($text{'edit_fsadd'}));
|
||||
$ftable->add_input(new WebminUI::Select("type", "ufs",
|
||||
[ map { [ $_, &mount::fstype_name($_) ] } &list_filesystems() ]));
|
||||
$fform->add_hidden("new", 1);
|
||||
$fform->add_hidden("zone", $in{'zone'});
|
||||
|
||||
# Show resource controls
|
||||
$p->add_separator();
|
||||
$rform = new Webmin::Form();
|
||||
$rform = new WebminUI::Form();
|
||||
$p->add_form($rform);
|
||||
$rform->set_input(\%in);
|
||||
$rtable = new Webmin::Table([ $text{'edit_rctlname'},
|
||||
$rtable = new WebminUI::Table([ $text{'edit_rctlname'},
|
||||
$text{'edit_rctlpriv'},
|
||||
$text{'edit_rctllimit'},
|
||||
$text{'edit_rctlaction'}, ], "100%", "rtable");
|
||||
@ -121,10 +121,10 @@ $rtable->add_link("edit_rctl.cgi?zone=$in{'zone'}&new=1",
|
||||
|
||||
# Show generic attributes
|
||||
$p->add_separator();
|
||||
$gform = new Webmin::Form();
|
||||
$gform = new WebminUI::Form();
|
||||
$p->add_form($gform);
|
||||
$gform->set_input(\%in);
|
||||
$gtable = new Webmin::Table([ $text{'edit_attrname'},
|
||||
$gtable = new WebminUI::Table([ $text{'edit_attrname'},
|
||||
$text{'edit_attrtype'},
|
||||
$text{'edit_attrvalue'}, ], "100%", "gtable");
|
||||
$gform->add_section($gtable);
|
||||
|
@ -1,4 +1,4 @@
|
||||
use Webmin::All;
|
||||
use WebminUI::All;
|
||||
use Socket;
|
||||
|
||||
# get_zone_form(&in, &zinfo)
|
||||
@ -6,16 +6,16 @@ use Socket;
|
||||
sub get_zone_form
|
||||
{
|
||||
local ($in, $zinfo) = @_;
|
||||
local $form = new Webmin::Form("save_zone.cgi");
|
||||
local $form = new WebminUI::Form("save_zone.cgi");
|
||||
$form->set_input($in);
|
||||
$form->add_hidden("zone", $zinfo->{'name'});
|
||||
local $section = new Webmin::Section($text{'edit_common'}, 4, undef, "100%");
|
||||
local $section = new WebminUI::Section($text{'edit_common'}, 4, undef, "100%");
|
||||
$form->add_section($section);
|
||||
|
||||
$section->add_row($text{'edit_name'}, "<tt>$in{'zone'}</tt>");
|
||||
$section->add_row($text{'edit_status'}, &nice_status($zinfo->{'status'}));
|
||||
$section->add_row($text{'edit_zonepath'}, "<tt>$zinfo->{'zonepath'}</tt>");
|
||||
local $auto = new Webmin::Select("autoboot", $zinfo->{'autoboot'},
|
||||
local $auto = new WebminUI::Select("autoboot", $zinfo->{'autoboot'},
|
||||
[ [ "true", $text{'yes'} ],
|
||||
[ "false", $text{'no'} ] ]);
|
||||
$section->add_input($text{'edit_autoboot'}, $auto);
|
||||
@ -24,20 +24,20 @@ $section->add_input($text{'edit_pool'}, $pool);
|
||||
$section->add_row($text{'edit_brand'}, "$zinfo->{'brand'}");
|
||||
|
||||
local @actions = &zone_status_actions($zinfo, 1);
|
||||
$form->add_button(new Webmin::Submit($text{'save'}, "save"));
|
||||
$form->add_button(new WebminUI::Submit($text{'save'}, "save"));
|
||||
$form->add_button_spacer();
|
||||
foreach my $a (@actions) {
|
||||
$form->add_button(new Webmin::Submit($a->[1], $a->[0]));
|
||||
$form->add_button(new WebminUI::Submit($a->[1], $a->[0]));
|
||||
}
|
||||
$form->add_button_spacer() if (@actions);
|
||||
$form->add_button(new Webmin::Submit($text{'edit_delete'}, "delete"));
|
||||
$form->add_button(new WebminUI::Submit($text{'edit_delete'}, "delete"));
|
||||
return $form;
|
||||
}
|
||||
|
||||
sub pool_object
|
||||
{
|
||||
local ($name, $value) = @_;
|
||||
local $rv = new Webmin::OptTextbox($name, $value, 10, $text{'pool_none'});
|
||||
local $rv = new WebminUI::OptTextbox($name, $value, 10, $text{'pool_none'});
|
||||
$rv->set_validation_regexp('^\S+$', $text{'save_epool'});
|
||||
return $rv;
|
||||
}
|
||||
@ -46,7 +46,7 @@ return $rv;
|
||||
sub get_confirm_page
|
||||
{
|
||||
local ($in, $action, $zinfo, $list) = @_;
|
||||
local $p = new Webmin::ConfirmPage(&zone_title($zinfo->{'name'}),
|
||||
local $p = new WebminUI::ConfirmPage(&zone_title($zinfo->{'name'}),
|
||||
$text{$action.'_title'},
|
||||
&text($action.'_rusure', "<tt>$zinfo->{'name'}</tt>"),
|
||||
"save_zone.cgi", $in, $text{'edit_'.$action}, $text{'ui_cancel'});
|
||||
@ -64,9 +64,9 @@ return $p;
|
||||
sub get_execute_page
|
||||
{
|
||||
local ($action, $zinfo, $list, $args) = @_;
|
||||
local $p = new Webmin::Page(&zone_title($zinfo->{'name'}),
|
||||
local $p = new WebminUI::Page(&zone_title($zinfo->{'name'}),
|
||||
$text{$action.'_title'});
|
||||
local $d = new Webmin::DynamicWait(\&execute_action, [ $action, $zinfo, $args ]);
|
||||
local $d = new WebminUI::DynamicWait(\&execute_action, [ $action, $zinfo, $args ]);
|
||||
$p->add_form($d);
|
||||
$d->set_message($text{$action.'_doing'});
|
||||
$d->set_wait(1);
|
||||
@ -123,7 +123,7 @@ sub get_net_form
|
||||
{
|
||||
local ($in, $zinfo, $net) = @_;
|
||||
local ($new, $active, $address, $netmask);
|
||||
local $form = new Webmin::Form("save_net.cgi", "post");
|
||||
local $form = new WebminUI::Form("save_net.cgi", "post");
|
||||
$form->add_hidden("zone", $zinfo->{'name'});
|
||||
if ($net->{'address'}) {
|
||||
$active = &get_active_interface($net);
|
||||
@ -136,10 +136,10 @@ else {
|
||||
$form->add_hidden("new", 1);
|
||||
}
|
||||
$form->set_input($in);
|
||||
local $section = new Webmin::Section($text{'net_header'}, 2);
|
||||
local $section = new WebminUI::Section($text{'net_header'}, 2);
|
||||
$form->add_section($section);
|
||||
|
||||
local $ainput = new Webmin::Textbox("address", $address, 20);
|
||||
local $ainput = new WebminUI::Textbox("address", $address, 20);
|
||||
$ainput->set_mandatory(1);
|
||||
$ainput->set_validation_func(\&validate_address);
|
||||
$section->add_input($text{'net_address'}, $ainput);
|
||||
@ -147,7 +147,7 @@ $section->add_input($text{'net_address'}, $ainput);
|
||||
local $pinput = &physical_object("physical", $net->{'physical'});
|
||||
$section->add_input($text{'net_physical'}, $pinput);
|
||||
|
||||
local $ninput = new Webmin::OptTextbox("netmask", $netmask, 20,
|
||||
local $ninput = new WebminUI::OptTextbox("netmask", $netmask, 20,
|
||||
$text{'default'});
|
||||
$ninput->set_validation_func(\&validate_netmask);
|
||||
$section->add_input($text{'net_netmask'}, $ninput);
|
||||
@ -158,11 +158,11 @@ if ($active) {
|
||||
}
|
||||
|
||||
if ($new) {
|
||||
$form->add_button(new Webmin::Submit($text{'create'}, "create"));
|
||||
$form->add_button(new WebminUI::Submit($text{'create'}, "create"));
|
||||
}
|
||||
else {
|
||||
$form->add_button(new Webmin::Submit($text{'save'}, "save"));
|
||||
$form->add_button(new Webmin::Submit($text{'delete'}, "delete"));
|
||||
$form->add_button(new WebminUI::Submit($text{'save'}, "save"));
|
||||
$form->add_button(new WebminUI::Submit($text{'delete'}, "delete"));
|
||||
}
|
||||
return $form;
|
||||
}
|
||||
@ -172,7 +172,7 @@ return $form;
|
||||
sub physical_object
|
||||
{
|
||||
local ($name, $value) = @_;
|
||||
return new Webmin::Select($name, $value,
|
||||
return new WebminUI::Select($name, $value,
|
||||
[ map { [ $_->{'name'} ] } grep { $_->{'virtual'} eq '' }
|
||||
&net::active_interfaces() ], 0, $value ? 1 : 0);
|
||||
}
|
||||
@ -192,7 +192,7 @@ sub get_pkg_form
|
||||
{
|
||||
local ($in, $zinfo, $pkg) = @_;
|
||||
local ($new);
|
||||
local $form = new Webmin::Form("save_pkg.cgi", "post");
|
||||
local $form = new WebminUI::Form("save_pkg.cgi", "post");
|
||||
$form->set_input($in);
|
||||
$form->add_hidden("zone", $zinfo->{'name'});
|
||||
if ($pkg->{'dir'}) {
|
||||
@ -202,20 +202,20 @@ else {
|
||||
$new = 1;
|
||||
$form->add_hidden("new", 1);
|
||||
}
|
||||
local $section = new Webmin::Section($text{'pkg_header'}, 2);
|
||||
local $section = new WebminUI::Section($text{'pkg_header'}, 2);
|
||||
$form->add_section($section);
|
||||
|
||||
local $dinput = new Webmin::File("dir", $pkg->{'dir'}, 50, 1);
|
||||
local $dinput = new WebminUI::File("dir", $pkg->{'dir'}, 50, 1);
|
||||
$dinput->set_mandatory(1);
|
||||
$dinput->set_validation_func(\&validate_dir);
|
||||
$section->add_input($text{'pkg_dir'}, $dinput);
|
||||
|
||||
if ($new) {
|
||||
$form->add_button(new Webmin::Submit($text{'create'}, "create"));
|
||||
$form->add_button(new WebminUI::Submit($text{'create'}, "create"));
|
||||
}
|
||||
else {
|
||||
$form->add_button(new Webmin::Submit($text{'save'}, "save"));
|
||||
$form->add_button(new Webmin::Submit($text{'delete'}, "delete"));
|
||||
$form->add_button(new WebminUI::Submit($text{'save'}, "save"));
|
||||
$form->add_button(new WebminUI::Submit($text{'delete'}, "delete"));
|
||||
}
|
||||
return $form;
|
||||
}
|
||||
@ -230,7 +230,7 @@ sub get_attr_form
|
||||
{
|
||||
local ($in, $zinfo, $pkg) = @_;
|
||||
local ($new);
|
||||
local $form = new Webmin::Form("save_attr.cgi", "post");
|
||||
local $form = new WebminUI::Form("save_attr.cgi", "post");
|
||||
$form->set_input($in);
|
||||
$form->add_hidden("zone", $zinfo->{'name'});
|
||||
if ($attr->{'name'}) {
|
||||
@ -240,30 +240,30 @@ else {
|
||||
$new = 1;
|
||||
$form->add_hidden("new", 1);
|
||||
}
|
||||
local $section = new Webmin::Section($text{'attr_header'}, 2);
|
||||
local $section = new WebminUI::Section($text{'attr_header'}, 2);
|
||||
$form->add_section($section);
|
||||
|
||||
local $ninput = new Webmin::Textbox("name", $attr->{'name'}, 30);
|
||||
local $ninput = new WebminUI::Textbox("name", $attr->{'name'}, 30);
|
||||
$ninput->set_mandatory(1);
|
||||
$ninput->set_validation_regexp('^\S+$', $text{'attr_ename'});
|
||||
$section->add_input($text{'attr_name'}, $ninput);
|
||||
|
||||
local $tinput = new Webmin::Select("type", $attr->{'type'} || "string",
|
||||
local $tinput = new WebminUI::Select("type", $attr->{'type'} || "string",
|
||||
[ map { [ $_, $text{'attr_'.$_} ] }
|
||||
&list_attr_types() ], 0, 1);
|
||||
$section->add_input($text{'attr_type'}, $tinput);
|
||||
|
||||
local $vinput = new Webmin::Textbox("value", $attr->{'value'}, 30);
|
||||
local $vinput = new WebminUI::Textbox("value", $attr->{'value'}, 30);
|
||||
$vinput->set_validation_func(\&validate_value);
|
||||
$vinput->set_mandatory(1);
|
||||
$section->add_input($text{'attr_value'}, $vinput);
|
||||
|
||||
if ($new) {
|
||||
$form->add_button(new Webmin::Submit($text{'create'}, "create"));
|
||||
$form->add_button(new WebminUI::Submit($text{'create'}, "create"));
|
||||
}
|
||||
else {
|
||||
$form->add_button(new Webmin::Submit($text{'save'}, "save"));
|
||||
$form->add_button(new Webmin::Submit($text{'delete'}, "delete"));
|
||||
$form->add_button(new WebminUI::Submit($text{'save'}, "save"));
|
||||
$form->add_button(new WebminUI::Submit($text{'delete'}, "delete"));
|
||||
}
|
||||
return $form;
|
||||
}
|
||||
@ -289,7 +289,7 @@ sub get_fs_form
|
||||
{
|
||||
local ($in, $zinfo, $fs, $type) = @_;
|
||||
local ($new, $mount);
|
||||
local $form = new Webmin::Form("save_fs.cgi", "post");
|
||||
local $form = new WebminUI::Form("save_fs.cgi", "post");
|
||||
$form->set_input($in);
|
||||
$form->add_hidden("zone", $zinfo->{'name'});
|
||||
if ($fs->{'dir'}) {
|
||||
@ -301,7 +301,7 @@ else {
|
||||
$form->add_hidden("new", 1);
|
||||
$form->add_hidden("type", $type);
|
||||
}
|
||||
local $section = new Webmin::Section($text{'fs_header'}, 2);
|
||||
local $section = new WebminUI::Section($text{'fs_header'}, 2);
|
||||
$form->add_section($section);
|
||||
|
||||
$section->add_row($text{'fs_type'},
|
||||
@ -325,7 +325,7 @@ else {
|
||||
1 : 0));
|
||||
}
|
||||
|
||||
local $dinput = new Webmin::File("dir", $fs->{'dir'}, 50);
|
||||
local $dinput = new WebminUI::File("dir", $fs->{'dir'}, 50);
|
||||
$dinput->set_mandatory(1);
|
||||
$dinput->set_validation_func(\&validate_fsdir);
|
||||
$section->add_input($text{'fs_dir'}, $dinput);
|
||||
@ -350,23 +350,23 @@ if (&indexof($type, &mount::list_fstypes()) >= 0) {
|
||||
}
|
||||
else {
|
||||
# Un-supported, so show just text fields
|
||||
local $sinput = new Webmin::Textbox("special", $fs->{'special'}, 40);
|
||||
local $sinput = new WebminUI::Textbox("special", $fs->{'special'}, 40);
|
||||
$sinput->set_mandatory(1);
|
||||
$sinput->set_validation_func(\&validate_special);
|
||||
$section->add_input($text{'fs_special'}, $sinput);
|
||||
|
||||
local $oinput = new Webmin::Textbox("options", $fs->{'options'}, 40);
|
||||
local $oinput = new WebminUI::Textbox("options", $fs->{'options'}, 40);
|
||||
$oinput->set_mandatory(1);
|
||||
$oinput->set_validation_func(\&validate_options);
|
||||
$section->add_input($text{'fs_options'}, $oinput);
|
||||
}
|
||||
|
||||
if ($new) {
|
||||
$form->add_button(new Webmin::Submit($text{'create'}, "create"));
|
||||
$form->add_button(new WebminUI::Submit($text{'create'}, "create"));
|
||||
}
|
||||
else {
|
||||
$form->add_button(new Webmin::Submit($text{'save'}, "save"));
|
||||
$form->add_button(new Webmin::Submit($text{'delete'}, "delete"));
|
||||
$form->add_button(new WebminUI::Submit($text{'save'}, "save"));
|
||||
$form->add_button(new WebminUI::Submit($text{'delete'}, "delete"));
|
||||
}
|
||||
return $form;
|
||||
}
|
||||
@ -391,7 +391,7 @@ sub get_rctl_form
|
||||
{
|
||||
local ($in, $zinfo, $rctl) = @_;
|
||||
local ($new, $mount);
|
||||
local $form = new Webmin::Form("save_rctl.cgi", "post");
|
||||
local $form = new WebminUI::Form("save_rctl.cgi", "post");
|
||||
$form->set_input($in);
|
||||
$form->add_hidden("zone", $zinfo->{'name'});
|
||||
if ($rctl->{'name'}) {
|
||||
@ -401,25 +401,25 @@ else {
|
||||
$new = 1;
|
||||
$form->add_hidden("new", 1);
|
||||
}
|
||||
local $section = new Webmin::Section($text{'rctl_header'}, 2);
|
||||
local $section = new WebminUI::Section($text{'rctl_header'}, 2);
|
||||
$form->add_section($section);
|
||||
|
||||
local $ninput = new Webmin::Select("name", $rctl->{'name'},
|
||||
local $ninput = new WebminUI::Select("name", $rctl->{'name'},
|
||||
[ map { [ $_ ] } grep { /^zone\./ } &list_rctls() ],
|
||||
0, $in{'new'} ? 0 : 1);
|
||||
$section->add_input($text{'rctl_name'}, $ninput);
|
||||
|
||||
local $table = new Webmin::InputTable([ $text{'rctl_priv'},
|
||||
local $table = new WebminUI::InputTable([ $text{'rctl_priv'},
|
||||
$text{'rctl_limit'},
|
||||
$text{'rctl_action'} ]);
|
||||
$form->add_section($table);
|
||||
local $pinput = new Webmin::Select("priv", undef,
|
||||
local $pinput = new WebminUI::Select("priv", undef,
|
||||
[ [ "", " " ],
|
||||
[ "privileged", $text{'rctl_privileged'} ] ]);
|
||||
local $linput = new Webmin::Textbox("limit", undef, 20);
|
||||
local $linput = new WebminUI::Textbox("limit", undef, 20);
|
||||
$linput->set_mandatory(1);
|
||||
$linput->set_validation_func(\&validate_limit);
|
||||
local $ainput = new Webmin::Select("action", undef,
|
||||
local $ainput = new WebminUI::Select("action", undef,
|
||||
[ [ "none", $text{'rctl_none'} ],
|
||||
[ "deny", $text{'rctl_deny'} ] ]);
|
||||
$table->set_inputs([ $pinput, $linput, $ainput ]);
|
||||
@ -434,11 +434,11 @@ $table->set_all_sortable(0);
|
||||
$table->set_control(0);
|
||||
|
||||
if ($new) {
|
||||
$form->add_button(new Webmin::Submit($text{'create'}, "create"));
|
||||
$form->add_button(new WebminUI::Submit($text{'create'}, "create"));
|
||||
}
|
||||
else {
|
||||
$form->add_button(new Webmin::Submit($text{'save'}, "save"));
|
||||
$form->add_button(new Webmin::Submit($text{'delete'}, "delete"));
|
||||
$form->add_button(new WebminUI::Submit($text{'save'}, "save"));
|
||||
$form->add_button(new WebminUI::Submit($text{'delete'}, "delete"));
|
||||
}
|
||||
return $form;
|
||||
}
|
||||
@ -451,27 +451,27 @@ return $_[0] =~ /^\d+$/ ? undef : $text{'rctl_elimit'};
|
||||
sub get_create_form
|
||||
{
|
||||
local ($in) = @_;
|
||||
local $form = new Webmin::Form("create_zone.cgi", "post");
|
||||
local $form = new WebminUI::Form("create_zone.cgi", "post");
|
||||
$form->set_input($in);
|
||||
local $section = new Webmin::Section($text{'create_header'}, 2);
|
||||
local $section = new WebminUI::Section($text{'create_header'}, 2);
|
||||
$form->add_section($section);
|
||||
&foreign_require("time", "time-lib.pl");
|
||||
|
||||
local $name = new Webmin::Textbox("name", undef, 20);
|
||||
local $name = new WebminUI::Textbox("name", undef, 20);
|
||||
$name->set_mandatory(1);
|
||||
$name->set_validation_func(\&validate_zone_name);
|
||||
$section->add_input($text{'edit_name'}, $name);
|
||||
|
||||
local $path = new Webmin::OptTextbox("path", undef, 30,
|
||||
local $path = new WebminUI::OptTextbox("path", undef, 30,
|
||||
&text('create_auto', $config{'base_dir'}),
|
||||
$text{'create_sel'});
|
||||
$path->set_validation_func(\&validate_zone_path);
|
||||
$section->add_input($text{'create_path'}, $path);
|
||||
|
||||
local $brand = new Webmin::Select("brand",undef, [ &list_brands() ], 0, 0, $value ? 1 : 0);
|
||||
local $brand = new WebminUI::Select("brand",undef, [ &list_brands() ], 0, 0, $value ? 1 : 0);
|
||||
$section->add_input($text{'create_brand'}, $brand);
|
||||
|
||||
local $address = new Webmin::OptTextbox("address", undef, 20,
|
||||
local $address = new WebminUI::OptTextbox("address", undef, 20,
|
||||
$text{'create_noaddress'});
|
||||
$address->set_validation_func(\&validate_address);
|
||||
$section->add_input($text{'create_address'}, $address);
|
||||
@ -479,50 +479,50 @@ $section->add_input($text{'create_address'}, $address);
|
||||
local $physical = &physical_object("physical", &get_default_physical());
|
||||
$section->add_input($text{'net_physical'}, $physical);
|
||||
|
||||
local $install = new Webmin::Radios("install", 0, [ [ 1, $text{'yes'} ],
|
||||
local $install = new WebminUI::Radios("install", 0, [ [ 1, $text{'yes'} ],
|
||||
[ 0, $text{'no'} ] ]);
|
||||
$section->add_input($text{'create_install'}, $install);
|
||||
|
||||
local $webmin = new Webmin::Radios("webmin", 0, [ [ 1, $text{'yes'} ],
|
||||
local $webmin = new WebminUI::Radios("webmin", 0, [ [ 1, $text{'yes'} ],
|
||||
[ 0, $text{'no'} ] ]);
|
||||
$section->add_input($text{'create_webmin'}, $webmin);
|
||||
|
||||
local $inherit = new Webmin::Radios("inherit", 1, [ [ 1, $text{'pkg_inherit_yes'} ],
|
||||
local $inherit = new WebminUI::Radios("inherit", 1, [ [ 1, $text{'pkg_inherit_yes'} ],
|
||||
[ 0, $text{'pkg_inherit_no'} ] ]);
|
||||
$section->add_input($text{'pkg_inherit'}, $inherit);
|
||||
|
||||
|
||||
local $pkgs = new Webmin::Multiline("pkgs", undef, 5, 50);
|
||||
local $pkgs = new WebminUI::Multiline("pkgs", undef, 5, 50);
|
||||
$section->add_input($text{'create_pkgs'}, $pkgs);
|
||||
|
||||
$section->add_separator();
|
||||
|
||||
local $cfg = new Webmin::Radios("cfg", 1, [ [ 1, $text{'create_cfgyes'} ],
|
||||
local $cfg = new WebminUI::Radios("cfg", 1, [ [ 1, $text{'create_cfgyes'} ],
|
||||
[ 0, $text{'create_cfgno'} ] ]);
|
||||
$section->add_input($text{'create_cfg'}, $cfg);
|
||||
|
||||
local $hostname = new Webmin::OptTextbox("hostname", undef, 20,
|
||||
local $hostname = new WebminUI::OptTextbox("hostname", undef, 20,
|
||||
$text{'create_samehost'});
|
||||
$hostname->set_validation_func(\&validate_zone_hostname);
|
||||
$section->add_input($text{'create_hostname'}, $hostname);
|
||||
|
||||
local $root = new Webmin::OptTextbox("root", undef, 20,
|
||||
local $root = new WebminUI::OptTextbox("root", undef, 20,
|
||||
$text{'create_same'});
|
||||
$section->add_input($text{'create_root'}, $root);
|
||||
|
||||
local $currtz = &time::get_current_timezone();
|
||||
local $timezone = new Webmin::OptTextbox("timezone", undef, 25,
|
||||
local $timezone = new WebminUI::OptTextbox("timezone", undef, 25,
|
||||
&text('create_same2', $currtz));
|
||||
$timezone->set_validation_func(\&validate_zone_timezone);
|
||||
$section->add_input($text{'create_timezone'}, $timezone);
|
||||
|
||||
local $currlc = &get_global_locale();
|
||||
local $locale = new Webmin::OptTextbox("locale", undef, 25,
|
||||
local $locale = new WebminUI::OptTextbox("locale", undef, 25,
|
||||
&text('create_same2', $currlc));
|
||||
$locale->set_validation_func(\&validate_zone_locale);
|
||||
$section->add_input($text{'create_locale'}, $locale);
|
||||
|
||||
local $terminal = new Webmin::OptTextbox("terminal", undef, 25,
|
||||
local $terminal = new WebminUI::OptTextbox("terminal", undef, 25,
|
||||
$text{'create_vt100'});
|
||||
$terminal->set_validation_func(\&validate_zone_terminal);
|
||||
$section->add_input($text{'create_terminal'}, $terminal);
|
||||
@ -530,7 +530,7 @@ $section->add_input($text{'create_terminal'}, $terminal);
|
||||
local $dns = &net::get_dns_config();
|
||||
local ($resolv) = grep { $_ ne "files" } split(/\s+/, $dns->{'order'});
|
||||
$resolv ||= "none";
|
||||
local $rinput = new Webmin::Radios("resolv", $resolv,
|
||||
local $rinput = new WebminUI::Radios("resolv", $resolv,
|
||||
[ [ "none", $text{'create_none'} ],
|
||||
[ "dns", $text{'create_dns'} ],
|
||||
[ "nis", $text{'create_nis'} ],
|
||||
@ -540,7 +540,7 @@ $section->add_input($text{'create_name'}, $rinput);
|
||||
local $domain = $resolv eq "dns" ? $dns->{'domain'}->[0] :
|
||||
$resolv eq "nis" || $resolv eq "nis+" ? &net::get_domainname()
|
||||
: undef;
|
||||
local $dinput = new Webmin::Textbox("domain", $domain, 20);
|
||||
local $dinput = new WebminUI::Textbox("domain", $domain, 20);
|
||||
$dinput->set_validation_func(\&validate_zone_domain);
|
||||
$dinput->set_disable_code("form.resolv[0].checked");
|
||||
$section->add_input($text{'create_domain'}, $dinput);
|
||||
@ -555,7 +555,7 @@ elsif ($resolv eq "nis" || $resolv eq "nis+") {
|
||||
$server = `ypwhich`;
|
||||
chop($server);
|
||||
}
|
||||
local $server = new Webmin::Textbox("server", $server, 40);
|
||||
local $server = new WebminUI::Textbox("server", $server, 40);
|
||||
$server->set_validation_func(\&validate_zone_server);
|
||||
$server->set_disable_code("form.resolv[0].checked");
|
||||
$section->add_input($text{'create_server'}, $server);
|
||||
@ -567,12 +567,12 @@ if (!$router) {
|
||||
$router = $r->{'gateway'} if ($r->{'dest'} eq '0.0.0.0');
|
||||
}
|
||||
}
|
||||
local $rinput = new Webmin::OptTextbox("router", $router, 20,
|
||||
local $rinput = new WebminUI::OptTextbox("router", $router, 20,
|
||||
$text{'create_none'});
|
||||
$rinput->set_validation_func(\&validate_zone_router);
|
||||
$section->add_input($text{'create_router'}, $rinput);
|
||||
|
||||
$form->add_button(new Webmin::Submit($text{'create_ok'}));
|
||||
$form->add_button(new WebminUI::Submit($text{'create_ok'}));
|
||||
return $form;
|
||||
}
|
||||
|
||||
|
@ -4,7 +4,7 @@
|
||||
require './zones-lib.pl';
|
||||
do 'forms-lib.pl';
|
||||
|
||||
$p = new Webmin::Page(undef, $module_info{'desc'}, "intro", 1, 1);
|
||||
$p = new WebminUI::Page(undef, $module_info{'desc'}, "intro", 1, 1);
|
||||
$zn = &get_current_zone();
|
||||
if (!&has_command("zoneadm")) {
|
||||
$p->set_errormsg(&text('index_ecmd', "<tt>zoneadm</tt>"));
|
||||
@ -16,10 +16,10 @@ else {
|
||||
# Create the table
|
||||
&ReadParse();
|
||||
@zones = sort { $a->{'name'} cmp $b->{'name'} } &list_zones();
|
||||
$form = new Webmin::Form();
|
||||
$form = new WebminUI::Form();
|
||||
$form->set_input(\%in);
|
||||
$p->add_form($form);
|
||||
$table = new Webmin::Table([ $text{'list_name'},
|
||||
$table = new WebminUI::Table([ $text{'list_name'},
|
||||
$text{'list_id'},
|
||||
$text{'list_path'},
|
||||
$text{'list_status'},
|
||||
@ -28,7 +28,7 @@ else {
|
||||
foreach $z (@zones) {
|
||||
local ($a, @actions);
|
||||
foreach $a (&zone_status_actions($z)) {
|
||||
push(@actions, new Webmin::TableAction("save_zone.cgi", $a->[1], [ [ "zone", $z->{'name'} ], [ $a->[0], 1 ], [ "list", 1 ] ]));
|
||||
push(@actions, new WebminUI::TableAction("save_zone.cgi", $a->[1], [ [ "zone", $z->{'name'} ], [ $a->[0], 1 ], [ "list", 1 ] ]));
|
||||
}
|
||||
$table->add_row([
|
||||
&ui_link("edit_zone.cgi?zone=$z->{'name'}",$z->{'name'}),
|
||||
|
@ -46,8 +46,8 @@ elsif ($in{'halt'}) {
|
||||
}
|
||||
elsif ($in{'install'}) {
|
||||
# Install system now
|
||||
$p = new Webmin::Page(&zone_title($zinfo->{'name'}), $text{'install_title'});
|
||||
$d = new Webmin::DynamicText(\&execute_install);
|
||||
$p = new WebminUI::Page(&zone_title($zinfo->{'name'}), $text{'install_title'});
|
||||
$d = new WebminUI::DynamicText(\&execute_install);
|
||||
$p->add_form($d);
|
||||
$d->set_message($text{'install_doing'});
|
||||
$d->set_wait(1);
|
||||
@ -94,8 +94,8 @@ elsif ($in{'uninstall'}) {
|
||||
}
|
||||
elsif ($in{'wupgrade'} || $in{'winstall'}) {
|
||||
# Install Webmin now
|
||||
$p = new Webmin::Page(&zone_title($in{'zone'}), $text{'webmin_title'});
|
||||
$d = new Webmin::DynamicText(\&execute_webmin);
|
||||
$p = new WebminUI::Page(&zone_title($in{'zone'}), $text{'webmin_title'});
|
||||
$d = new WebminUI::DynamicText(\&execute_webmin);
|
||||
$p->add_form($d);
|
||||
$d->set_message($text{'create_webmining'});
|
||||
$d->set_wait(1);
|
||||
@ -124,7 +124,7 @@ sub execute_install
|
||||
{
|
||||
my ($d) = @_;
|
||||
local $ok = &callback_zone_command($zinfo, "install",
|
||||
\&Webmin::DynamicText::add_line, [ $d ]);
|
||||
\&WebminUI::DynamicText::add_line, [ $d ]);
|
||||
if ($ok) {
|
||||
$p->add_message($text{'create_done'});
|
||||
$sysidcfg = &zone_sysidcfg_file($in{'zone'});
|
||||
@ -153,7 +153,7 @@ if ($err) {
|
||||
}
|
||||
else {
|
||||
$ex = &run_in_zone_callback($zinfo, "/tmp/install-webmin",
|
||||
\&Webmin::DynamicText::add_line, [ $d ]);
|
||||
\&WebminUI::DynamicText::add_line, [ $d ]);
|
||||
if (!$ex) {
|
||||
$p->add_message($text{'create_done'});
|
||||
&post_webmin_install($zinfo);
|
||||
|
Reference in New Issue
Block a user