um, add enough POD to by syntactically correct
This commit is contained in:
parent
abdf04659a
commit
a21e710c72
5 changed files with 54 additions and 2 deletions
|
|
@ -18,7 +18,11 @@ Package WebGUI::Macro::SessionId
|
|||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
Returns the current user's session Id.
|
||||
A macro to return the ID of the user's current session.
|
||||
|
||||
=head2 process( )
|
||||
|
||||
Really just a wrapper around $session->getId;
|
||||
|
||||
=cut
|
||||
|
||||
|
|
|
|||
|
|
@ -42,6 +42,31 @@ sub canView {
|
|||
return $user->isInGroup( $session->setting->get("groupIdAdminSpectre") );
|
||||
}
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
=head2 getASpectre ( [$session] )
|
||||
|
||||
Get a connection to spectre. Encapsulated here so outside code can call
|
||||
something that's carefully encapsulated.
|
||||
|
||||
=head3 $session
|
||||
|
||||
A WebGUI session variable so getASpectre can access information in
|
||||
the config file.
|
||||
|
||||
=cut
|
||||
|
||||
sub getASpectre {
|
||||
my $session = shift;
|
||||
my $remote = create_ikc_client(
|
||||
port=>$session->config->get("spectrePort"),
|
||||
ip=>$session->config->get("spectreIp"),
|
||||
name=>rand(100000),
|
||||
timeout=>10
|
||||
);
|
||||
return $remote;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 www_spectreGetSiteData ( )
|
||||
|
|
|
|||
|
|
@ -21,6 +21,7 @@ use WebGUI::International;
|
|||
use WebGUI::VersionTag;
|
||||
use WebGUI::HTMLForm;
|
||||
use WebGUI::Paginator;
|
||||
use WebGUI::Operation::Spectre;
|
||||
|
||||
=head1 NAME
|
||||
|
||||
|
|
@ -206,7 +207,18 @@ sub www_commitVersionTag {
|
|||
if ($tagId) {
|
||||
my $tag = WebGUI::VersionTag->new($session, $tagId);
|
||||
if (defined $tag && $session->user->isInGroup($tag->get("groupToUse"))) {
|
||||
my $remote = WebGUI::Operation::Spectre::getASpectre($session);
|
||||
my $i18n = WebGUI::International->new($session, "VersionTag");
|
||||
if (!defined $remote) {
|
||||
$session->errorHandler->warn('Unable to connect to spectre. Canceling the commit');
|
||||
my $output = sprintf qq{<h1>%s</h1>\n<p>%s</p><p><a href="%s">%s</a>},
|
||||
$i18n->get('broken spectre title', 'WebGUI'),
|
||||
$i18n->get('broken spectre body', 'WebGUI'),
|
||||
$session->url->getBackToSiteURL(),
|
||||
$i18n->get('493', 'WebGUI');
|
||||
return $session->style->userStyle($output);
|
||||
}
|
||||
$remote->disconnect;
|
||||
my $f = WebGUI::HTMLForm->new($session);
|
||||
$f->submit;
|
||||
$f->readOnly(
|
||||
|
|
@ -228,7 +240,7 @@ sub www_commitVersionTag {
|
|||
hoverHelp=>$i18n->get("comments description commit")
|
||||
);
|
||||
$f->submit;
|
||||
my $ac = WebGUI::AdminConsole->new($session,"versions");
|
||||
my $ac = WebGUI::AdminConsole->new($session,"versions");
|
||||
return $ac->render($f->print);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -413,6 +413,7 @@ sub requestCommit {
|
|||
return $errorMessage;
|
||||
}
|
||||
}
|
||||
return '';
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -3921,6 +3921,16 @@ LongTruncOk=1</p>
|
|||
lastUpdated => 1193196211,
|
||||
},
|
||||
|
||||
'broken spectre title' => {
|
||||
message => q{Cannot connect to Spectre},
|
||||
lastUpdated => 1202274234,
|
||||
},
|
||||
|
||||
'broken spectre body' => {
|
||||
message => q{Your commit is canceled because WebGUI cannot connect to Spectre. Please fix your Spectre problem and attempt to commit again.},
|
||||
lastUpdated => 1202274246,
|
||||
},
|
||||
|
||||
};
|
||||
|
||||
1;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue