a ton of $session fixes (thanks to Colin), and a new $session checker, that supposedly, shouldn't be needed now. It can be backed out, however, easily.
This commit is contained in:
parent
5fadc70eac
commit
09483e18c5
208 changed files with 505 additions and 533 deletions
|
|
@ -35,7 +35,7 @@ The value for the key that will be looked up.
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
sub process {
|
||||
my $session = shift;
|
||||
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
|
||||
my $key = shift;
|
||||
my $value = shift;
|
||||
my $sql = "select count from passiveProfileAOI a, metaData_properties f
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ Define which value, by it's ranking, will be displayed. The highest ranking is
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
sub process {
|
||||
my $session = shift;
|
||||
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
|
||||
my $key = shift;
|
||||
my $rank = shift || 1; # 1 is highest rank
|
||||
$rank--; # Rank is zero based
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ Admin bar to the left of the screen.
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
sub process {
|
||||
my $session = shift;
|
||||
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
|
||||
return "" unless ($session->var->isAdminOn);
|
||||
my @param = @_;
|
||||
my $templateId = $param[0] || "PBtmpl0000000000000090";
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ string is returned.
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
sub process {
|
||||
my $session = shift;
|
||||
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
|
||||
my @param = @_;
|
||||
return "" unless ($session->var->get("adminOn"));
|
||||
return $param[0];
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ A template from the Macro/AdminToggle namespace to use for formatting the link.
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
sub process {
|
||||
my $session = shift;
|
||||
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
|
||||
if ($session->user->isInGroup(12)) {
|
||||
my %var;
|
||||
my ($turnOn,$turnOff,$templateName) = @_;
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ Admin is turned on.
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
sub process {
|
||||
my $session = shift;
|
||||
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
|
||||
my $url = shift;
|
||||
my $t = [Time::HiRes::gettimeofday()] if ($session->errorHandler->canShowPerformanceIndicators());
|
||||
my $asset = WebGUI::Asset->newByUrl($session,$url);
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ Macro for displaying the current User's username.
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
sub process {
|
||||
my $session = shift;
|
||||
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
|
||||
return $session->user->username;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ this asset, an empty string will be returned.
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
sub process {
|
||||
my $session = shift;
|
||||
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
|
||||
my @param = @_;
|
||||
if ($session->asset && $session->asset->canEdit) {
|
||||
return $param[0];
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ time is used instead.
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
sub process {
|
||||
my $session = shift;
|
||||
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
|
||||
my (@param, $temp, $time);
|
||||
@param = @_;
|
||||
$time = $param[1] ||$session->datetime->time();
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ A template from the Macro/EditableToggle namespace to use for formatting the lin
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
sub process {
|
||||
my $session = shift;
|
||||
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
|
||||
if ($session->asset && $session->asset->canEdit && $session->user->isInGroup(12)) {
|
||||
my %var;
|
||||
my @param = @_;
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ then undef will be returned.
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
sub process {
|
||||
my $session = shift;
|
||||
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
|
||||
return $session->env->get(shift);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ be blocked and an error message returned instead.
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
sub process {
|
||||
my $session = shift;
|
||||
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
|
||||
my @param = @_;
|
||||
if ($param[0] =~ /passwd/ || $param[0] =~ /shadow/ || $param[0] =~ /\.conf/) {
|
||||
my $i18n = WebGUI::International->new($session, 'Macro_Execute');
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ Returns the extrasURL. A trailing slash '/' is appended to the URL.
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
sub process {
|
||||
my $session = shift;
|
||||
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
|
||||
return $session->config->get("extrasURL")."/";
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ A path to a file
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
sub process {
|
||||
my $session = shift;
|
||||
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
|
||||
my $path = shift;
|
||||
return guess_media_type($path);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ The URL to the Asset.
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
sub process {
|
||||
my $session = shift;
|
||||
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
|
||||
my $url = shift;
|
||||
my $asset = WebGUI::Asset->newByUrl($session,$url);
|
||||
if (defined $asset) {
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ The name of the field to pull from the session variable.
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
sub process {
|
||||
my $session = shift;
|
||||
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
|
||||
return $session->form->process(shift);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ An optional template for formatting the text and link.
|
|||
#-------------------------------------------------------------------
|
||||
sub process {
|
||||
my @param = @_;
|
||||
my $session = shift;
|
||||
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
|
||||
return "" if ($param[0] eq "");
|
||||
return "" if ($param[1] eq "");
|
||||
return "" if ($session->user->userId eq '1');
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ An optional template for formatting the text and link.
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
sub process {
|
||||
my $session = shift;
|
||||
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
|
||||
my @param = @_;
|
||||
return "" if ($param[0] eq "");
|
||||
return "" if ($param[1] eq "");
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ Text to be shown to someone not in the group.
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
sub process {
|
||||
my $session = shift;
|
||||
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
|
||||
my @param = @_;
|
||||
my ($groupId) = $session->dbSlave->quickArray("select groupId from groups where groupName=".$session->db->quote($param[0]));
|
||||
$groupId = 3 if ($groupId eq "");
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ be used.
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
sub process {
|
||||
my $session = shift;
|
||||
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
|
||||
my ($label, $templateUrl) = @_;
|
||||
my $home = WebGUI::Asset->getDefault($session);
|
||||
if ($label ne "linkonly") {
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ Returns the userId from the session variable for the current user.
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
sub process {
|
||||
my $session = shift;
|
||||
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
|
||||
return $session->user->userId;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ The complete path to a file in the local filesystem.
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
sub process {
|
||||
my $session = shift;
|
||||
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
|
||||
my (@param, $temp, $file);
|
||||
@param = @_;
|
||||
my $i18n = WebGUI::International->new($session,'Macro_Include');
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ URL to the javascript to include in the page's header tags.
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
sub process {
|
||||
my $session = shift;
|
||||
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
|
||||
$session->style->setScript(shift,{type=>'text/javascript'});
|
||||
return "";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ text to wrap in a link for logging out.
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
sub _createURL {
|
||||
my $session = shift;
|
||||
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
|
||||
my $text = shift;
|
||||
return '<a href="'.$session->url->page("op=auth;method=logout").'">'.$text.'</a>';
|
||||
}
|
||||
|
|
@ -61,7 +61,7 @@ The ID of a template for custom layout of the login box and text.
|
|||
=cut
|
||||
|
||||
sub process {
|
||||
my $session = shift;
|
||||
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
|
||||
my @param = @_;
|
||||
my $templateId = $param[2] || "PBtmpl0000000000000044";
|
||||
my %var;
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ sprintf. See L<WebGUI::DateTime/"epochToHuman"> for a list of codes. Uses
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
sub process {
|
||||
my $session = shift;
|
||||
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
|
||||
return '' unless $session->asset;
|
||||
my ($label, $format, $time);
|
||||
($label, $format) = @_;
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ The ID of a template for custom layout of the link and text.
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
sub process {
|
||||
my $session = shift;
|
||||
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
|
||||
my @param = @_;
|
||||
my $i18n = WebGUI::International->new($session,'Macro_LoginToggle');
|
||||
my $login = $param[0] || $i18n->get(716);
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ The name of the property to retrieve from the assset via $session->asset->get()
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
sub process {
|
||||
my $session = shift;
|
||||
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
|
||||
if ($session->asset) {
|
||||
return $session->asset->get(shift);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ no asset cached in the session variable, nothing is returned.
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
sub process {
|
||||
my $session = shift;
|
||||
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
|
||||
if ($session->asset) {
|
||||
if ($session->form->process("op") || $session->form->process("func")) {
|
||||
return '<a href="'.$session->asset->getUrl.'">'.$session->asset->get("title").'</a>';
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ process is really a wrapper around $session->url->page();
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
sub process {
|
||||
my $session = shift;
|
||||
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
|
||||
return $session->url->page();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ is left blank, a default template from the Macro/Product namespace will be used.
|
|||
=cut
|
||||
|
||||
sub process {
|
||||
my $session = shift;
|
||||
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
|
||||
my (@param, $productId, $variantId, $product, $variant, $output, $templateId, @variantLoop, %var);
|
||||
|
||||
@param = @_;
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ The text to quote.
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
sub process {
|
||||
my $session = shift;
|
||||
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
|
||||
return $session->db->quote(shift);
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ if no asset exists at that url, or if the asset has no children.
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
sub process {
|
||||
my $session = shift;
|
||||
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
|
||||
my $url = shift;
|
||||
my $i18n = WebGUI::International->new($session,'Macro_RandomAssetProxy');
|
||||
my $asset = WebGUI::Asset->newByUrl($session, $url);
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ URL of the template to use to display the random thread. Must be a valid URL wit
|
|||
=cut
|
||||
|
||||
sub process {
|
||||
my $session = shift;
|
||||
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
|
||||
my ($startURL, $relatives, $templateURL) = @_;
|
||||
# Seed the randomizer:
|
||||
srand;
|
||||
|
|
@ -129,7 +129,7 @@ Reference to an array with lineage of Collaboration Systems to select a random t
|
|||
=cut
|
||||
|
||||
sub _getRandomThread {
|
||||
my $session = shift;
|
||||
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
|
||||
my $lineage = shift;
|
||||
|
||||
# Get random CS:
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ Text that will be added to the HEAD tags for this page.
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
sub process {
|
||||
my $session = shift;
|
||||
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
|
||||
$session->style->setRawHeadTags(shift);
|
||||
return "";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ is returned. Otherwise a space is returned.
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
sub process {
|
||||
my $session = shift;
|
||||
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
|
||||
if ($session->asset) {
|
||||
my $lineage = $session->asset->get("lineage");
|
||||
$lineage = substr($lineage,0,6);
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ be used to position its output in the format.
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
sub process {
|
||||
my $session = shift;
|
||||
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
|
||||
my ($output, @data, $rownum, $temp);
|
||||
my ($statement, $format) = @_;
|
||||
my $i18n = WebGUI::International->new($session,'Macro_SQL');
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ process is really a wrapper around $session->url->gateway();
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
sub process {
|
||||
my $session = shift;
|
||||
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
|
||||
return $session->url->gateway();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ Set the height of the spacer.
|
|||
=cut
|
||||
|
||||
sub process {
|
||||
my $session = shift;
|
||||
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
|
||||
my ($output, @param, $width, $height);
|
||||
@param = @_;
|
||||
$width = $param[0] if defined $param[0];
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ used as a default.
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
sub process {
|
||||
my $session = shift;
|
||||
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
|
||||
my ($temp, @param);
|
||||
@param = @_;
|
||||
if ($param[0] ne "") {
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ The URL to the CSS document.
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
sub process {
|
||||
my $session = shift;
|
||||
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
|
||||
$session->style->setLink(shift,{
|
||||
type=>'text/css',
|
||||
rel=>'stylesheet'
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ be used from the Macro/SubscriptionItem namespace.
|
|||
=cut
|
||||
|
||||
sub process {
|
||||
my $session = shift;
|
||||
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
|
||||
my ($subscriptionId, $templateId, %var);
|
||||
($subscriptionId, $templateId) = @_;
|
||||
%var = $session->db->quickHash('select * from subscription where subscriptionId='.$session->db->quote($subscriptionId));
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ The ID of the subscription item to purchase.
|
|||
=cut
|
||||
|
||||
sub process {
|
||||
my $session = shift;
|
||||
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
|
||||
return $session->url->page('op=purchaseSubscription;sid='.shift);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ Image Asset can be found with that URL, then undef will be returned.
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
sub process {
|
||||
my $session = shift;
|
||||
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
|
||||
my $url = shift;
|
||||
if (my $image = WebGUI::Asset::File::Image->newByUrl($session,$url)) {
|
||||
return $image->getThumbnailUrl;
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ The text to URL encode.
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
sub process {
|
||||
my $session = shift;
|
||||
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
|
||||
return $session->url->escape(shift);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ the data stored in $session . If the field does not exist, undef is returned.
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
sub process {
|
||||
my $session = shift;
|
||||
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
|
||||
return $session->user->profileField(shift);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ A template to use for formatting the link.
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
sub process {
|
||||
my $session = shift;
|
||||
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
|
||||
my %var;
|
||||
my @param = @_;
|
||||
return $session->url->page("op=auth;method=init") if ($param[0] eq "linkonly");
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ returns the companyName from the session variable.
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
sub process {
|
||||
my $session = shift;
|
||||
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
|
||||
return $session->setting->get("companyName");
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ returns the companyEmail from the session variable.
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
sub process {
|
||||
my $session = shift;
|
||||
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
|
||||
return $session->setting->get("companyEmail");
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ is used.
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
sub process {
|
||||
my $session = shift;
|
||||
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
|
||||
my ($temp, @param, $styleId);
|
||||
@param = @_;
|
||||
my $append = 'op=makePrintable';
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ returns the companyURL from the session variable.
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
sub process {
|
||||
my $session = shift;
|
||||
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
|
||||
return $session->setting->get("companyURL");
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue