Fix the bad subnet checking in spectreTest. Subnet checks should only happen

in www_spectreTest, until a way is found to round trip data in and out of spectre
back to WebGUI.  Documented how and where that should occur.
This commit is contained in:
Colin Kuskie 2009-02-03 00:14:05 +00:00
parent 1091616705
commit e0f6eec470
2 changed files with 27 additions and 14 deletions

View file

@ -7,6 +7,7 @@
- fixed #9580: Gallery: albums shown in navigation
- fixed #9578: Use of "quotes" in badge name causes error
- fixed #9603: moving wiki page
- fixed #9302: Spectre Problem...
- fixed #9635: Matrix - Add attributes not working
7.6.10

View file

@ -164,7 +164,10 @@ sub www_spectreStatus {
=head2 www_spectreTest ( )
Spectre executes this function to see if WebGUI connectivity is working.
Spectre executes this function to see if WebGUI connectivity is working. Note, the subnet checking
is done in here because it is only, ever intended that Spectre use this method. If a user were to
call this method, it would lie, since it would be checking if the user's IP address was a valid
spectreSubnet, instead of checking the IP address of the spectre process.
=cut
@ -172,24 +175,12 @@ sub www_spectreTest {
my $session = shift;
$session->http->setMimeType("text/plain");
$session->http->setCacheControl("none");
return WebGUI::Operation::Spectre::spectreTest($session);
}
#-------------------------------------------------------------------
=head2 spectreTest ( )
Spectre executes this function to see if WebGUI connectivity is working.
=cut
sub spectreTest{
my $session = shift;
my $subnets = $session->config->get("spectreSubnets");
if (!defined $subnets) {
$subnets = [];
}
my $sessionIp = $session->env->getIp;
unless (isInSubnet($sessionIp, $subnets)) {
$session->errorHandler->security(
@ -198,6 +189,20 @@ sub spectreTest{
);
return "subnet";
}
return WebGUI::Operation::Spectre::spectreTest($session);
}
#-------------------------------------------------------------------
=head2 spectreTest ( )
Spectre executes this function to see if WebGUI connectivity is working. It does not
do subnet checking, yet.
=cut
sub spectreTest{
my $session = shift;
my $remote = create_ikc_client(
port=>$session->config->get("spectrePort"),
ip=>$session->config->get("spectreIp"),
@ -209,6 +214,13 @@ sub spectreTest{
my $result = $remote->post_respond('admin/ping');
$remote->disconnect;
return "spectre" unless defined $result;
##A real spectre subnet test would go here, and would consist of the following
##events:
## 1) WebGUI talks to spectre.
## 2) Spectre makes a request of WebGUI
## 3) WebGUI returns a token or an error
## 4) spectre returns the result of the request to WebGUI
## 5) WebGUI lets the user know how it all ended up.
return "success";
}