# 0 - The cookies were read, the account was validated and the user's details were loaded.
# 0 - The cookies were read, the account was validated and the user's details were loaded.
# 1 - No cookie was found or read. The user needs to log in
# 1 - No cookie was found or read. The user needs to log in
# 2 - There was a problem reading the user's UUID (it wasn't found in the database), so the
# 2 - There was a problem reading the user's UUID (it wasn't found in the database), so the
# cookies were deleted (via C<< Account->_logout() >>. The user needs to log back in.
# cookies were deleted (via C<< Account->logout() >>. The user needs to log back in.
# 3 - There user's hash is invalid, it is probably expired. The user has been logged out and
# 3 - There user's hash is invalid, it is probably expired. The user has been logged out and
# needs to log back in.
# needs to log back in.
my $cookie_problem = $anvil->Account->read_cookies({debug => 2});
my $cookie_problem = $anvil->Account->read_cookies({debug => 3});
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { cookie_problem => $cookie_problem }});
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 3, list => { cookie_problem => $cookie_problem }});
if (not $cookie_problem)
if (not $cookie_problem)
{
{
$logged_in = 1;
$logged_in = 1;
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { logged_in => $logged_in }});
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 3, list => { logged_in => $logged_in }});
}
}
}
}
@ -252,13 +261,13 @@ sub check_if_configured
variable_source_uuid => $anvil->Get->host_uuid,
variable_source_uuid => $anvil->Get->host_uuid,
variable_source_table => "hosts",
variable_source_table => "hosts",
});
});
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => {
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 3, list => {
configured => $configured,
configured => $configured,
variable_uuid => $variable_uuid,
variable_uuid => $variable_uuid,
modified_date => $modified_date,
modified_date => $modified_date,
}});
}});
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { configured => $configured }});
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 3, list => { configured => $configured }});
return($configured);
return($configured);
}
}
@ -269,12 +278,25 @@ sub check_availability
my ($anvil) = @_;
my ($anvil) = @_;
my $available = 1;
my $available = 1;
my $query = "SELECT job_progress, modified_date, extract(epoch from modified_date) FROM jobs WHERE job_name = 'configure::network' AND job_progress != 100 AND job_host_uuid = ".$anvil->data->{sys}{use_db_fh}->quote($anvil->Get->host_uuid).";";
my $query = "
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { query => $query }});
@ -58,6 +58,7 @@ NOTE: You must update the password of any other system using this host's
<keyname="message_0030">Failed to write the new password to the temporary file: [#!variable!file!#]. Please check the logs for details.</key>
<keyname="message_0030">Failed to write the new password to the temporary file: [#!variable!file!#]. Please check the logs for details.</key>
<keyname="message_0031">Beginning configuration of local system.</key>
<keyname="message_0031">Beginning configuration of local system.</key>
<keyname="message_0032"><![CDATA[Forgot your password?<br />Use '<span class="code">anvil-change-password</span>' from the console to reset it.]]></key>
<keyname="message_0032"><![CDATA[Forgot your password?<br />Use '<span class="code">anvil-change-password</span>' from the console to reset it.]]></key>
<keyname="error_0028"><![CDATA[There appears to be a problem with Striker. The login failed, please check: [<span class="code">#!data!sys::log_file!#</span>] for details.]]></key>
<!-- These are works and strings used by javascript/jqery -->
<!-- These are works and strings used by javascript/jqery -->