* Updated System->host_name to work locally and on remote targets.
* Renamed all 'hostname' instances to 'host_name' to standardize on a spelling throughout the program.
* Removed use of and dependency on 'hostname'.
Signed-off-by: Digimer <digimer@alteeve.ca>
ThisistheDRBDtargetnode's (connection) ID that we'reenablingdual-primarywith.Ifthisisnotpassed,butC<<drbd::status::<local_short_hostname>::resource::<resource>::connection::<peer_name>::peer-node-id>>isset,itwillbeused.Otherwisethisargumentisrequired.
ThisistheDRBDtargetnode's (connection) ID that we'reenablingdual-primarywith.Ifthisisnotpassed,butC<<drbd::status::<local_short_host_name>::resource::<resource>::connection::<peer_name>::peer-node-id>>isset,itwillbeused.Otherwisethisargumentisrequired.
# $anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 1, list => { say_dg_iface => $say_dg_iface }});
# Hostname
my $say_default_hostname = $anvil->data->{cgi}{prefix}{value}."-striker0".$anvil->data->{cgi}{sequence}{value}.".".$anvil->data->{cgi}{domain}{value};
my $hostname_class = $anvil->data->{cgi}{hostname}{alert} ? "input_alert" : "input_clear";
my $say_hostname = $anvil->Template->get({file => "main.html", name => "input_text_form", variables => {
name => "hostname",
id => "hostname",
my $say_default_host_name = $anvil->data->{cgi}{prefix}{value}."-striker0".$anvil->data->{cgi}{sequence}{value}.".".$anvil->data->{cgi}{domain}{value};
my $host_name_class = $anvil->data->{cgi}{host_name}{alert} ? "input_alert" : "input_clear";
my $say_host_name = $anvil->Template->get({file => "main.html", name => "input_text_form", variables => {
name => "host_name",
id => "host_name",
field => "#!string!striker_0016!#",
description => "#!string!striker_0017!#",
value => defined $anvil->data->{cgi}{hostname}{value} ? $anvil->data->{cgi}{hostname}{value} : $say_default_hostname,
value => defined $anvil->data->{cgi}{host_name}{value} ? $anvil->data->{cgi}{host_name}{value} : $say_default_host_name,
default_value => "",
class => $hostname_class,
class => $host_name_class,
extra => "",
}});
@ -2327,7 +2327,7 @@ ORDER BY
striker_password_form => $say_striker_password,
gateway_form => $say_gateway,
dns_form => $say_dns,
hostname_form => $say_hostname,
host_name_form => $say_host_name,
}});
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 3, list => { step2_body => $step2_body }});
@ -2343,10 +2343,10 @@ sub sanity_check_step2
my $sane = 1;
# Do we have a host name, striker user and password?
if (not $anvil->Validate->form_field({name => "hostname", type => "domain_name"}))
if (not $anvil->Validate->form_field({name => "host_name", type => "domain_name"}))
@ -40,8 +40,8 @@ Author: Madison Kelly <mkelly@alteeve.ca>
<keyname="message_0013">#!free!#</key>
<keyname="message_0014">One or more files on disk have changed. Exiting to reload.</key>
<keyname="message_0015">The reconfigure of the network has begun.</key>
<keyname="message_0016">The hostname: [#!variable!hostname!#] has been set.</key>
<keyname="message_0017">Failed to set the hostname: [#!variable!hostname!#]! The hostname is currently [#!variable!bad_hostname!#]. This is probably a program error.</key>
<keyname="message_0016">The hostname: [#!variable!host_name!#] has been set.</key>
<keyname="message_0017">Failed to set the hostname: [#!variable!host_name!#]! The hostname is currently [#!variable!bad_host_name!#]. This is probably a program error.</key>
<keyname="message_0018">What would you like the new password to be?</key>
<keyname="message_0019">Please enter the password again to confirm.</key>
<keyname="message_0020">About to update the local passwords (shell users, database and web interface).</key>
my $bcn_count = 1; # TODO: This should be coming from the form, even though it's only '1' for now.
my $sn_count = 0; # TODO: This should be coming from the form, even though it's always '0' for Strikers.
my $ifn_count = $anvil->data->{variables}{form}{config_step1}{ifn_count}{value};
my $new_hostname = defined $anvil->data->{variables}{form}{config_step2}{hostname}{value} ? $anvil->data->{variables}{form}{config_step2}{hostname}{value} : $prefix."-striker".sprintf("%02d", $sequence).".".$domain;
my $pretty_hostname = $organization." - Striker ".sprintf("%02d", $sequence);
my $new_host_name = defined $anvil->data->{variables}{form}{config_step2}{host_name}{value} ? $anvil->data->{variables}{form}{config_step2}{host_name}{value} : $prefix."-striker".sprintf("%02d", $sequence).".".$domain;
my $pretty_host_name = $organization." - Striker ".sprintf("%02d", $sequence);
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 3, secure => 0, list => {