change ErrorHandler to Log
This commit is contained in:
parent
d11cd6f4f7
commit
199c4e4960
90 changed files with 311 additions and 311 deletions
|
|
@ -151,11 +151,11 @@ sub handle {
|
||||||
for my $handler (@{$session->config->get("contentHandlers")}) {
|
for my $handler (@{$session->config->get("contentHandlers")}) {
|
||||||
my $output = eval { WebGUI::Pluggable::run($handler, "handler", [ $session ] )};
|
my $output = eval { WebGUI::Pluggable::run($handler, "handler", [ $session ] )};
|
||||||
if ( my $e = WebGUI::Error->caught ) {
|
if ( my $e = WebGUI::Error->caught ) {
|
||||||
$session->errorHandler->error($e->package.":".$e->line." - ".$e->error);
|
$session->log->error($e->package.":".$e->line." - ".$e->error);
|
||||||
$session->errorHandler->debug($e->package.":".$e->line." - ".$e->trace);
|
$session->log->debug($e->package.":".$e->line." - ".$e->trace);
|
||||||
}
|
}
|
||||||
elsif ( $@ ) {
|
elsif ( $@ ) {
|
||||||
$session->errorHandler->error( $@ );
|
$session->log->error( $@ );
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -358,7 +358,7 @@ around BUILDARGS => sub {
|
||||||
# fetch properties
|
# fetch properties
|
||||||
$properties = $session->db->quickHashRef($sql.$where, $placeHolders);
|
$properties = $session->db->quickHashRef($sql.$where, $placeHolders);
|
||||||
unless (exists $properties->{assetId}) {
|
unless (exists $properties->{assetId}) {
|
||||||
$session->errorHandler->error("Asset $assetId $className $revisionDate is missing properties. Consult your database tables for corruption. ");
|
$session->log->error("Asset $assetId $className $revisionDate is missing properties. Consult your database tables for corruption. ");
|
||||||
return undef;
|
return undef;
|
||||||
}
|
}
|
||||||
$session->cache->set("asset".$assetId.$revisionDate, $properties, 60*60*24);
|
$session->cache->set("asset".$assetId.$revisionDate, $properties, 60*60*24);
|
||||||
|
|
@ -368,7 +368,7 @@ around BUILDARGS => sub {
|
||||||
$properties->{session} = $session;
|
$properties->{session} = $session;
|
||||||
return $className->$orig($properties);
|
return $className->$orig($properties);
|
||||||
}
|
}
|
||||||
$session->errorHandler->error("Something went wrong trying to instanciate a '$className' with assetId '$assetId', but I don't know what!");
|
$session->log->error("Something went wrong trying to instanciate a '$className' with assetId '$assetId', but I don't know what!");
|
||||||
return undef;
|
return undef;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -2256,7 +2256,7 @@ sub processTemplate {
|
||||||
|
|
||||||
# Sanity checks
|
# Sanity checks
|
||||||
if (ref $var ne "HASH") {
|
if (ref $var ne "HASH") {
|
||||||
$session->errorHandler->error("First argument to processTemplate() should be a hash reference.");
|
$session->log->error("First argument to processTemplate() should be a hash reference.");
|
||||||
return "Error: Can't process template for asset ".$self->getId." of type ".$self->get("className");
|
return "Error: Can't process template for asset ".$self->getId." of type ".$self->get("className");
|
||||||
}
|
}
|
||||||
if (!defined $template) {
|
if (!defined $template) {
|
||||||
|
|
@ -2275,7 +2275,7 @@ sub processTemplate {
|
||||||
return $template->process(\%vars);
|
return $template->process(\%vars);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$session->errorHandler->error("Can't instantiate template $templateId for asset ".$self->getId);
|
$session->log->error("Can't instantiate template $templateId for asset ".$self->getId);
|
||||||
my $i18n = WebGUI::International->new($self->session, 'Asset');
|
my $i18n = WebGUI::International->new($self->session, 'Asset');
|
||||||
return $i18n->get('Error: Cannot instantiate template').' '.$templateId;
|
return $i18n->get('Error: Cannot instantiate template').' '.$templateId;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -348,7 +348,7 @@ sub www_editSubmission {
|
||||||
if( $assetId ne 'new' ) {
|
if( $assetId ne 'new' ) {
|
||||||
$self ||= eval { WebGUI::Asset->newById($session,$assetId); };
|
$self ||= eval { WebGUI::Asset->newById($session,$assetId); };
|
||||||
if (Exception::Class->caught()) {
|
if (Exception::Class->caught()) {
|
||||||
$session->errorHandler->error(__PACKAGE__ . " - failed to instanciate asset with assetId $assetId");
|
$session->log->error(__PACKAGE__ . " - failed to instanciate asset with assetId $assetId");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
my $asset = $self || $parent;
|
my $asset = $self || $parent;
|
||||||
|
|
|
||||||
|
|
@ -229,7 +229,7 @@ sub www_editSubmissionForm {
|
||||||
elsif ( $assetId ne 'new' ) {
|
elsif ( $assetId ne 'new' ) {
|
||||||
$self ||= WebGUI::Asset->newById( $session, $assetId );
|
$self ||= WebGUI::Asset->newById( $session, $assetId );
|
||||||
if ( !defined($self) ) {
|
if ( !defined($self) ) {
|
||||||
$session->errorHandler->error( __PACKAGE__ . " - failed to instanciate asset with assetId $assetId" );
|
$session->log->error( __PACKAGE__ . " - failed to instanciate asset with assetId $assetId" );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
my $asset = $self || $parent;
|
my $asset = $self || $parent;
|
||||||
|
|
|
||||||
|
|
@ -494,9 +494,9 @@ sub getDateTimeStart {
|
||||||
my $time = $self->startTime;
|
my $time = $self->startTime;
|
||||||
my $tz = $self->session->datetime->getTimeZone;
|
my $tz = $self->session->datetime->getTimeZone;
|
||||||
|
|
||||||
#$self->session->errorHandler->warn($self->getId.":: Date: $date -- Time: $time");
|
#$self->session->log->warn($self->getId.":: Date: $date -- Time: $time");
|
||||||
if (!$date) {
|
if (!$date) {
|
||||||
$self->session->errorHandler->warn("Event::getDateTimeStart -- This event (".$self->get("assetId").") has no start date.");
|
$self->session->log->warn("Event::getDateTimeStart -- This event (".$self->get("assetId").") has no start date.");
|
||||||
return undef;
|
return undef;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -533,9 +533,9 @@ sub getDateTimeEnd {
|
||||||
my $time = $self->endTime;
|
my $time = $self->endTime;
|
||||||
my $tz = $self->session->datetime->getTimeZone;
|
my $tz = $self->session->datetime->getTimeZone;
|
||||||
|
|
||||||
#$self->session->errorHandler->warn($self->getId.":: Date: $date -- Time: $time");
|
#$self->session->log->warn($self->getId.":: Date: $date -- Time: $time");
|
||||||
if (!$date) {
|
if (!$date) {
|
||||||
$self->session->errorHandler->warn("Event::getDateTimeEnd -- This event (".$self->get("assetId").") has no end date.");
|
$self->session->log->warn("Event::getDateTimeEnd -- This event (".$self->get("assetId").") has no end date.");
|
||||||
return undef;
|
return undef;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -855,7 +855,7 @@ sub getRecurrence {
|
||||||
|
|
||||||
return $self->{recurrence} ||= do {
|
return $self->{recurrence} ||= do {
|
||||||
#use Data::Dumper;
|
#use Data::Dumper;
|
||||||
#$self->session->errorHandler->warn("recurId: ".$self->recurId);
|
#$self->session->log->warn("recurId: ".$self->recurId);
|
||||||
|
|
||||||
my %data
|
my %data
|
||||||
= $self->session->db->quickHash(
|
= $self->session->db->quickHash(
|
||||||
|
|
|
||||||
|
|
@ -315,7 +315,7 @@ sub getStorageFromPost {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
my $storageId = shift;
|
my $storageId = shift;
|
||||||
my $fileStorageId = WebGUI::Form::File->new($self->session, {name => 'newFile', value=>$storageId })->getValue;
|
my $fileStorageId = WebGUI::Form::File->new($self->session, {name => 'newFile', value=>$storageId })->getValue;
|
||||||
$self->session->errorHandler->info( "File Storage Id: $fileStorageId" );
|
$self->session->log->info( "File Storage Id: $fileStorageId" );
|
||||||
return $self->getStorageClass->get($self->session, $fileStorageId);
|
return $self->getStorageClass->get($self->session, $fileStorageId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -388,7 +388,7 @@ override processEditForm => sub {
|
||||||
return $errors if @$errors;
|
return $errors if @$errors;
|
||||||
|
|
||||||
if (my $storageId = $session->form->get('newFile','File')) {
|
if (my $storageId = $session->form->get('newFile','File')) {
|
||||||
$session->errorHandler->info("Got a new file for asset " . $self->getId);
|
$session->log->info("Got a new file for asset " . $self->getId);
|
||||||
my $storage = $self->getStorageClass->get( $session, $storageId);
|
my $storage = $self->getStorageClass->get( $session, $storageId);
|
||||||
my $filePath = $storage->getPath( $storage->getFiles->[0] );
|
my $filePath = $storage->getPath( $storage->getFiles->[0] );
|
||||||
$self->setFile( $filePath );
|
$self->setFile( $filePath );
|
||||||
|
|
@ -547,7 +547,7 @@ sub updatePropertiesFromStorage {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
my $storage = $self->getStorageLocation;
|
my $storage = $self->getStorageLocation;
|
||||||
my $filename = $storage->getFiles->[0];
|
my $filename = $storage->getFiles->[0];
|
||||||
$self->session->errorHandler->info("Updating file asset filename to $filename");
|
$self->session->log->info("Updating file asset filename to $filename");
|
||||||
$self->update({
|
$self->update({
|
||||||
filename => $filename,
|
filename => $filename,
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -255,7 +255,7 @@ sub getExifData {
|
||||||
# isn't perfect, so handle errors gracefully
|
# isn't perfect, so handle errors gracefully
|
||||||
my $exif = eval { from_json( $self->exifData ) };
|
my $exif = eval { from_json( $self->exifData ) };
|
||||||
if ( $@ ) {
|
if ( $@ ) {
|
||||||
$self->session->errorHandler->warn(
|
$self->session->log->warn(
|
||||||
"Could not parse JSON data for EXIF in Photo '" . $self->title
|
"Could not parse JSON data for EXIF in Photo '" . $self->title
|
||||||
. "' (" . $self->getId . "): " . $@
|
. "' (" . $self->getId . "): " . $@
|
||||||
);
|
);
|
||||||
|
|
@ -400,7 +400,7 @@ sub makeResolutions {
|
||||||
$resolutions ||= $self->getGallery->getImageResolutions;
|
$resolutions ||= $self->getGallery->getImageResolutions;
|
||||||
|
|
||||||
my $storage = $self->getStorageLocation;
|
my $storage = $self->getStorageLocation;
|
||||||
$self->session->errorHandler->info(" Making resolutions for '" . $self->filename . q{'});
|
$self->session->log->info(" Making resolutions for '" . $self->filename . q{'});
|
||||||
|
|
||||||
for my $res ( @$resolutions ) {
|
for my $res ( @$resolutions ) {
|
||||||
# carp if resolution is bad
|
# carp if resolution is bad
|
||||||
|
|
|
||||||
|
|
@ -98,7 +98,7 @@ sub unzip {
|
||||||
if ($filename =~ m/\.zip$/i) {
|
if ($filename =~ m/\.zip$/i) {
|
||||||
my $zip = Archive::Zip->new();
|
my $zip = Archive::Zip->new();
|
||||||
unless ($zip->read($filename) == $zip->AZ_OK){
|
unless ($zip->read($filename) == $zip->AZ_OK){
|
||||||
$self->session->errorHandler->warn($i18n->get("zip_error"));
|
$self->session->log->warn($i18n->get("zip_error"));
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
$zip->extractTree();
|
$zip->extractTree();
|
||||||
|
|
@ -106,12 +106,12 @@ sub unzip {
|
||||||
} elsif ($filename =~ m/\.tar$/i) {
|
} elsif ($filename =~ m/\.tar$/i) {
|
||||||
Archive::Tar->extract_archive($filepath.'/'.$filename,1);
|
Archive::Tar->extract_archive($filepath.'/'.$filename,1);
|
||||||
if (Archive::Tar->error) {
|
if (Archive::Tar->error) {
|
||||||
$self->session->errorHandler->warn(Archive::Tar->error);
|
$self->session->log->warn(Archive::Tar->error);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
$self->fixFilenames;
|
$self->fixFilenames;
|
||||||
} else {
|
} else {
|
||||||
$self->session->errorHandler->warn($i18n->get("bad_archive"));
|
$self->session->log->warn($i18n->get("bad_archive"));
|
||||||
}
|
}
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
|
|
@ -191,7 +191,7 @@ override processEditForm => sub {
|
||||||
}
|
}
|
||||||
|
|
||||||
unless ($self->unzip($storage,$self->filename)) {
|
unless ($self->unzip($storage,$self->filename)) {
|
||||||
$self->session->errorHandler->warn($i18n->get("unzip_error"));
|
$self->session->log->warn($i18n->get("unzip_error"));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -214,7 +214,7 @@ sub view {
|
||||||
return $out if $out;
|
return $out if $out;
|
||||||
}
|
}
|
||||||
my %var = %{$self->get};
|
my %var = %{$self->get};
|
||||||
#$self->session->errorHandler->warn($self->getId);
|
#$self->session->log->warn($self->getId);
|
||||||
$var{controls} = $self->getToolbar;
|
$var{controls} = $self->getToolbar;
|
||||||
if($self->session->scratch->get("za_error")) {
|
if($self->session->scratch->get("za_error")) {
|
||||||
$var{error} = $self->session->scratch->get("za_error");
|
$var{error} = $self->session->scratch->get("za_error");
|
||||||
|
|
|
||||||
|
|
@ -1048,7 +1048,7 @@ sub updateThreadRating {
|
||||||
$parent->recalculateRating;
|
$parent->recalculateRating;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$self->session->errorHandler->error("Couldn't get parent for thread ".$self->getId);
|
$self->session->log->error("Couldn't get parent for thread ".$self->getId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -513,7 +513,7 @@ sub getOverrides {
|
||||||
$sth->finish;
|
$sth->finish;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$self->session->errorHandler->warn("Original asset could not be instanciated by shortcut ".$self->getId);
|
$self->session->log->warn("Original asset could not be instanciated by shortcut ".$self->getId);
|
||||||
}
|
}
|
||||||
if ($self->isDashlet) {
|
if ($self->isDashlet) {
|
||||||
my @userPrefs = $self->getPrefFieldsToImport;
|
my @userPrefs = $self->getPrefFieldsToImport;
|
||||||
|
|
@ -780,7 +780,7 @@ Returns an I18n'ed error message that the Asset that this Shortcut points to no
|
||||||
|
|
||||||
sub notLinked {
|
sub notLinked {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
$self->session->errorHandler->warn("Shortcut ".$self->getId." is linked to an asset ".$self->get("shortcutToAssetId").", which no longer exists.");
|
$self->session->log->warn("Shortcut ".$self->getId." is linked to an asset ".$self->get("shortcutToAssetId").", which no longer exists.");
|
||||||
my $i18n = WebGUI::International->new($self->session, 'Asset_Shortcut');
|
my $i18n = WebGUI::International->new($self->session, 'Asset_Shortcut');
|
||||||
return $i18n->get('no longer exists');
|
return $i18n->get('no longer exists');
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -562,13 +562,13 @@ sub process {
|
||||||
|
|
||||||
if ($self->state =~ /^trash/) {
|
if ($self->state =~ /^trash/) {
|
||||||
my $i18n = WebGUI::International->new($session, 'Asset_Template');
|
my $i18n = WebGUI::International->new($session, 'Asset_Template');
|
||||||
$session->errorHandler->warn('process called on template in trash: '.$self->getId
|
$session->log->warn('process called on template in trash: '.$self->getId
|
||||||
.'. The template was called through this url: '.$session->asset->url);
|
.'. The template was called through this url: '.$session->asset->url);
|
||||||
return $session->var->isAdminOn ? $i18n->get('template in trash') : '';
|
return $session->var->isAdminOn ? $i18n->get('template in trash') : '';
|
||||||
}
|
}
|
||||||
elsif ($self->state =~ /^clipboard/) {
|
elsif ($self->state =~ /^clipboard/) {
|
||||||
my $i18n = WebGUI::International->new($session, 'Asset_Template');
|
my $i18n = WebGUI::International->new($session, 'Asset_Template');
|
||||||
$session->errorHandler->warn('process called on template in clipboard: '.$self->getId
|
$session->log->warn('process called on template in clipboard: '.$self->getId
|
||||||
.'. The template was called through this url: '.$session->asset->url);
|
.'. The template was called through this url: '.$session->asset->url);
|
||||||
return $session->var->isAdminOn ? $i18n->get('template in clipboard') : '';
|
return $session->var->isAdminOn ? $i18n->get('template in clipboard') : '';
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -81,7 +81,7 @@ sub process {
|
||||||
POST_CHOMP => 1, # cleanup whitespace
|
POST_CHOMP => 1, # cleanup whitespace
|
||||||
EVAL_PERL => 0, # evaluate Perl code blocks
|
EVAL_PERL => 0, # evaluate Perl code blocks
|
||||||
});
|
});
|
||||||
$t->process( \$template, _rewriteVars($vars),\$output) || $self->session->errorHandler->error($t->error());
|
$t->process( \$template, _rewriteVars($vars),\$output) || $self->session->log->error($t->error());
|
||||||
};
|
};
|
||||||
if ($@) {
|
if ($@) {
|
||||||
WebGUI::Error::Template->throw( error => $@ );
|
WebGUI::Error::Template->throw( error => $@ );
|
||||||
|
|
|
||||||
|
|
@ -545,7 +545,7 @@ sub getEvent {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
my $assetId = shift;
|
my $assetId = shift;
|
||||||
# Warn and return undef if no assetId
|
# Warn and return undef if no assetId
|
||||||
$self->session->errorHandler->warn("WebGUI::Asset::Wobject::Calendar->getEvent :: No asset ID."), return
|
$self->session->log->warn("WebGUI::Asset::Wobject::Calendar->getEvent :: No asset ID."), return
|
||||||
unless $assetId;
|
unless $assetId;
|
||||||
|
|
||||||
# ? Perhaps use Stow to cache events ?
|
# ? Perhaps use Stow to cache events ?
|
||||||
|
|
@ -553,11 +553,11 @@ sub getEvent {
|
||||||
my $event = WebGUI::Asset->newById($self->session, $assetId);
|
my $event = WebGUI::Asset->newById($self->session, $assetId);
|
||||||
|
|
||||||
unless ( $event ) {
|
unless ( $event ) {
|
||||||
$self->session->errorHandler->warn("Event '$assetId' doesn't exist!");
|
$self->session->log->warn("Event '$assetId' doesn't exist!");
|
||||||
return undef;
|
return undef;
|
||||||
}
|
}
|
||||||
|
|
||||||
$self->session->errorHandler->warn("WebGUI::Asset::Wobject::Calendar->getEvent :: Event '$assetId' not a child of calendar '".$self->getId."'"), return
|
$self->session->log->warn("WebGUI::Asset::Wobject::Calendar->getEvent :: Event '$assetId' not a child of calendar '".$self->getId."'"), return
|
||||||
unless $event->parentId eq $self->getId;
|
unless $event->parentId eq $self->getId;
|
||||||
|
|
||||||
return $event;
|
return $event;
|
||||||
|
|
@ -609,7 +609,7 @@ sub getEventsIn {
|
||||||
|
|
||||||
# Warn and return undef if no startDate or endDate
|
# Warn and return undef if no startDate or endDate
|
||||||
unless ($start && $end) {
|
unless ($start && $end) {
|
||||||
$self->session->errorHandler->warn("WebGUI::Asset::Wobject::Calendar->getEventsIn() called with not enough arguments at ".join('::',(caller)[1,2]));
|
$self->session->log->warn("WebGUI::Asset::Wobject::Calendar->getEventsIn() called with not enough arguments at ".join('::',(caller)[1,2]));
|
||||||
return undef;
|
return undef;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -823,7 +823,7 @@ sub prepareView {
|
||||||
$self->session->style->makePrintable(1);
|
$self->session->style->makePrintable(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
#$self->session->errorHandler->warn("Prepare view ".$view." with template ".$self->get("templateId".$view));
|
#$self->session->log->warn("Prepare view ".$view." with template ".$self->get("templateId".$view));
|
||||||
|
|
||||||
my $template = WebGUI::Asset::Template->newById($self->session, $self->get("templateId".$view));
|
my $template = WebGUI::Asset::Template->newById($self->session, $self->get("templateId".$view));
|
||||||
if (!$template) {
|
if (!$template) {
|
||||||
|
|
@ -951,7 +951,7 @@ sub view {
|
||||||
: lc $params->{type} eq "week" ? $self->viewWeek( $params )
|
: lc $params->{type} eq "week" ? $self->viewWeek( $params )
|
||||||
: lc $params->{type} eq "day" ? $self->viewDay( $params )
|
: lc $params->{type} eq "day" ? $self->viewDay( $params )
|
||||||
: lc $params->{type} eq "list" ? $self->viewList( $params )
|
: lc $params->{type} eq "list" ? $self->viewList( $params )
|
||||||
: return $self->errorHandler->error("Calendar invalid 'type=' url parameter")
|
: return $self->log->error("Calendar invalid 'type=' url parameter")
|
||||||
;
|
;
|
||||||
|
|
||||||
##### Process the template
|
##### Process the template
|
||||||
|
|
|
||||||
|
|
@ -1596,7 +1596,7 @@ sub view {
|
||||||
my $cache = $self->session->cache;
|
my $cache = $self->session->cache;
|
||||||
if ($self->_visitorCacheOk) {
|
if ($self->_visitorCacheOk) {
|
||||||
my $out = $cache->get($self->_visitorCacheKey);
|
my $out = $cache->get($self->_visitorCacheKey);
|
||||||
$self->session->errorHandler->debug("HIT") if $out;
|
$self->session->log->debug("HIT") if $out;
|
||||||
return $out if $out;
|
return $out if $out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1151,7 +1151,7 @@ sub sendEmail {
|
||||||
$groupId = $group->getId;
|
$groupId = $group->getId;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$self->session->errorHandler->warn($self->getId . ": Unable to send message, no user or group found.");
|
$self->session->log->warn($self->getId . ": Unable to send message, no user or group found.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
WebGUI::Inbox->new($self->session)->addMessage({
|
WebGUI::Inbox->new($self->session)->addMessage({
|
||||||
|
|
|
||||||
|
|
@ -837,7 +837,7 @@ sub www_addSubmission {
|
||||||
}
|
}
|
||||||
$form = eval { WebGUI::Asset->newById($session, $formId); };
|
$form = eval { WebGUI::Asset->newById($session, $formId); };
|
||||||
if (Exception::Class->caught()) {
|
if (Exception::Class->caught()) {
|
||||||
$session->errorHandler->error(__PACKAGE__ . " - failed to instanciate asset with assetId $formId");
|
$session->log->error(__PACKAGE__ . " - failed to instanciate asset with assetId $formId");
|
||||||
}
|
}
|
||||||
return $form->www_addSubmission;
|
return $form->www_addSubmission;
|
||||||
}
|
}
|
||||||
|
|
@ -1863,7 +1863,7 @@ className='WebGUI::Asset::Sku::EMSTicket' and state='published' and revisionDate
|
||||||
|
|
||||||
# skip borked tickets
|
# skip borked tickets
|
||||||
unless (defined $ticket) {
|
unless (defined $ticket) {
|
||||||
$session->errorHandler->warn("EMSTicket $id couldn't be instanciated by EMS ".$self->getId.".");
|
$session->log->warn("EMSTicket $id couldn't be instanciated by EMS ".$self->getId.".");
|
||||||
$totalTickets--;
|
$totalTickets--;
|
||||||
next;
|
next;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -165,7 +165,7 @@ sub addArchive {
|
||||||
my $class = $gallery->getAssetClassForFile( $filePath );
|
my $class = $gallery->getAssetClassForFile( $filePath );
|
||||||
next unless $class; # class is undef for those files the Gallery can't handle
|
next unless $class; # class is undef for those files the Gallery can't handle
|
||||||
|
|
||||||
$session->errorHandler->info( "Adding $filename to album!" );
|
$session->log->info( "Adding $filename to album!" );
|
||||||
$outputSub->('Adding %s to album', $filename);
|
$outputSub->('Adding %s to album', $filename);
|
||||||
# Remove the file extension
|
# Remove the file extension
|
||||||
$filename =~ s{\.[^.]+}{};
|
$filename =~ s{\.[^.]+}{};
|
||||||
|
|
@ -1417,7 +1417,7 @@ sub www_edit {
|
||||||
$asset->promote;
|
$asset->promote;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$session->errorHandler->error("Couldn't promote asset '$assetId' because we couldn't instantiate it.");
|
$session->log->error("Couldn't promote asset '$assetId' because we couldn't instantiate it.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
# Demote the file
|
# Demote the file
|
||||||
|
|
@ -1429,7 +1429,7 @@ sub www_edit {
|
||||||
$asset->demote;
|
$asset->demote;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$session->errorHandler->error("Couldn't demote asset '$assetId' because we couldn't instantiate it.");
|
$session->log->error("Couldn't demote asset '$assetId' because we couldn't instantiate it.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
# Rotate to the left
|
# Rotate to the left
|
||||||
|
|
@ -1477,7 +1477,7 @@ sub www_edit {
|
||||||
$asset->purge;
|
$asset->purge;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$session->errorHandler->error( "Couldn't delete asset '$assetId' because we couldn't instanciate it.");
|
$session->log->error( "Couldn't delete asset '$assetId' because we couldn't instanciate it.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -372,8 +372,8 @@ sub view {
|
||||||
}
|
}
|
||||||
### DEBUG
|
### DEBUG
|
||||||
#require Data::Dumper;
|
#require Data::Dumper;
|
||||||
#$self->session->errorHandler->warn("DEBUG: ".Data::Dumper::Dumper($params));
|
#$self->session->log->warn("DEBUG: ".Data::Dumper::Dumper($params));
|
||||||
#$self->session->errorHandler->warn("URL: $proxiedUrl");
|
#$self->session->log->warn("URL: $proxiedUrl");
|
||||||
|
|
||||||
$request = HTTP::Request->new(GET => $proxiedUrl, $header) || return "wrong url"; # Create GET request
|
$request = HTTP::Request->new(GET => $proxiedUrl, $header) || return "wrong url"; # Create GET request
|
||||||
} else { # It's a POST
|
} else { # It's a POST
|
||||||
|
|
|
||||||
|
|
@ -1290,7 +1290,7 @@ sub www_getCompareListData {
|
||||||
{ value=>$result->{$listingId_safe} },defaultValue=>0)->getValueAsHtml;
|
{ value=>$result->{$listingId_safe} },defaultValue=>0)->getValueAsHtml;
|
||||||
}
|
}
|
||||||
if($session->scratch->get('stickied_'.$result->{attributeId})){
|
if($session->scratch->get('stickied_'.$result->{attributeId})){
|
||||||
# $self->session->errorHandler->warn("found checked stickie: ".$result->{attributeId});
|
# $self->session->log->warn("found checked stickie: ".$result->{attributeId});
|
||||||
$result->{checked} = 'checked';
|
$result->{checked} = 'checked';
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
|
|
|
||||||
|
|
@ -431,7 +431,7 @@ sub view {
|
||||||
my $absoluteDepthOfFirstPage; # Will set on first iteration of loop, below
|
my $absoluteDepthOfFirstPage; # Will set on first iteration of loop, below
|
||||||
my %lastChildren;
|
my %lastChildren;
|
||||||
my $previousPageData = undef;
|
my $previousPageData = undef;
|
||||||
my $eh = $self->session->errorHandler;
|
my $eh = $self->session->log;
|
||||||
while ( 1 ) {
|
while ( 1 ) {
|
||||||
my $asset;
|
my $asset;
|
||||||
eval { $asset = $assetIter->() };
|
eval { $asset = $assetIter->() };
|
||||||
|
|
|
||||||
|
|
@ -537,7 +537,7 @@ sub view {
|
||||||
$var{graphUrl} = $storage->getUrl($filename);
|
$var{graphUrl} = $storage->getUrl($filename);
|
||||||
$var{hasImageGraph} = 1;
|
$var{hasImageGraph} = 1;
|
||||||
} else {
|
} else {
|
||||||
$self->session->errorHandler->error('The graph configuration hash of the Poll ('.$self->getUrl.') is corrupt.');
|
$self->session->log->error('The graph configuration hash of the Poll ('.$self->getUrl.') is corrupt.');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -90,7 +90,7 @@ property groupToAdd => (
|
||||||
sub _addDaysForMonth {
|
sub _addDaysForMonth {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
my $dt = $self->session->datetime;
|
my $dt = $self->session->datetime;
|
||||||
my $eh = $self->session->errorHandler;
|
my $eh = $self->session->log;
|
||||||
|
|
||||||
my $days_loop = $_[0];
|
my $days_loop = $_[0];
|
||||||
my $hash = $_[1];
|
my $hash = $_[1];
|
||||||
|
|
@ -273,7 +273,7 @@ sub _htmlOfResourceList {
|
||||||
$subvar->{resourceName} = WebGUI::HTML::format($displayName, 'text');
|
$subvar->{resourceName} = WebGUI::HTML::format($displayName, 'text');
|
||||||
$subvar->{resourceIcon} = 'users.gif';
|
$subvar->{resourceIcon} = 'users.gif';
|
||||||
} else {
|
} else {
|
||||||
$self->session->errorHandler->fatal("Unknown kind of resource '$resourceKind'!");
|
$self->session->log->fatal("Unknown kind of resource '$resourceKind'!");
|
||||||
}
|
}
|
||||||
|
|
||||||
push @{$var->{resourceLoop}}, $subvar;
|
push @{$var->{resourceLoop}}, $subvar;
|
||||||
|
|
@ -423,7 +423,7 @@ sub _updateDependantDates {
|
||||||
my $pred = $taskHash->{$predecessor};
|
my $pred = $taskHash->{$predecessor};
|
||||||
unless ($pred) {
|
unless ($pred) {
|
||||||
# Predecessor has to have a lower sequence number, right? Right?
|
# Predecessor has to have a lower sequence number, right? Right?
|
||||||
$self->session->errorHandler->error("Internal: predecessor '$predecessor' of task with seqNum '$seqNum' not in task hash?!");
|
$self->session->log->error("Internal: predecessor '$predecessor' of task with seqNum '$seqNum' not in task hash?!");
|
||||||
next;
|
next;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -655,7 +655,7 @@ sub setSessionVars {
|
||||||
sub updateProjectTask {
|
sub updateProjectTask {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
my $db = $self->session->db;
|
my $db = $self->session->db;
|
||||||
my $eh = $self->session->errorHandler;
|
my $eh = $self->session->log;
|
||||||
|
|
||||||
my $taskId = $_[0];
|
my $taskId = $_[0];
|
||||||
my $projectId = $_[1];
|
my $projectId = $_[1];
|
||||||
|
|
@ -726,7 +726,7 @@ sub view {
|
||||||
|
|
||||||
my ($session,$privilege,$form,$db,$datetime,$i18n,$user) = $self->setSessionVars;
|
my ($session,$privilege,$form,$db,$datetime,$i18n,$user) = $self->setSessionVars;
|
||||||
my $config = $session->config;
|
my $config = $session->config;
|
||||||
my $eh = $session->errorHandler;
|
my $eh = $session->log;
|
||||||
|
|
||||||
$var->{'extras'} = $session->url->make_urlmap_work($config->get("extrasURL"))."/wobject/ProjectManager";
|
$var->{'extras'} = $session->url->make_urlmap_work($config->get("extrasURL"))."/wobject/ProjectManager";
|
||||||
$var->{'project.create'} = $self->getUrl("func=editProject;projectId=new");
|
$var->{'project.create'} = $self->getUrl("func=editProject;projectId=new");
|
||||||
|
|
@ -871,7 +871,7 @@ sub www_drawGanttChart {
|
||||||
my ($session,$privilege,$form,$db,$dt,$i18n,$user) = $self->setSessionVars;
|
my ($session,$privilege,$form,$db,$dt,$i18n,$user) = $self->setSessionVars;
|
||||||
my $config = $session->config;
|
my $config = $session->config;
|
||||||
my $style = $session->style;
|
my $style = $session->style;
|
||||||
my $eh = $session->errorHandler;
|
my $eh = $session->log;
|
||||||
|
|
||||||
#Set up some the task data
|
#Set up some the task data
|
||||||
my $projectId = $_[0];
|
my $projectId = $_[0];
|
||||||
|
|
@ -1236,7 +1236,7 @@ sub www_editProjectSave {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
#Set Method Helpers
|
#Set Method Helpers
|
||||||
my ($session,$privilege,$form,$db,$dt,$i18n,$user) = $self->setSessionVars;
|
my ($session,$privilege,$form,$db,$dt,$i18n,$user) = $self->setSessionVars;
|
||||||
my $eh = $session->errorHandler;
|
my $eh = $session->log;
|
||||||
|
|
||||||
#Check Privileges
|
#Check Privileges
|
||||||
return $privilege->insufficient unless $self->_userCanManageProjectList($user);
|
return $privilege->insufficient unless $self->_userCanManageProjectList($user);
|
||||||
|
|
@ -1509,7 +1509,7 @@ sub www_editTaskSave {
|
||||||
#Set Method Helpers
|
#Set Method Helpers
|
||||||
my ($session,$privilege,$form,$db,$dt,$i18n,$user) = $self->setSessionVars;
|
my ($session,$privilege,$form,$db,$dt,$i18n,$user) = $self->setSessionVars;
|
||||||
my $config = $session->config;
|
my $config = $session->config;
|
||||||
my $eh = $session->errorHandler;
|
my $eh = $session->log;
|
||||||
|
|
||||||
my $projectId = $form->get("projectId");
|
my $projectId = $form->get("projectId");
|
||||||
my $project = $db->quickHashRef("select * from PM_project where projectId=".$db->quote($projectId));
|
my $project = $db->quickHashRef("select * from PM_project where projectId=".$db->quote($projectId));
|
||||||
|
|
@ -1706,7 +1706,7 @@ sub www_viewProject {
|
||||||
my $user = $session->user;
|
my $user = $session->user;
|
||||||
my $config = $session->config;
|
my $config = $session->config;
|
||||||
my $style = $session->style;
|
my $style = $session->style;
|
||||||
my $eh = $session->errorHandler;
|
my $eh = $session->log;
|
||||||
my $projectId = shift || $form->get("projectId");
|
my $projectId = shift || $form->get("projectId");
|
||||||
|
|
||||||
#Check Privileges
|
#Check Privileges
|
||||||
|
|
|
||||||
|
|
@ -555,7 +555,7 @@ sub _processQuery {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! $self->{_query}{$nr}{dbQuery} || $self->{_query}{$nr}{dbQuery} =~ m{\A \s* \Z}msx) {
|
if (! $self->{_query}{$nr}{dbQuery} || $self->{_query}{$nr}{dbQuery} =~ m{\A \s* \Z}msx) {
|
||||||
$self->session->errorHandler->warn("No query specified for query $nr on '" . $self->getId . "'");
|
$self->session->log->warn("No query specified for query $nr on '" . $self->getId . "'");
|
||||||
push @{$self->{_debug_loop}}, { 'debug.output' => sprintf($i18n->get('No query specified for query'), $nr) };
|
push @{$self->{_debug_loop}}, { 'debug.output' => sprintf($i18n->get('No query specified for query'), $nr) };
|
||||||
return \%var;
|
return \%var;
|
||||||
}
|
}
|
||||||
|
|
@ -575,7 +575,7 @@ sub _processQuery {
|
||||||
push(@{$self->{_debug_loop}},{'debug.output'=>$i18n->get('debug placeholder parameters').join(",",@$placeholderParams)});
|
push(@{$self->{_debug_loop}},{'debug.output'=>$i18n->get('debug placeholder parameters').join(",",@$placeholderParams)});
|
||||||
my $dbLink = WebGUI::DatabaseLink->new($self->session,$self->{_query}{$nr}{databaseLinkId});
|
my $dbLink = WebGUI::DatabaseLink->new($self->session,$self->{_query}{$nr}{databaseLinkId});
|
||||||
if (!$dbLink) {
|
if (!$dbLink) {
|
||||||
$self->session->errorHandler->error("Could not find database link for query #$nr: '".$self->{_query}{$nr}{databaseLinkId}."'. Has it been created?");
|
$self->session->log->error("Could not find database link for query #$nr: '".$self->{_query}{$nr}{databaseLinkId}."'. Has it been created?");
|
||||||
push @{$self->{_debug_loop}}, { 'debug.output' => 'Could not find database link'};
|
push @{$self->{_debug_loop}}, { 'debug.output' => 'Could not find database link'};
|
||||||
return \%var;
|
return \%var;
|
||||||
}
|
}
|
||||||
|
|
@ -618,7 +618,7 @@ sub _processQuery {
|
||||||
my $p = WebGUI::Paginator->new($self->session,$url,$paginateAfter, undef, $paginatePage);
|
my $p = WebGUI::Paginator->new($self->session,$url,$paginateAfter, undef, $paginatePage);
|
||||||
my $error = $p->setDataByQuery($query,$dbh,1,$placeholderParams);
|
my $error = $p->setDataByQuery($query,$dbh,1,$placeholderParams);
|
||||||
if ($error ne "") {
|
if ($error ne "") {
|
||||||
$self->session->errorHandler->warn("There was a problem with the query: ".$error);
|
$self->session->log->warn("There was a problem with the query: ".$error);
|
||||||
push(@{$self->{_debug_loop}},{'debug.output'=>$i18n->get(11)." ".$error});
|
push(@{$self->{_debug_loop}},{'debug.output'=>$i18n->get(11)." ".$error});
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
@ -670,12 +670,12 @@ sub _processQuery {
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
push(@{$self->{_debug_loop}},{'debug.output'=>$i18n->get(10)});
|
push(@{$self->{_debug_loop}},{'debug.output'=>$i18n->get(10)});
|
||||||
$self->session->errorHandler->warn("SQLReport [".$self->getId."] The SQL query is improperly formatted.");
|
$self->session->log->warn("SQLReport [".$self->getId."] The SQL query is improperly formatted.");
|
||||||
}
|
}
|
||||||
$dbLink->disconnect;
|
$dbLink->disconnect;
|
||||||
} else {
|
} else {
|
||||||
push(@{$self->{_debug_loop}},{'debug.output'=>$i18n->get(12)});
|
push(@{$self->{_debug_loop}},{'debug.output'=>$i18n->get(12)});
|
||||||
$self->session->errorHandler->warn("SQLReport [".$self->getId."] Could not connect to database.");
|
$self->session->log->warn("SQLReport [".$self->getId."] Could not connect to database.");
|
||||||
}
|
}
|
||||||
return \%var;
|
return \%var;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -299,7 +299,7 @@ sub view {
|
||||||
PRODUCT: foreach my $id (@productIds) {
|
PRODUCT: foreach my $id (@productIds) {
|
||||||
my $asset = WebGUI::Asset->newById($session, $id);
|
my $asset = WebGUI::Asset->newById($session, $id);
|
||||||
if (!defined $asset) {
|
if (!defined $asset) {
|
||||||
$session->errorHandler->error(q|Couldn't instanciate SKU with assetId |.$id.q| on shelf with assetId |.$self->getId);
|
$session->log->error(q|Couldn't instanciate SKU with assetId |.$id.q| on shelf with assetId |.$self->getId);
|
||||||
next PRODUCT;
|
next PRODUCT;
|
||||||
}
|
}
|
||||||
push @products, $asset if $asset->canView;
|
push @products, $asset if $asset->canView;
|
||||||
|
|
|
||||||
|
|
@ -71,7 +71,7 @@ sub addField {
|
||||||
my $dbDataType = shift || $self->_getDbDataType($field->{fieldType});
|
my $dbDataType = shift || $self->_getDbDataType($field->{fieldType});
|
||||||
my $session = $self->session;
|
my $session = $self->session;
|
||||||
my $db = $session->db;
|
my $db = $session->db;
|
||||||
my $error = $session->errorHandler;
|
my $error = $session->log;
|
||||||
my ($oldFieldId, $newFieldId,$useAssetId,$useSequence);
|
my ($oldFieldId, $newFieldId,$useAssetId,$useSequence);
|
||||||
|
|
||||||
$error->info("Adding Field, label: ".$field->{label}.", fieldId: ".$field->{fieldId}.",thingId: ".$field->{thingId});
|
$error->info("Adding Field, label: ".$field->{label}.", fieldId: ".$field->{fieldId}.",thingId: ".$field->{thingId});
|
||||||
|
|
@ -125,7 +125,7 @@ sub addThing {
|
||||||
my $thing = shift;
|
my $thing = shift;
|
||||||
my $isImport = shift;
|
my $isImport = shift;
|
||||||
my $db = $self->session->db;
|
my $db = $self->session->db;
|
||||||
my $error = $self->session->errorHandler;
|
my $error = $self->session->log;
|
||||||
my ($oldThingId, $newThingId,$useAssetId);
|
my ($oldThingId, $newThingId,$useAssetId);
|
||||||
|
|
||||||
$error->info("Adding Thing, label: ".$thing->{label}.", id: ".$thing->{thingId});
|
$error->info("Adding Thing, label: ".$thing->{label}.", id: ".$thing->{thingId});
|
||||||
|
|
@ -376,7 +376,7 @@ sub deleteField {
|
||||||
my $thingId = shift;
|
my $thingId = shift;
|
||||||
my $keepSequenceNumbers = shift;
|
my $keepSequenceNumbers = shift;
|
||||||
my $db = $self->session->db;
|
my $db = $self->session->db;
|
||||||
my $error = $self->session->errorHandler;
|
my $error = $self->session->log;
|
||||||
my $deletedSequenceNumber;
|
my $deletedSequenceNumber;
|
||||||
|
|
||||||
if ($keepSequenceNumbers ne "1"){
|
if ($keepSequenceNumbers ne "1"){
|
||||||
|
|
@ -521,7 +521,7 @@ sub deleteThing {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
my $thingId = shift;
|
my $thingId = shift;
|
||||||
my $session = $self->session;
|
my $session = $self->session;
|
||||||
my $error = $session->errorHandler;
|
my $error = $session->log;
|
||||||
|
|
||||||
$self->deleteCollateral("Thingy_things","thingId",$thingId);
|
$self->deleteCollateral("Thingy_things","thingId",$thingId);
|
||||||
$self->deleteCollateral("Thingy_fields","thingId",$thingId);
|
$self->deleteCollateral("Thingy_fields","thingId",$thingId);
|
||||||
|
|
@ -1260,7 +1260,7 @@ sub importAssetCollateralData {
|
||||||
|
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
my $session = $self->session;
|
my $session = $self->session;
|
||||||
my $error = $session->errorHandler;
|
my $error = $session->log;
|
||||||
my $data = shift;
|
my $data = shift;
|
||||||
my $id = $data->{properties}{assetId};
|
my $id = $data->{properties}{assetId};
|
||||||
my $class = $data->{properties}{className};
|
my $class = $data->{properties}{className};
|
||||||
|
|
@ -1433,7 +1433,7 @@ sub _updateFieldType {
|
||||||
|
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
my $session = $self->session;
|
my $session = $self->session;
|
||||||
my $error = $session->errorHandler;
|
my $error = $session->log;
|
||||||
|
|
||||||
my $newFieldType = shift;
|
my $newFieldType = shift;
|
||||||
my $fieldId = shift;
|
my $fieldId = shift;
|
||||||
|
|
@ -1721,7 +1721,7 @@ sub www_editThing {
|
||||||
foreach my $fieldType ( keys %{ WebGUI::Form::FieldType->new($session)->getTypes }) {
|
foreach my $fieldType ( keys %{ WebGUI::Form::FieldType->new($session)->getTypes }) {
|
||||||
my $form = eval { WebGUI::Pluggable::instanciate("WebGUI::Form::".$fieldType, "new", [$session]) };
|
my $form = eval { WebGUI::Pluggable::instanciate("WebGUI::Form::".$fieldType, "new", [$session]) };
|
||||||
if ($@) {
|
if ($@) {
|
||||||
$session->errorHandler->error($@);
|
$session->log->error($@);
|
||||||
next;
|
next;
|
||||||
}
|
}
|
||||||
my $definition = $form->definition($session);
|
my $definition = $form->definition($session);
|
||||||
|
|
@ -2789,7 +2789,7 @@ sub www_import {
|
||||||
push(@insertColumns, $field) if ($session->form->process("fileContains_".$field->{fieldId}));
|
push(@insertColumns, $field) if ($session->form->process("fileContains_".$field->{fieldId}));
|
||||||
}
|
}
|
||||||
|
|
||||||
my $error = $self->session->errorHandler;
|
my $error = $self->session->log;
|
||||||
my $storage = WebGUI::Storage->createTemp($self->session);
|
my $storage = WebGUI::Storage->createTemp($self->session);
|
||||||
$handleDuplicates = $session->form->process("handleDuplicates");
|
$handleDuplicates = $session->form->process("handleDuplicates");
|
||||||
|
|
||||||
|
|
@ -3038,7 +3038,7 @@ sub www_moveFieldConfirm {
|
||||||
my $session = $self->session;
|
my $session = $self->session;
|
||||||
return $session->privilege->insufficient() unless $self->canEdit;
|
return $session->privilege->insufficient() unless $self->canEdit;
|
||||||
|
|
||||||
my $error = $self->session->errorHandler;
|
my $error = $self->session->log;
|
||||||
my $direction = $session->form->process('direction');
|
my $direction = $session->form->process('direction');
|
||||||
my $assetId = $self->getId;
|
my $assetId = $self->getId;
|
||||||
my $fieldId = $session->form->process('fieldId');
|
my $fieldId = $session->form->process('fieldId');
|
||||||
|
|
@ -3290,7 +3290,7 @@ sequenceNumber');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
$self->session->errorHandler->warn("The default Thing has no fields selected to display in the search.");
|
$self->session->log->warn("The default Thing has no fields selected to display in the search.");
|
||||||
$noFields = 1;
|
$noFields = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -120,7 +120,7 @@ sub getDaysInWeek {
|
||||||
my $week = $_[0];
|
my $week = $_[0];
|
||||||
return [] unless $week;
|
return [] unless $week;
|
||||||
|
|
||||||
my ($session,$dt,$eh) = $self->getSessionVars("datetime","errorHandler");
|
my ($session,$dt,$eh) = $self->getSessionVars("datetime","log");
|
||||||
my $i18n = WebGUI::International->new($session,'Asset_TimeTracking');
|
my $i18n = WebGUI::International->new($session,'Asset_TimeTracking');
|
||||||
|
|
||||||
#Week View Below
|
#Week View Below
|
||||||
|
|
@ -169,7 +169,7 @@ sub view {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
my $var = $self->get;
|
my $var = $self->get;
|
||||||
|
|
||||||
my ($session,$privilege,$form,$db,$dt,$user,$eh,$config) = $self->getSessionVars("privilege","form","db","datetime","user","errorHandler","config");
|
my ($session,$privilege,$form,$db,$dt,$user,$eh,$config) = $self->getSessionVars("privilege","form","db","datetime","user","log","config");
|
||||||
my $i18n = WebGUI::International->new($session,'Asset_TimeTracking');
|
my $i18n = WebGUI::International->new($session,'Asset_TimeTracking');
|
||||||
$var->{'extras'} = $session->url->make_urlmap_work($config->get("extrasURL"))."/wobject/TimeTracking";
|
$var->{'extras'} = $session->url->make_urlmap_work($config->get("extrasURL"))."/wobject/TimeTracking";
|
||||||
|
|
||||||
|
|
@ -210,7 +210,7 @@ sub view {
|
||||||
|
|
||||||
sub www_editTimeEntrySave {
|
sub www_editTimeEntrySave {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
my ($session,$privilege,$form,$db,$user,$eh,$dt) = $self->getSessionVars("privilege","form","db","user","errorHandler","datetime");
|
my ($session,$privilege,$form,$db,$user,$eh,$dt) = $self->getSessionVars("privilege","form","db","user","log","datetime");
|
||||||
|
|
||||||
return $privilege->insufficient unless ($self->canView);
|
return $privilege->insufficient unless ($self->canView);
|
||||||
|
|
||||||
|
|
@ -289,7 +289,7 @@ sub www_editTimeEntrySave {
|
||||||
|
|
||||||
sub www_deleteProject {
|
sub www_deleteProject {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
my ($session,$privilege,$form,$db,$user,$eh,$config) = $self->getSessionVars("privilege","form","db","user","errorHandler","config");
|
my ($session,$privilege,$form,$db,$user,$eh,$config) = $self->getSessionVars("privilege","form","db","user","log","config");
|
||||||
my $i18n = WebGUI::International->new($session,'Asset_TimeTracking');
|
my $i18n = WebGUI::International->new($session,'Asset_TimeTracking');
|
||||||
|
|
||||||
#Check Privileges
|
#Check Privileges
|
||||||
|
|
@ -316,7 +316,7 @@ sub www_deleteProject {
|
||||||
|
|
||||||
sub www_editProject {
|
sub www_editProject {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
my ($session,$privilege,$form,$db,$user,$eh,$config) = $self->getSessionVars("privilege","form","db","user","errorHandler","config");
|
my ($session,$privilege,$form,$db,$user,$eh,$config) = $self->getSessionVars("privilege","form","db","user","log","config");
|
||||||
my $i18n = WebGUI::International->new($session,'Asset_TimeTracking');
|
my $i18n = WebGUI::International->new($session,'Asset_TimeTracking');
|
||||||
|
|
||||||
#Check Privileges
|
#Check Privileges
|
||||||
|
|
@ -421,7 +421,7 @@ sub www_editProject {
|
||||||
|
|
||||||
sub www_editProjectSave {
|
sub www_editProjectSave {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
my ($session,$privilege,$form,$db,$dt,$user,$eh) = $self->getSessionVars("privilege","form","db","datetime","user","errorHandler");
|
my ($session,$privilege,$form,$db,$dt,$user,$eh) = $self->getSessionVars("privilege","form","db","datetime","user","log");
|
||||||
my $i18n = WebGUI::International->new($session,'Asset_TimeTracking');
|
my $i18n = WebGUI::International->new($session,'Asset_TimeTracking');
|
||||||
|
|
||||||
#Check Privileges
|
#Check Privileges
|
||||||
|
|
@ -486,7 +486,7 @@ sub www_editProjectSave {
|
||||||
|
|
||||||
sub www_manageProjects {
|
sub www_manageProjects {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
my ($session,$privilege,$form,$db,$dt,$user,$eh,$config) = $self->getSessionVars("privilege","form","db","datetime","user","errorHandler","config");
|
my ($session,$privilege,$form,$db,$dt,$user,$eh,$config) = $self->getSessionVars("privilege","form","db","datetime","user","log","config");
|
||||||
my $i18n = WebGUI::International->new($session,'Asset_TimeTracking');
|
my $i18n = WebGUI::International->new($session,'Asset_TimeTracking');
|
||||||
|
|
||||||
#Check Privileges
|
#Check Privileges
|
||||||
|
|
@ -615,7 +615,7 @@ sub www_buildTimeTable {
|
||||||
my $viewVar = $_[0];
|
my $viewVar = $_[0];
|
||||||
my $var = {};
|
my $var = {};
|
||||||
$var->{'extras'} = $viewVar->{'extras'};
|
$var->{'extras'} = $viewVar->{'extras'};
|
||||||
my ($session,$dt,$eh,$form,$db,$user,$privilege) = $self->getSessionVars("datetime","errorHandler","form","db","user","privilege");
|
my ($session,$dt,$eh,$form,$db,$user,$privilege) = $self->getSessionVars("datetime","log","form","db","user","privilege");
|
||||||
my $i18n = WebGUI::International->new($session,'Asset_TimeTracking');
|
my $i18n = WebGUI::International->new($session,'Asset_TimeTracking');
|
||||||
|
|
||||||
return $privilege->insufficient unless ($self->canView);
|
return $privilege->insufficient unless ($self->canView);
|
||||||
|
|
@ -785,7 +785,7 @@ sub www_buildTimeTable {
|
||||||
|
|
||||||
sub _buildRow {
|
sub _buildRow {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
my ($session,$dt,$eh,$form,$db,$user) = $self->getSessionVars("datetime","errorHandler","form","db","user");
|
my ($session,$dt,$eh,$form,$db,$user) = $self->getSessionVars("datetime","log","form","db","user");
|
||||||
my $i18n = WebGUI::International->new($session,'Asset_TimeTracking');
|
my $i18n = WebGUI::International->new($session,'Asset_TimeTracking');
|
||||||
|
|
||||||
my $entry = $_[0] || {};
|
my $entry = $_[0] || {};
|
||||||
|
|
|
||||||
|
|
@ -243,7 +243,7 @@ sub getFormElement {
|
||||||
my $values = WebGUI::Operation::Shared::secureEval($self->session,$data->{possibleValues});
|
my $values = WebGUI::Operation::Shared::secureEval($self->session,$data->{possibleValues});
|
||||||
unless (ref $values eq 'HASH') {
|
unless (ref $values eq 'HASH') {
|
||||||
if ($self->possibleValues =~ /\S/) {
|
if ($self->possibleValues =~ /\S/) {
|
||||||
$self->session->errorHandler->warn("Could not get a hash out of possible values for profile field "
|
$self->session->log->warn("Could not get a hash out of possible values for profile field "
|
||||||
.$self->getId);
|
.$self->getId);
|
||||||
}
|
}
|
||||||
$values = {};
|
$values = {};
|
||||||
|
|
|
||||||
|
|
@ -294,7 +294,7 @@ sub appendRecentChanges {
|
||||||
while (my ($id, $version) = $revisions->array) {
|
while (my ($id, $version) = $revisions->array) {
|
||||||
my $asset = WebGUI::Asset->newById($self->session, $id, $version);
|
my $asset = WebGUI::Asset->newById($self->session, $id, $version);
|
||||||
unless (defined $asset) {
|
unless (defined $asset) {
|
||||||
$self->session->errorHandler->error("Asset $id $version could not be instanciated.");
|
$self->session->log->error("Asset $id $version could not be instanciated.");
|
||||||
next;
|
next;
|
||||||
}
|
}
|
||||||
my $user = WebGUI::User->new($self->session, $asset->actionTakenBy);
|
my $user = WebGUI::User->new($self->session, $asset->actionTakenBy);
|
||||||
|
|
|
||||||
|
|
@ -77,7 +77,7 @@ sub addChild {
|
||||||
|
|
||||||
# Check if it is possible to add a child to this asset. If not add it as a sibling of this asset.
|
# Check if it is possible to add a child to this asset. If not add it as a sibling of this asset.
|
||||||
if (length($self->lineage) >= 252) {
|
if (length($self->lineage) >= 252) {
|
||||||
$session->errorHandler->warn('Tried to add child to asset "'.$self->getId.'" which is already on the deepest level. Adding it as a sibling instead.');
|
$session->log->warn('Tried to add child to asset "'.$self->getId.'" which is already on the deepest level. Adding it as a sibling instead.');
|
||||||
return $self->getParent->addChild($properties, $id, $now, $options);
|
return $self->getParent->addChild($properties, $id, $now, $options);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -483,7 +483,7 @@ sub getLineage {
|
||||||
} else {
|
} else {
|
||||||
$asset = WebGUI::Asset->newById($session, $id, $version);
|
$asset = WebGUI::Asset->newById($session, $id, $version);
|
||||||
if (!defined $asset) { # won't catch everything, but it will help some if an asset blows up
|
if (!defined $asset) { # won't catch everything, but it will help some if an asset blows up
|
||||||
$session->errorHandler->error("AssetLineage::getLineage - failed to instanciate asset with assetId $id, className $class, and revision $version");
|
$session->log->error("AssetLineage::getLineage - failed to instanciate asset with assetId $id, className $class, and revision $version");
|
||||||
next ASSET;
|
next ASSET;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -693,7 +693,7 @@ sub getLineageSql {
|
||||||
my $className = $rules->{joinClass};
|
my $className = $rules->{joinClass};
|
||||||
(my $module = $className . '.pm') =~ s{::|'}{/}g;
|
(my $module = $className . '.pm') =~ s{::|'}{/}g;
|
||||||
if ( ! eval { require $module; 1 }) {
|
if ( ! eval { require $module; 1 }) {
|
||||||
$self->session->errorHandler->fatal("Couldn't compile asset package: ".$className.". Root cause: ".$@) if ($@);
|
$self->session->log->fatal("Couldn't compile asset package: ".$className.". Root cause: ".$@) if ($@);
|
||||||
}
|
}
|
||||||
foreach my $table ($className->meta->get_tables) {
|
foreach my $table ($className->meta->get_tables) {
|
||||||
unless ($table eq "asset" || $table eq "assetData") {
|
unless ($table eq "asset" || $table eq "assetData") {
|
||||||
|
|
@ -780,7 +780,7 @@ sub getNextChildRank {
|
||||||
my $rank;
|
my $rank;
|
||||||
if (defined $lineage) {
|
if (defined $lineage) {
|
||||||
$rank = $self->getRank($lineage);
|
$rank = $self->getRank($lineage);
|
||||||
$self->session->errorHandler->fatal("Asset ".$self->getId." has too many children.") if ($rank >= 999998);
|
$self->session->log->fatal("Asset ".$self->getId." has too many children.") if ($rank >= 999998);
|
||||||
$rank++;
|
$rank++;
|
||||||
} else {
|
} else {
|
||||||
$rank = 1;
|
$rank = 1;
|
||||||
|
|
|
||||||
|
|
@ -154,7 +154,7 @@ sub importAssetData {
|
||||||
my $session = $self->session;
|
my $session = $self->session;
|
||||||
my $data = shift;
|
my $data = shift;
|
||||||
my $options = shift || {};
|
my $options = shift || {};
|
||||||
my $error = $session->errorHandler;
|
my $error = $session->log;
|
||||||
my $id = $data->{properties}{assetId};
|
my $id = $data->{properties}{assetId};
|
||||||
my $class = $data->{properties}{className};
|
my $class = $data->{properties}{className};
|
||||||
my $version = $options->{overwriteLatest} ? time : $data->{properties}{revisionDate};
|
my $version = $options->{overwriteLatest} ? time : $data->{properties}{revisionDate};
|
||||||
|
|
@ -264,7 +264,7 @@ sub importPackage {
|
||||||
return undef
|
return undef
|
||||||
if $storage->getErrorCount;
|
if $storage->getErrorCount;
|
||||||
my $package = undef; # The asset package
|
my $package = undef; # The asset package
|
||||||
my $error = $self->session->errorHandler;
|
my $error = $self->session->log;
|
||||||
|
|
||||||
# The debug output for long requests would be too long, and we'd have to
|
# The debug output for long requests would be too long, and we'd have to
|
||||||
# keep it all in memory.
|
# keep it all in memory.
|
||||||
|
|
@ -335,7 +335,7 @@ sub www_deployPackage {
|
||||||
if (defined $packageMasterAssetId) {
|
if (defined $packageMasterAssetId) {
|
||||||
my $packageMasterAsset = WebGUI::Asset->newById($session, $packageMasterAssetId);
|
my $packageMasterAsset = WebGUI::Asset->newById($session, $packageMasterAssetId);
|
||||||
unless ($packageMasterAsset->get('isPackage')) { #only deploy packages
|
unless ($packageMasterAsset->get('isPackage')) { #only deploy packages
|
||||||
$session->errorHandler->security('deploy an asset as a package which was not set as a package.');
|
$session->log->security('deploy an asset as a package which was not set as a package.');
|
||||||
return undef;
|
return undef;
|
||||||
}
|
}
|
||||||
my $masterLineage = $packageMasterAsset->get("lineage");
|
my $masterLineage = $packageMasterAsset->get("lineage");
|
||||||
|
|
|
||||||
|
|
@ -117,7 +117,7 @@ sub purge {
|
||||||
# can't delete if it's one of these things
|
# can't delete if it's one of these things
|
||||||
if ($self->getId eq $session->setting->get("defaultPage") || $self->getId eq $session->setting->get("notFoundPage") || $self->get("isSystem")) {
|
if ($self->getId eq $session->setting->get("defaultPage") || $self->getId eq $session->setting->get("notFoundPage") || $self->get("isSystem")) {
|
||||||
$outputSub->(sprintf $i18n->get('Trying to delete system page %s. Aborting'), $self->getTitle);
|
$outputSub->(sprintf $i18n->get('Trying to delete system page %s. Aborting'), $self->getTitle);
|
||||||
$session->errorHandler->security("delete a system protected page (".$self->getId.")");
|
$session->log->security("delete a system protected page (".$self->getId.")");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -135,7 +135,7 @@ sub purge {
|
||||||
}
|
}
|
||||||
last unless $child;
|
last unless $child;
|
||||||
unless ($child->purge) {
|
unless ($child->purge) {
|
||||||
$session->errorHandler->security("delete one of (".$self->getId.")'s children which is a system protected page");
|
$session->log->security("delete one of (".$self->getId.")'s children which is a system protected page");
|
||||||
$outputSub->(sprintf $i18n->get('Trying to delete system page %s. Aborting'), $self->getTitle);
|
$outputSub->(sprintf $i18n->get('Trying to delete system page %s. Aborting'), $self->getTitle);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
@ -242,7 +242,7 @@ sub trash {
|
||||||
|
|
||||||
if ($self->getId eq $session->setting->get("defaultPage") || $self->getId eq $session->setting->get("notFoundPage") || $self->get('isSystem')) {
|
if ($self->getId eq $session->setting->get("defaultPage") || $self->getId eq $session->setting->get("notFoundPage") || $self->get('isSystem')) {
|
||||||
$outputSub->(sprintf $i18n->get('Trying to delete system page %s. Aborting'), $self->getTitle);
|
$outputSub->(sprintf $i18n->get('Trying to delete system page %s. Aborting'), $self->getTitle);
|
||||||
$session->errorHandler->security("delete a system protected page (".$self->getId.")");
|
$session->log->security("delete a system protected page (".$self->getId.")");
|
||||||
return undef;
|
return undef;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -862,7 +862,7 @@ sub login {
|
||||||
if ($command ne "") {
|
if ($command ne "") {
|
||||||
WebGUI::Macro::process($self->session,\$command);
|
WebGUI::Macro::process($self->session,\$command);
|
||||||
my $error = qx($command);
|
my $error = qx($command);
|
||||||
$self->session->errorHandler->warn($error) if $error;
|
$self->session->log->warn($error) if $error;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -912,7 +912,7 @@ sub logout {
|
||||||
if ($command ne "") {
|
if ($command ne "") {
|
||||||
WebGUI::Macro::process($self->session,\$command);
|
WebGUI::Macro::process($self->session,\$command);
|
||||||
my $error = qx($command);
|
my $error = qx($command);
|
||||||
$self->session->errorHandler->warn($error) if $error;
|
$self->session->log->warn($error) if $error;
|
||||||
}
|
}
|
||||||
|
|
||||||
# Do not allow caching of the logout page (to ensure the page gets requested)
|
# Do not allow caching of the logout page (to ensure the page gets requested)
|
||||||
|
|
@ -1093,7 +1093,7 @@ sub timeRecordSession {
|
||||||
} else {
|
} else {
|
||||||
# If something strange happened and we ended up with > 1 matching rows, cut our losses and remove offending userLoginLog rows (otherwise we
|
# If something strange happened and we ended up with > 1 matching rows, cut our losses and remove offending userLoginLog rows (otherwise we
|
||||||
# could end up with ridiculously long user recorded times)
|
# could end up with ridiculously long user recorded times)
|
||||||
$self->session->errorHandler->warn("More than 1 old userLoginLog rows found, removing offending rows");
|
$self->session->log->warn("More than 1 old userLoginLog rows found, removing offending rows");
|
||||||
$self->session->db->write("delete from userLoginLog where lastPageViewed = timeStamp and sessionId = ? ", [$self->session->getId] );
|
$self->session->db->write("delete from userLoginLog where lastPageViewed = timeStamp and sessionId = ? ", [$self->session->getId] );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -186,7 +186,7 @@ sub authenticate {
|
||||||
$auth = $ldap->bind(dn=>$self->{_connectDN}, password=>$identifier);
|
$auth = $ldap->bind(dn=>$self->{_connectDN}, password=>$identifier);
|
||||||
my $message = "DN has been changed for user ".$_[0]." from \"".$userData->{connectDN}."\" to \"".$self->{_connectDN}."\"";
|
my $message = "DN has been changed for user ".$_[0]." from \"".$userData->{connectDN}."\" to \"".$self->{_connectDN}."\"";
|
||||||
$self->saveParams($self->user->userId, $self->authMethod, { connectDN => $self->{_connectDN} });
|
$self->saveParams($self->user->userId, $self->authMethod, { connectDN => $self->{_connectDN} });
|
||||||
$self->session->errorHandler->warn($message);
|
$self->session->log->warn($message);
|
||||||
}
|
}
|
||||||
|
|
||||||
# Authentication failed
|
# Authentication failed
|
||||||
|
|
|
||||||
|
|
@ -108,7 +108,7 @@ sub _isValidPassword {
|
||||||
|
|
||||||
sub _logSecurityMessage {
|
sub _logSecurityMessage {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
$self->session->errorHandler->security("change password. Password changed successfully");
|
$self->session->log->security("change password. Password changed successfully");
|
||||||
}
|
}
|
||||||
|
|
||||||
#-------------------------------------------------------------------
|
#-------------------------------------------------------------------
|
||||||
|
|
@ -215,7 +215,7 @@ sub createAccountSave {
|
||||||
|
|
||||||
# Make sure anonymous registration is enabled
|
# Make sure anonymous registration is enabled
|
||||||
if (!$setting->get("anonymousRegistration") && !$setting->get("inboxInviteUserEnabled")) {
|
if (!$setting->get("anonymousRegistration") && !$setting->get("inboxInviteUserEnabled")) {
|
||||||
$session->errorHandler->security($i18n->get("no registration hack", "AuthWebGUI"));
|
$session->log->security($i18n->get("no registration hack", "AuthWebGUI"));
|
||||||
return $self->displayLogin;
|
return $self->displayLogin;
|
||||||
}
|
}
|
||||||
my $username;
|
my $username;
|
||||||
|
|
@ -776,7 +776,7 @@ sub login {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
if(!$self->authenticate($self->session->form->process("username"),$self->session->form->process("identifier"))){
|
if(!$self->authenticate($self->session->form->process("username"),$self->session->form->process("identifier"))){
|
||||||
$self->session->http->setStatus(401);
|
$self->session->http->setStatus(401);
|
||||||
$self->session->errorHandler->security("login to account ".$self->session->form->process("username")." with invalid information.");
|
$self->session->log->security("login to account ".$self->session->form->process("username")." with invalid information.");
|
||||||
my $i18n = WebGUI::International->new($self->session);
|
my $i18n = WebGUI::International->new($self->session);
|
||||||
return $self->displayLogin("<h1>".$i18n->get(70)."</h1>".$self->error);
|
return $self->displayLogin("<h1>".$i18n->get(70)."</h1>".$self->error);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -103,7 +103,7 @@ sub getAsset {
|
||||||
my $assetUrl = shift;
|
my $assetUrl = shift;
|
||||||
my $asset = eval{WebGUI::Asset->newByUrl($session,$assetUrl,$session->form->process("revision"))};
|
my $asset = eval{WebGUI::Asset->newByUrl($session,$assetUrl,$session->form->process("revision"))};
|
||||||
if (Exception::Class->caught()) {
|
if (Exception::Class->caught()) {
|
||||||
$session->errorHandler->warn("Couldn't instantiate asset for url: ".$assetUrl." Root cause: ".$@);
|
$session->log->warn("Couldn't instantiate asset for url: ".$assetUrl." Root cause: ".$@);
|
||||||
}
|
}
|
||||||
return $asset;
|
return $asset;
|
||||||
}
|
}
|
||||||
|
|
@ -163,9 +163,9 @@ The content handler for this package.
|
||||||
|
|
||||||
sub handler {
|
sub handler {
|
||||||
my ($session) = @_;
|
my ($session) = @_;
|
||||||
my ($errorHandler, $http, $var, $asset, $request, $config) = $session->quick(qw(errorHandler http var asset request config));
|
my ($log, $http, $var, $asset, $request, $config) = $session->quick(qw(errorHandler http var asset request config));
|
||||||
my $output = "";
|
my $output = "";
|
||||||
if (my $perfLog = $errorHandler->performanceLogger) { #show performance indicators if required
|
if (my $perfLog = $log->performanceLogger) { #show performance indicators if required
|
||||||
my $t = [Time::HiRes::gettimeofday()];
|
my $t = [Time::HiRes::gettimeofday()];
|
||||||
$output = dispatch($session, getRequestedAssetUrl($session));
|
$output = dispatch($session, getRequestedAssetUrl($session));
|
||||||
$perfLog->({ time => Time::HiRes::tv_interval($t), type => 'Page' });
|
$perfLog->({ time => Time::HiRes::tv_interval($t), type => 'Page' });
|
||||||
|
|
|
||||||
|
|
@ -54,7 +54,7 @@ sub handler {
|
||||||
$output = eval { $notFound->www_view };
|
$output = eval { $notFound->www_view };
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$session->errorHandler->error("The notFound page could not be instanciated!");
|
$session->log->error("The notFound page could not be instanciated!");
|
||||||
$output = "An error was encountered while processing your request.";
|
$output = "An error was encountered while processing your request.";
|
||||||
}
|
}
|
||||||
$output = "An error was encountered while processing your request." if $output eq '';
|
$output = "An error was encountered while processing your request." if $output eq '';
|
||||||
|
|
|
||||||
|
|
@ -95,7 +95,7 @@ sub checkPrivileges {
|
||||||
|
|
||||||
# Check if we found any privileges at all
|
# Check if we found any privileges at all
|
||||||
if (! scalar @privileges) {
|
if (! scalar @privileges) {
|
||||||
$self->session->errorHandler->warn(
|
$self->session->log->warn(
|
||||||
sprintf( "DatabaseLink: Could not find SQL privileges or no privileges on database '%s' for user '%s' with database link ID '%s' using DSN '%s'",
|
sprintf( "DatabaseLink: Could not find SQL privileges or no privileges on database '%s' for user '%s' with database link ID '%s' using DSN '%s'",
|
||||||
$self->databaseName, $self->get->{username},
|
$self->databaseName, $self->get->{username},
|
||||||
$self->getId, $self->get->{DSN},
|
$self->getId, $self->get->{DSN},
|
||||||
|
|
@ -242,13 +242,13 @@ sub db {
|
||||||
if ($driver) {
|
if ($driver) {
|
||||||
my $dbh = WebGUI::SQL->connect($self->session,$dsn,$username,$identifier,$parameters);
|
my $dbh = WebGUI::SQL->connect($self->session,$dsn,$username,$identifier,$parameters);
|
||||||
unless (defined $dbh) {
|
unless (defined $dbh) {
|
||||||
$self->session->errorHandler->warn("Cannot connect to DatabaseLink [".$self->getId."]");
|
$self->session->log->warn("Cannot connect to DatabaseLink [".$self->getId."]");
|
||||||
}
|
}
|
||||||
$self->{_dbh} = $dbh;
|
$self->{_dbh} = $dbh;
|
||||||
return $self->{_dbh};
|
return $self->{_dbh};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$self->session->errorHandler->warn("DatabaseLink [".$self->getId."] The DSN specified is of an improper format.");
|
$self->session->log->warn("DatabaseLink [".$self->getId."] The DSN specified is of an improper format.");
|
||||||
return undef;
|
return undef;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -357,7 +357,7 @@ sub new {
|
||||||
|
|
||||||
unless (defined($databaseLink{databaseLinkId}))
|
unless (defined($databaseLink{databaseLinkId}))
|
||||||
{
|
{
|
||||||
$session->errorHandler->warn("Could not find database link '".$databaseLinkId."'");
|
$session->log->warn("Could not find database link '".$databaseLinkId."'");
|
||||||
return undef;
|
return undef;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -63,7 +63,7 @@ sub AUTOLOAD {
|
||||||
my @params = @_;
|
my @params = @_;
|
||||||
my $control = eval { WebGUI::Pluggable::instanciate("WebGUI::Form::".$name, "new", [ $session, @params ]) };
|
my $control = eval { WebGUI::Pluggable::instanciate("WebGUI::Form::".$name, "new", [ $session, @params ]) };
|
||||||
if ($@) {
|
if ($@) {
|
||||||
$session->errorHandler->error($@);
|
$session->log->error($@);
|
||||||
return undef;
|
return undef;
|
||||||
}
|
}
|
||||||
return $control->toHtml;
|
return $control->toHtml;
|
||||||
|
|
|
||||||
|
|
@ -127,7 +127,7 @@ sub getValue {
|
||||||
my $challenge = $self->session->scratch->get("captcha_".$self->get("name"));
|
my $challenge = $self->session->scratch->get("captcha_".$self->get("name"));
|
||||||
$self->session->scratch->delete("captcha_".$self->get("name"));
|
$self->session->scratch->delete("captcha_".$self->get("name"));
|
||||||
my $passed = lc $value eq lc $challenge;
|
my $passed = lc $value eq lc $challenge;
|
||||||
$self->session->errorHandler->info(
|
$self->session->log->info(
|
||||||
"Checking CAPTCHA '" . $self->get("name") . "': " . ( $passed ? "PASSED!" : "FAILED!" )
|
"Checking CAPTCHA '" . $self->get("name") . "': " . ( $passed ? "PASSED!" : "FAILED!" )
|
||||||
. " Got: '" . $value . "', Wanted: '" . $challenge . "'"
|
. " Got: '" . $value . "', Wanted: '" . $challenge . "'"
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -112,12 +112,12 @@ sub new {
|
||||||
delete $raw{fieldType};
|
delete $raw{fieldType};
|
||||||
# Return the appropriate field object.
|
# Return the appropriate field object.
|
||||||
if ($fieldType eq "") {
|
if ($fieldType eq "") {
|
||||||
$session->errorHandler->warn("Something is trying to create a dynamic field called ".$raw{name}.", but didn't pass in a field type.");
|
$session->log->warn("Something is trying to create a dynamic field called ".$raw{name}.", but didn't pass in a field type.");
|
||||||
$fieldType = "Text";
|
$fieldType = "Text";
|
||||||
}
|
}
|
||||||
##No infinite loops, please
|
##No infinite loops, please
|
||||||
elsif ($fieldType eq 'DynamicField') {
|
elsif ($fieldType eq 'DynamicField') {
|
||||||
$session->errorHandler->warn("Something is trying to create a DynamicField via DynamicField.");
|
$session->log->warn("Something is trying to create a DynamicField via DynamicField.");
|
||||||
$fieldType = "Text";
|
$fieldType = "Text";
|
||||||
}
|
}
|
||||||
return WebGUI::Pluggable::instanciate("WebGUI::Form::".$fieldType, "new", [$session, \%raw]);
|
return WebGUI::Pluggable::instanciate("WebGUI::Form::".$fieldType, "new", [$session, \%raw]);
|
||||||
|
|
|
||||||
|
|
@ -190,7 +190,7 @@ sub toHtml {
|
||||||
if (! $self->{_richEdit}) {
|
if (! $self->{_richEdit}) {
|
||||||
my $richEdit = eval { WebGUI::Asset::RichEdit->newById($self->session, $self->get("richEditId")); };
|
my $richEdit = eval { WebGUI::Asset::RichEdit->newById($self->session, $self->get("richEditId")); };
|
||||||
if (Exception::Class->caught() ) {
|
if (Exception::Class->caught() ) {
|
||||||
$self->session->errorHandler->warn($i18n->get('rich editor load error','Form_HTMLArea'));
|
$self->session->log->warn($i18n->get('rich editor load error','Form_HTMLArea'));
|
||||||
return $self->SUPER::toHtml;
|
return $self->SUPER::toHtml;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -123,7 +123,7 @@ Returns the form element used for manual input. You must overload this method.
|
||||||
sub getInputElement {
|
sub getInputElement {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
|
|
||||||
$self->session->errorHandler->fatal("Subclasses of WebGUI::Form::Slider must overload getInputElement");
|
$self->session->log->fatal("Subclasses of WebGUI::Form::Slider must overload getInputElement");
|
||||||
}
|
}
|
||||||
|
|
||||||
#-------------------------------------------------------------------
|
#-------------------------------------------------------------------
|
||||||
|
|
@ -174,7 +174,7 @@ from this class. For instance WebGUI::Form::SelectSlider.
|
||||||
sub getOnChangeInputElement {
|
sub getOnChangeInputElement {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
|
|
||||||
$self->session->errorHandler->fatal("Subclasses of WebGUI::Form::Slider must overload getOnChangeInputElement");
|
$self->session->log->fatal("Subclasses of WebGUI::Form::Slider must overload getOnChangeInputElement");
|
||||||
}
|
}
|
||||||
|
|
||||||
#-------------------------------------------------------------------
|
#-------------------------------------------------------------------
|
||||||
|
|
@ -195,7 +195,7 @@ from this class. For instance WebGUI::Form::SelectSlider.
|
||||||
sub getOnChangeSlider {
|
sub getOnChangeSlider {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
|
|
||||||
$self->session->errorHandler->fatal("Subclasses of WebGUI::Form::Slider must overload getOnChangeSlider");
|
$self->session->log->fatal("Subclasses of WebGUI::Form::Slider must overload getOnChangeSlider");
|
||||||
}
|
}
|
||||||
|
|
||||||
#-------------------------------------------------------------------
|
#-------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
|
@ -75,7 +75,7 @@ sub AUTOLOAD {
|
||||||
$params = {name=>$params} if ref ($params) ne "HASH";
|
$params = {name=>$params} if ref ($params) ne "HASH";
|
||||||
my $control = eval { WebGUI::Pluggable::instanciate("WebGUI::Form::".$name, "new", [ $self->session, $params ]) };
|
my $control = eval { WebGUI::Pluggable::instanciate("WebGUI::Form::".$name, "new", [ $self->session, $params ]) };
|
||||||
if ($@) {
|
if ($@) {
|
||||||
$self->session->errorHandler->error($@);
|
$self->session->log->error($@);
|
||||||
return undef;
|
return undef;
|
||||||
}
|
}
|
||||||
return $control->getValue(@args);
|
return $control->getValue(@args);
|
||||||
|
|
|
||||||
|
|
@ -604,7 +604,7 @@ sub getAllUsers {
|
||||||
;
|
;
|
||||||
++$loopCount;
|
++$loopCount;
|
||||||
if ($loopCount > 99) {
|
if ($loopCount > 99) {
|
||||||
$self->session->errorHandler->fatal("Endless recursive loop detected while determining groups in group.\nRequested groupId: ".$self->getId);
|
$self->session->log->fatal("Endless recursive loop detected while determining groups in group.\nRequested groupId: ".$self->getId);
|
||||||
}
|
}
|
||||||
my $groups = $self->getGroupsIn();
|
my $groups = $self->getGroupsIn();
|
||||||
foreach my $groupId (@{ $groups }) {
|
foreach my $groupId (@{ $groups }) {
|
||||||
|
|
@ -644,7 +644,7 @@ sub getDatabaseUsers {
|
||||||
my $sth = $dbh->unconditionalRead($query);
|
my $sth = $dbh->unconditionalRead($query);
|
||||||
if (defined $sth) {
|
if (defined $sth) {
|
||||||
unless ($sth->errorCode < 1) {
|
unless ($sth->errorCode < 1) {
|
||||||
$self->session->errorHandler->warn("There was a problem with the database query for group ID $gid.");
|
$self->session->log->warn("There was a problem with the database query for group ID $gid.");
|
||||||
} else {
|
} else {
|
||||||
while(my ($userId)=$sth->array) {
|
while(my ($userId)=$sth->array) {
|
||||||
push @dbUsers, $userId;
|
push @dbUsers, $userId;
|
||||||
|
|
@ -652,12 +652,12 @@ sub getDatabaseUsers {
|
||||||
}
|
}
|
||||||
$sth->finish;
|
$sth->finish;
|
||||||
} else {
|
} else {
|
||||||
$self->session->errorHandler->error("Couldn't process unconditional read for database group with group id $gid.");
|
$self->session->log->error("Couldn't process unconditional read for database group with group id $gid.");
|
||||||
}
|
}
|
||||||
$dbLink->disconnect;
|
$dbLink->disconnect;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$self->session->errorHandler->warn("The database link ".$self->get("databaseLinkId")." no longer exists even though group ".$gid." references it.");
|
$self->session->log->warn("The database link ".$self->get("databaseLinkId")." no longer exists even though group ".$gid." references it.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return \@dbUsers;
|
return \@dbUsers;
|
||||||
|
|
@ -712,7 +712,7 @@ sub getGroupsIn {
|
||||||
if ($isRecursive) {
|
if ($isRecursive) {
|
||||||
$loopCount++;
|
$loopCount++;
|
||||||
if ($loopCount > 99) {
|
if ($loopCount > 99) {
|
||||||
$self->session->errorHandler->fatal("Endless recursive loop detected while determining groups in group.\nRequested groupId: ".$self->getId."\nGroups in that group: ".join(",",@$groups));
|
$self->session->log->fatal("Endless recursive loop detected while determining groups in group.\nRequested groupId: ".$self->getId."\nGroups in that group: ".join(",",@$groups));
|
||||||
}
|
}
|
||||||
my @groupsOfGroups = @$groups;
|
my @groupsOfGroups = @$groups;
|
||||||
foreach my $group (@$groups) {
|
foreach my $group (@$groups) {
|
||||||
|
|
@ -821,7 +821,7 @@ sub getLDAPUsers {
|
||||||
|
|
||||||
my $ldapLink = WebGUI::LDAPLink->new($self->session,$ldapLinkId);
|
my $ldapLink = WebGUI::LDAPLink->new($self->session,$ldapLinkId);
|
||||||
unless ($ldapLink && $ldapLink->bind) {
|
unless ($ldapLink && $ldapLink->bind) {
|
||||||
$self->session->errorHandler->warn("There was a problem connecting to LDAP link $ldapLinkId for group ID $gid.");
|
$self->session->log->warn("There was a problem connecting to LDAP link $ldapLinkId for group ID $gid.");
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -843,7 +843,7 @@ sub getLDAPUsers {
|
||||||
if($userId) {
|
if($userId) {
|
||||||
push(@ldapUsers,$userId);
|
push(@ldapUsers,$userId);
|
||||||
} else {
|
} else {
|
||||||
$self->session->errorHandler->warn("Could not find matching userId for dn/uid $person in WebGUI for group $gid");
|
$self->session->log->warn("Could not find matching userId for dn/uid $person in WebGUI for group $gid");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1154,7 +1154,7 @@ sub hasLDAPUser {
|
||||||
|
|
||||||
my $ldapLink = WebGUI::LDAPLink->new($session,$ldapLinkId);
|
my $ldapLink = WebGUI::LDAPLink->new($session,$ldapLinkId);
|
||||||
unless ($ldapLink && $ldapLink->bind) {
|
unless ($ldapLink && $ldapLink->bind) {
|
||||||
$self->session->errorHandler->warn("There was a problem connecting to LDAP link $ldapLinkId for group ID $gid.");
|
$self->session->log->warn("There was a problem connecting to LDAP link $ldapLinkId for group ID $gid.");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1528,7 +1528,7 @@ sub new {
|
||||||
$self->{_groupId},
|
$self->{_groupId},
|
||||||
]);
|
]);
|
||||||
unless ($groupExists) {
|
unless ($groupExists) {
|
||||||
$session->errorHandler->warn('WebGUI::Group->new called with a non-existant groupId:'
|
$session->log->warn('WebGUI::Group->new called with a non-existant groupId:'
|
||||||
.'['.$self->{_groupId}.']');
|
.'['.$self->{_groupId}.']');
|
||||||
return undef;
|
return undef;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -86,7 +86,7 @@ sub AUTOLOAD {
|
||||||
$params{rowClass} ||= $self->{_class};
|
$params{rowClass} ||= $self->{_class};
|
||||||
my $control = eval { WebGUI::Pluggable::instanciate("WebGUI::Form::".$name, "new", [ $self->session, %params ]) };
|
my $control = eval { WebGUI::Pluggable::instanciate("WebGUI::Form::".$name, "new", [ $self->session, %params ]) };
|
||||||
if ($@) {
|
if ($@) {
|
||||||
$self->session->errorHandler->error($@);
|
$self->session->log->error($@);
|
||||||
return undef;
|
return undef;
|
||||||
}
|
}
|
||||||
$self->{_data} .= $control->toHtmlWithWrapper;
|
$self->{_data} .= $control->toHtmlWithWrapper;
|
||||||
|
|
|
||||||
|
|
@ -52,7 +52,7 @@ sub getFilename {
|
||||||
if (exists $self->{_properties}->{filename}) {
|
if (exists $self->{_properties}->{filename}) {
|
||||||
return $self->{_properties}->{filename};
|
return $self->{_properties}->{filename};
|
||||||
}
|
}
|
||||||
$self->session->errorHandler->fatal('Attempted to retrieve filename before one was set');
|
$self->session->log->fatal('Attempted to retrieve filename before one was set');
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -356,7 +356,7 @@ sub setFillColor {
|
||||||
$self->setFillTriplet($1);
|
$self->setFillTriplet($1);
|
||||||
$self->setFillAlpha($2 || '00');
|
$self->setFillAlpha($2 || '00');
|
||||||
} else {
|
} else {
|
||||||
$self->session->errorHandler->fatal("Invalid fill color: ($color)");
|
$self->session->log->fatal("Invalid fill color: ($color)");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -380,7 +380,7 @@ sub setFillTriplet {
|
||||||
$self->{_properties}->{fillTriplet} = $triplet;
|
$self->{_properties}->{fillTriplet} = $triplet;
|
||||||
$self->update;
|
$self->update;
|
||||||
} else {
|
} else {
|
||||||
$self->session->errorHandler->fatal("Invalid fill triplet: ($triplet)");
|
$self->session->log->fatal("Invalid fill triplet: ($triplet)");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -404,7 +404,7 @@ sub setFillAlpha {
|
||||||
$self->{_properties}->{fillAlpha} = $alpha;
|
$self->{_properties}->{fillAlpha} = $alpha;
|
||||||
$self->update;
|
$self->update;
|
||||||
} else {
|
} else {
|
||||||
$self->session->errorHandler->fatal("Invalid fill alpha: ($alpha)");
|
$self->session->log->fatal("Invalid fill alpha: ($alpha)");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -448,7 +448,7 @@ sub setStrokeColor {
|
||||||
$self->setStrokeTriplet($1);
|
$self->setStrokeTriplet($1);
|
||||||
$self->setStrokeAlpha($2 || '00');
|
$self->setStrokeAlpha($2 || '00');
|
||||||
} else {
|
} else {
|
||||||
$self->session->errorHandler->fatal("Invalid stroke color: ($color)");
|
$self->session->log->fatal("Invalid stroke color: ($color)");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -472,7 +472,7 @@ sub setStrokeTriplet {
|
||||||
$self->{_properties}->{strokeTriplet} = $triplet;
|
$self->{_properties}->{strokeTriplet} = $triplet;
|
||||||
$self->update;
|
$self->update;
|
||||||
} else {
|
} else {
|
||||||
$self->session->errorHandler->fatal("Invalid stroke triplet: ($triplet)");
|
$self->session->log->fatal("Invalid stroke triplet: ($triplet)");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -496,7 +496,7 @@ sub setStrokeAlpha {
|
||||||
$self->{_properties}->{strokeAlpha} = $alpha;
|
$self->{_properties}->{strokeAlpha} = $alpha;
|
||||||
$self->update;
|
$self->update;
|
||||||
} else {
|
} else {
|
||||||
$self->session->errorHandler->fatal("Invalid stroke alpha: ($alpha)");
|
$self->session->log->fatal("Invalid stroke alpha: ($alpha)");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -576,7 +576,7 @@ sub loadByConfiguration {
|
||||||
my $namespace = "WebGUI::Image::".$config->{graph_formNamespace};
|
my $namespace = "WebGUI::Image::".$config->{graph_formNamespace};
|
||||||
$namespace =~ s/_/::/g;
|
$namespace =~ s/_/::/g;
|
||||||
|
|
||||||
$session->errorHandler->fatal("wrong namespace: [$namespace]") unless ($config->{graph_formNamespace} =~ /^[\w\d_]+$/);
|
$session->log->fatal("wrong namespace: [$namespace]") unless ($config->{graph_formNamespace} =~ /^[\w\d_]+$/);
|
||||||
|
|
||||||
my $plugin = $self->load($session, $namespace);
|
my $plugin = $self->load($session, $namespace);
|
||||||
$plugin->setConfiguration($config);
|
$plugin->setConfiguration($config);
|
||||||
|
|
|
||||||
|
|
@ -171,7 +171,7 @@ sub getLanguage {
|
||||||
no strict 'refs';
|
no strict 'refs';
|
||||||
${"$pack\::LANGUAGE"};
|
${"$pack\::LANGUAGE"};
|
||||||
};
|
};
|
||||||
$self->session->errorHandler->warn("Failed to retrieve language properties because ".$@) if ($@);
|
$self->session->log->warn("Failed to retrieve language properties because ".$@) if ($@);
|
||||||
if ($property) {
|
if ($property) {
|
||||||
return $langInfo->{$property};
|
return $langInfo->{$property};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -150,7 +150,7 @@ sub process {
|
||||||
local $macrodepth = $macrodepth + 1;
|
local $macrodepth = $macrodepth + 1;
|
||||||
${ $content } =~ s{$macro_re}{
|
${ $content } =~ s{$macro_re}{
|
||||||
if ( $macrodepth > 16 ) {
|
if ( $macrodepth > 16 ) {
|
||||||
$session->errorHandler->error($2 . " : Too many levels of macro recursion. Stopping.");
|
$session->log->error($2 . " : Too many levels of macro recursion. Stopping.");
|
||||||
"Too many levels of macro recursion. Stopping.";
|
"Too many levels of macro recursion. Stopping.";
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
@ -176,7 +176,7 @@ sub _processMacro {
|
||||||
}
|
}
|
||||||
my $macrofile = $session->config->get("macros")->{$macroname};
|
my $macrofile = $session->config->get("macros")->{$macroname};
|
||||||
if (!$macrofile) {
|
if (!$macrofile) {
|
||||||
$session->errorHandler->error("No macro with name $macroname defined.");
|
$session->log->error("No macro with name $macroname defined.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
my $macropackage = "WebGUI::Macro::$macrofile";
|
my $macropackage = "WebGUI::Macro::$macrofile";
|
||||||
|
|
|
||||||
|
|
@ -53,7 +53,7 @@ sub process {
|
||||||
$asset = eval { WebGUI::Asset->newByUrl($session,$identifier); };
|
$asset = eval { WebGUI::Asset->newByUrl($session,$identifier); };
|
||||||
}
|
}
|
||||||
if (Exception::Class->caught()) {
|
if (Exception::Class->caught()) {
|
||||||
$session->errorHandler->warn('AssetProxy macro called invalid asset: '.$identifier
|
$session->log->warn('AssetProxy macro called invalid asset: '.$identifier
|
||||||
.'. The macro was called through this url: '.$session->asset->get('url'));
|
.'. The macro was called through this url: '.$session->asset->get('url'));
|
||||||
if ($session->var->isAdminOn) {
|
if ($session->var->isAdminOn) {
|
||||||
my $i18n = WebGUI::International->new($session, 'Macro_AssetProxy');
|
my $i18n = WebGUI::International->new($session, 'Macro_AssetProxy');
|
||||||
|
|
@ -61,7 +61,7 @@ sub process {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
elsif ($asset->get('state') =~ /^trash/) {
|
elsif ($asset->get('state') =~ /^trash/) {
|
||||||
$session->errorHandler->warn('AssetProxy macro called on asset in trash: '.$identifier
|
$session->log->warn('AssetProxy macro called on asset in trash: '.$identifier
|
||||||
.'. The macro was called through this url: '.$session->asset->get('url'));
|
.'. The macro was called through this url: '.$session->asset->get('url'));
|
||||||
if ($session->var->isAdminOn) {
|
if ($session->var->isAdminOn) {
|
||||||
my $i18n = WebGUI::International->new($session, 'Macro_AssetProxy');
|
my $i18n = WebGUI::International->new($session, 'Macro_AssetProxy');
|
||||||
|
|
@ -69,7 +69,7 @@ sub process {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
elsif ($asset->get('state') =~ /^clipboard/) {
|
elsif ($asset->get('state') =~ /^clipboard/) {
|
||||||
$session->errorHandler->warn('AssetProxy macro called on asset in clipboard: '.$identifier
|
$session->log->warn('AssetProxy macro called on asset in clipboard: '.$identifier
|
||||||
.'. The macro was called through this url: '.$session->asset->get('url'));
|
.'. The macro was called through this url: '.$session->asset->get('url'));
|
||||||
if ($session->var->isAdminOn) {
|
if ($session->var->isAdminOn) {
|
||||||
my $i18n = WebGUI::International->new($session, 'Macro_AssetProxy');
|
my $i18n = WebGUI::International->new($session, 'Macro_AssetProxy');
|
||||||
|
|
|
||||||
|
|
@ -69,26 +69,26 @@ sub process {
|
||||||
# Sanity check of parameters:
|
# Sanity check of parameters:
|
||||||
my $startAsset = eval { WebGUI::Asset->newByUrl($session, $startURL); };
|
my $startAsset = eval { WebGUI::Asset->newByUrl($session, $startURL); };
|
||||||
if (Exception::Class->caught()) {
|
if (Exception::Class->caught()) {
|
||||||
$session->errorHandler->warn('Error: invalid startURL. Check parameters of macro on page '.$session->asset->url);
|
$session->log->warn('Error: invalid startURL. Check parameters of macro on page '.$session->asset->url);
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
$relatives = lc($relatives);
|
$relatives = lc($relatives);
|
||||||
unless ( $relatives ~~ ['siblings','children','ancestors','self','descendants','pedigree'] ) {
|
unless ( $relatives ~~ ['siblings','children','ancestors','self','descendants','pedigree'] ) {
|
||||||
$session->errorHandler->warn('Error: invalid relatives specified. Must be one of siblings, children, ancestors, self, descendants, pedigree. Check parameters of macro on page '.$session->asset->url);
|
$session->log->warn('Error: invalid relatives specified. Must be one of siblings, children, ancestors, self, descendants, pedigree. Check parameters of macro on page '.$session->asset->url);
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
my $template = eval { $templateURL ? WebGUI::Asset::Template->newByUrl($session,$templateURL) : WebGUI::Asset::Template->newById($session,'WVtmpl0000000000000001'); };
|
my $template = eval { $templateURL ? WebGUI::Asset::Template->newByUrl($session,$templateURL) : WebGUI::Asset::Template->newById($session,'WVtmpl0000000000000001'); };
|
||||||
if (Exception::Class->caught()) {
|
if (Exception::Class->caught()) {
|
||||||
$session->errorHandler->warn('Error: invalid template URL. Check parameters of macro on page '.$session->asset->url);
|
$session->log->warn('Error: invalid template URL. Check parameters of macro on page '.$session->asset->url);
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
# Get all CS's that we'll use to pick a thread from:
|
# Get all CS's that we'll use to pick a thread from:
|
||||||
my $lineage = $startAsset->getLineage([$relatives],{includeOnlyClasses => ['WebGUI::Asset::Wobject::Collaboration']});
|
my $lineage = $startAsset->getLineage([$relatives],{includeOnlyClasses => ['WebGUI::Asset::Wobject::Collaboration']});
|
||||||
unless ( scalar(@{$lineage}) ) {
|
unless ( scalar(@{$lineage}) ) {
|
||||||
$session->errorHandler->warn('Error: no Collaboration Systems found with current parameters. Check parameters of macro on page '.$session->asset->url);
|
$session->log->warn('Error: no Collaboration Systems found with current parameters. Check parameters of macro on page '.$session->asset->url);
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -104,7 +104,7 @@ sub process {
|
||||||
$lineage = \@llist;
|
$lineage = \@llist;
|
||||||
|
|
||||||
unless ( scalar(@{$lineage}) ) {
|
unless ( scalar(@{$lineage}) ) {
|
||||||
$session->errorHandler->warn('Error: no Collaboration Systems found have any threads to display.'.$session->asset->url);
|
$session->log->warn('Error: no Collaboration Systems found have any threads to display.'.$session->asset->url);
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -124,7 +124,7 @@ sub process {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
# If we reach this point, we had no success in finding an asset the user can view:
|
# If we reach this point, we had no success in finding an asset the user can view:
|
||||||
$session->errorHandler->warn("Could not find a random thread that was viewable by the user ".$session->user->username." after $numberOfTries tries. Check parameters of macro on page ".$session->asset->url);
|
$session->log->warn("Could not find a random thread that was viewable by the user ".$session->user->username." after $numberOfTries tries. Check parameters of macro on page ".$session->asset->url);
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -77,11 +77,11 @@ sub connect {
|
||||||
my $params = shift;
|
my $params = shift;
|
||||||
my $pop = Net::POP3->new($params->{server}, Timeout => 60);
|
my $pop = Net::POP3->new($params->{server}, Timeout => 60);
|
||||||
unless (defined $pop) {
|
unless (defined $pop) {
|
||||||
$session->errorHandler->error("Couldn't connect to POP3 server ". $params->{server});
|
$session->log->error("Couldn't connect to POP3 server ". $params->{server});
|
||||||
return undef;
|
return undef;
|
||||||
}
|
}
|
||||||
unless ($pop->login($params->{account}, $params->{password})) {
|
unless ($pop->login($params->{account}, $params->{password})) {
|
||||||
$session->errorHandler->error("Couldn't log in to POP3 server ".$params->{server}." as ".$params->{account});
|
$session->log->error("Couldn't log in to POP3 server ".$params->{server}." as ".$params->{account});
|
||||||
return undef;
|
return undef;
|
||||||
}
|
}
|
||||||
my $messageNumbers = $pop->list;
|
my $messageNumbers = $pop->list;
|
||||||
|
|
@ -160,7 +160,7 @@ sub getNextMessage {
|
||||||
$self->{_pop}->delete($id);
|
$self->{_pop}->delete($id);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$self->session->errorHandler->error("Could not parse POP3 message $id");
|
$self->session->log->error("Could not parse POP3 message $id");
|
||||||
return undef;
|
return undef;
|
||||||
}
|
}
|
||||||
my $head = $parsedMessage->head;
|
my $head = $parsedMessage->head;
|
||||||
|
|
@ -191,7 +191,7 @@ sub getNextMessage {
|
||||||
my $messageId = decode('MIME-Header', $head->get("Message-Id")) || undef;
|
my $messageId = decode('MIME-Header', $head->get("Message-Id")) || undef;
|
||||||
chomp $messageId;
|
chomp $messageId;
|
||||||
if ($skipAuto) { # drop autogenerated messages
|
if ($skipAuto) { # drop autogenerated messages
|
||||||
$self->session->errorHandler->info("POP3: Dropped auto generated message ".$messageId." from ".$from." to ".$to);
|
$self->session->log->info("POP3: Dropped auto generated message ".$messageId." from ".$from." to ".$to);
|
||||||
return $self->getNextMessage;
|
return $self->getNextMessage;
|
||||||
}
|
}
|
||||||
my $cc = decode('MIME-Header', $head->get("Cc")) || undef;
|
my $cc = decode('MIME-Header', $head->get("Cc")) || undef;
|
||||||
|
|
@ -213,7 +213,7 @@ sub getNextMessage {
|
||||||
);
|
);
|
||||||
$data{parts} = $self->parseParts($parsedMessage);
|
$data{parts} = $self->parseParts($parsedMessage);
|
||||||
unless (scalar(@{$data{parts}}) > 0) { # drop empty messages
|
unless (scalar(@{$data{parts}}) > 0) { # drop empty messages
|
||||||
$self->session->errorHandler->info(
|
$self->session->log->info(
|
||||||
"POP3: Dropped empty message ".$data{messageId}." from ".$data{from}." to ".$data{to}
|
"POP3: Dropped empty message ".$data{messageId}." from ".$data{from}." to ".$data{to}
|
||||||
);
|
);
|
||||||
return $self->getNextMessage;
|
return $self->getNextMessage;
|
||||||
|
|
|
||||||
|
|
@ -57,11 +57,11 @@ sub execute {
|
||||||
$output = eval { WebGUI::Pluggable::run("WebGUI::Operation::".$operation->{$op}, 'www_'.$op, [ $session ] ) };
|
$output = eval { WebGUI::Pluggable::run("WebGUI::Operation::".$operation->{$op}, 'www_'.$op, [ $session ] ) };
|
||||||
if ( $@ ) {
|
if ( $@ ) {
|
||||||
die $@ if ($@ =~ "^fatal:");
|
die $@ if ($@ =~ "^fatal:");
|
||||||
$session->errorHandler->error($@);
|
$session->log->error($@);
|
||||||
return undef;
|
return undef;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$session->errorHandler->security("execute an invalid operation: ".$op);
|
$session->log->security("execute an invalid operation: ".$op);
|
||||||
}
|
}
|
||||||
return $output;
|
return $output;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -47,7 +47,7 @@ sub getInstance {
|
||||||
#Create Auth Object
|
#Create Auth Object
|
||||||
my $auth = eval { WebGUI::Pluggable::instanciate("WebGUI::Auth::".$authMethod, "new", [ $session, $authMethod, $userId ] ) };
|
my $auth = eval { WebGUI::Pluggable::instanciate("WebGUI::Auth::".$authMethod, "new", [ $session, $authMethod, $userId ] ) };
|
||||||
if ($@) {
|
if ($@) {
|
||||||
$session->errorHandler->fatal($@);
|
$session->log->fatal($@);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
return $auth;
|
return $auth;
|
||||||
|
|
@ -75,7 +75,7 @@ sub www_auth {
|
||||||
my $authMethod = getInstance($session,$auth);
|
my $authMethod = getInstance($session,$auth);
|
||||||
my $methodCall = shift || $session->form->process("method") || "init";
|
my $methodCall = shift || $session->form->process("method") || "init";
|
||||||
if(!$authMethod->isCallable($methodCall)){
|
if(!$authMethod->isCallable($methodCall)){
|
||||||
$session->errorHandler->security("access uncallable auth method: $methodCall");
|
$session->log->security("access uncallable auth method: $methodCall");
|
||||||
my $i18n = WebGUI::International->new($session);
|
my $i18n = WebGUI::International->new($session);
|
||||||
return $i18n->get(1077);
|
return $i18n->get(1077);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -272,7 +272,7 @@ sub www_runCronJob {
|
||||||
$session->http->setMimeType("text/plain");
|
$session->http->setMimeType("text/plain");
|
||||||
$session->http->setCacheControl("none");
|
$session->http->setCacheControl("none");
|
||||||
unless (Net::CIDR::Lite->new(@{ $session->config->get('spectreSubnets') })->find($session->request->address) || canView($session)) {
|
unless (Net::CIDR::Lite->new(@{ $session->config->get('spectreSubnets') })->find($session->request->address) || canView($session)) {
|
||||||
$session->errorHandler->security("make a Spectre cron job runner request, but we're only allowed to accept requests from ".join(",",@{$session->config->get("spectreSubnets")}).".");
|
$session->log->security("make a Spectre cron job runner request, but we're only allowed to accept requests from ".join(",",@{$session->config->get("spectreSubnets")}).".");
|
||||||
return "error";
|
return "error";
|
||||||
}
|
}
|
||||||
my $taskId = $session->form->param("taskId");
|
my $taskId = $session->form->param("taskId");
|
||||||
|
|
@ -292,13 +292,13 @@ sub www_runCronJob {
|
||||||
});
|
});
|
||||||
if ( !$instance ) {
|
if ( !$instance ) {
|
||||||
if ($session->stow->get('singletonWorkflowClash')) {
|
if ($session->stow->get('singletonWorkflowClash')) {
|
||||||
$session->errorHandler->warn(
|
$session->log->warn(
|
||||||
"Could not create workflow instance for workflowId '" . $task->get( "workflowId" )
|
"Could not create workflow instance for workflowId '" . $task->get( "workflowId" )
|
||||||
. "' from taskId '".$taskId."': It is a singleton workflow and is still running from the last invocation."
|
. "' from taskId '".$taskId."': It is a singleton workflow and is still running from the last invocation."
|
||||||
);
|
);
|
||||||
return "done";
|
return "done";
|
||||||
}
|
}
|
||||||
$session->errorHandler->error(
|
$session->log->error(
|
||||||
"Could not create workflow instance for workflowId '" . $task->get( "workflowId" )
|
"Could not create workflow instance for workflowId '" . $task->get( "workflowId" )
|
||||||
. "' from taskId '".$taskId."': The result was undefined"
|
. "' from taskId '".$taskId."': The result was undefined"
|
||||||
);
|
);
|
||||||
|
|
@ -313,7 +313,7 @@ sub www_runCronJob {
|
||||||
$task->delete( 1 ) if ( $task->get("runOnce") );
|
$task->delete( 1 ) if ( $task->get("runOnce") );
|
||||||
return "done";
|
return "done";
|
||||||
}
|
}
|
||||||
$session->errorHandler->warn("No task ID passed to cron job runner.");
|
$session->log->warn("No task ID passed to cron job runner.");
|
||||||
return "error";
|
return "error";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -48,7 +48,7 @@ sub www_formHelper {
|
||||||
return "ERROR" unless (defined $sub && defined $class);
|
return "ERROR" unless (defined $sub && defined $class);
|
||||||
my $output = eval { WebGUI::Pluggable::run($class, "www_".$sub, [$session]) };
|
my $output = eval { WebGUI::Pluggable::run($class, "www_".$sub, [$session]) };
|
||||||
if ($@) {
|
if ($@) {
|
||||||
$session->errorHandler->error($@);
|
$session->log->error($@);
|
||||||
return "ERROR";
|
return "ERROR";
|
||||||
}
|
}
|
||||||
return $output;
|
return $output;
|
||||||
|
|
|
||||||
|
|
@ -42,7 +42,7 @@ sub _loadHelp {
|
||||||
my $helpPackage = shift;
|
my $helpPackage = shift;
|
||||||
eval { WebGUI::Pluggable::load( $helpPackage ); };
|
eval { WebGUI::Pluggable::load( $helpPackage ); };
|
||||||
if ($@) {
|
if ($@) {
|
||||||
$session->errorHandler->error("Help failed to compile: $helpPackage. ".$@);
|
$session->log->error("Help failed to compile: $helpPackage. ".$@);
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
if (defined *{"$helpPackage\::HELP"}) { ##Symbol table lookup
|
if (defined *{"$helpPackage\::HELP"}) { ##Symbol table lookup
|
||||||
|
|
@ -153,7 +153,7 @@ sub _get {
|
||||||
return $help->{$id};
|
return $help->{$id};
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$session->errorHandler->warn("Unable to load help for $namespace -> $id");
|
$session->log->warn("Unable to load help for $namespace -> $id");
|
||||||
return undef;
|
return undef;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -390,7 +390,7 @@ sub www_listLDAPLinks {
|
||||||
$ldapLink->unbind;
|
$ldapLink->unbind;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$session->errorHandler->warn($ldapLink->getErrorMessage());
|
$session->log->warn($ldapLink->getErrorMessage());
|
||||||
$status .= ": ".$ldapLink->getErrorMessage();
|
$status .= ": ".$ldapLink->getErrorMessage();
|
||||||
}
|
}
|
||||||
$row[$i] .= '<td valign="top" class="tableData">'.$status.'</td>';
|
$row[$i] .= '<td valign="top" class="tableData">'.$status.'</td>';
|
||||||
|
|
|
||||||
|
|
@ -60,7 +60,7 @@ sub www_spectreGetSiteData {
|
||||||
$subnets = [];
|
$subnets = [];
|
||||||
}
|
}
|
||||||
if (!Net::CIDR::Lite->new(@$subnets)->find($session->request->address)) {
|
if (!Net::CIDR::Lite->new(@$subnets)->find($session->request->address)) {
|
||||||
$session->errorHandler->security("Tried to make a Spectre workflow data load request, but we're only allowed to accept requests from "
|
$session->log->security("Tried to make a Spectre workflow data load request, but we're only allowed to accept requests from "
|
||||||
.join(",",@{$subnets}).".");
|
.join(",",@{$subnets}).".");
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
@ -183,7 +183,7 @@ sub www_spectreTest {
|
||||||
|
|
||||||
my $sessionIp = $session->request->address;
|
my $sessionIp = $session->request->address;
|
||||||
unless (Net::CIDR::Lite->new(@$subnets)->find($sessionIp)) {
|
unless (Net::CIDR::Lite->new(@$subnets)->find($sessionIp)) {
|
||||||
$session->errorHandler->security(
|
$session->log->security(
|
||||||
sprintf "Tried to make a Spectre workflow runner request from %s, but we're only allowed to accept requests from %s",
|
sprintf "Tried to make a Spectre workflow runner request from %s, but we're only allowed to accept requests from %s",
|
||||||
$sessionIp, join(",",@{$subnets})
|
$sessionIp, join(",",@{$subnets})
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -82,7 +82,7 @@ sub www_activityHelper {
|
||||||
|
|
||||||
my $output = eval {WebGUI::Pluggable::instanciate($class, "www_".$sub, [$session])};
|
my $output = eval {WebGUI::Pluggable::instanciate($class, "www_".$sub, [$session])};
|
||||||
if ($@) {
|
if ($@) {
|
||||||
$session->errorHandler->error($@);
|
$session->log->error($@);
|
||||||
return "ERROR";
|
return "ERROR";
|
||||||
}
|
}
|
||||||
return $output;
|
return $output;
|
||||||
|
|
@ -483,7 +483,7 @@ sub www_runWorkflow {
|
||||||
$session->http->setMimeType("text/plain");
|
$session->http->setMimeType("text/plain");
|
||||||
$session->http->setCacheControl("none");
|
$session->http->setCacheControl("none");
|
||||||
unless (Net::CIDR::Lite->new(@{ $session->config->get('spectreSubnets')} )->find($session->request->address) || canRunWorkflow($session)) {
|
unless (Net::CIDR::Lite->new(@{ $session->config->get('spectreSubnets')} )->find($session->request->address) || canRunWorkflow($session)) {
|
||||||
$session->errorHandler->security("make a Spectre workflow runner request, but we're only allowed to accept requests from ".join(",",@{$session->config->get("spectreSubnets")}).".");
|
$session->log->security("make a Spectre workflow runner request, but we're only allowed to accept requests from ".join(",",@{$session->config->get("spectreSubnets")}).".");
|
||||||
return "error";
|
return "error";
|
||||||
}
|
}
|
||||||
my $instanceId = $session->form->param("instanceId");
|
my $instanceId = $session->form->param("instanceId");
|
||||||
|
|
@ -496,7 +496,7 @@ sub www_runWorkflow {
|
||||||
}
|
}
|
||||||
return "complete";
|
return "complete";
|
||||||
}
|
}
|
||||||
$session->errorHandler->warn("No instance ID passed to workflow runner.");
|
$session->log->warn("No instance ID passed to workflow runner.");
|
||||||
return "error";
|
return "error";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -757,7 +757,7 @@ sub setDataByQuery {
|
||||||
$sql =~ s/;?\s*$/ LIMIT $start,$rowsPerPage/;
|
$sql =~ s/;?\s*$/ LIMIT $start,$rowsPerPage/;
|
||||||
}
|
}
|
||||||
|
|
||||||
#$self->session->errorHandler->warn($sql);
|
#$self->session->log->warn($sql);
|
||||||
#Get only the data necessary from the database
|
#Get only the data necessary from the database
|
||||||
my $sth;
|
my $sth;
|
||||||
if ($unconditional) {
|
if ($unconditional) {
|
||||||
|
|
|
||||||
|
|
@ -242,7 +242,7 @@ sub formProperties {
|
||||||
= WebGUI::Operation::Shared::secureEval($self->session,$self->get("possibleValues"));
|
= WebGUI::Operation::Shared::secureEval($self->session,$self->get("possibleValues"));
|
||||||
unless (ref $values eq 'HASH') {
|
unless (ref $values eq 'HASH') {
|
||||||
if ($self->get('possibleValues') =~ /\S/) {
|
if ($self->get('possibleValues') =~ /\S/) {
|
||||||
$self->session->errorHandler->warn("Could not get a hash out of possible values for profile field ".$self->getId);
|
$self->session->log->warn("Could not get a hash out of possible values for profile field ".$self->getId);
|
||||||
}
|
}
|
||||||
$values = {};
|
$values = {};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -124,7 +124,7 @@ sub getAssets {
|
||||||
while (my ($id, $class, $version) = $rs->array) {
|
while (my ($id, $class, $version) = $rs->array) {
|
||||||
my $asset = eval { WebGUI::Asset->newById($self->session, $id, $version); };
|
my $asset = eval { WebGUI::Asset->newById($self->session, $id, $version); };
|
||||||
if (Exception::Class->caught()) {
|
if (Exception::Class->caught()) {
|
||||||
$self->session->errorHandler->warn("Search index contains assetId $id even though it no longer exists.");
|
$self->session->log->warn("Search index contains assetId $id even though it no longer exists.");
|
||||||
next;
|
next;
|
||||||
}
|
}
|
||||||
push(@assets, $asset);
|
push(@assets, $asset);
|
||||||
|
|
@ -445,7 +445,7 @@ sub search {
|
||||||
my $join = [ "left join assetData on assetIndex.assetId=assetData.assetId" ];
|
my $join = [ "left join assetData on assetIndex.assetId=assetData.assetId" ];
|
||||||
for my $className ( @{ $rules->{ joinClass } } ) {
|
for my $className ( @{ $rules->{ joinClass } } ) {
|
||||||
if ( ! eval { WebGUI::Pluggable::load($className) } ) {
|
if ( ! eval { WebGUI::Pluggable::load($className) } ) {
|
||||||
$self->session->errorHandler->fatal($@);
|
$self->session->log->fatal($@);
|
||||||
}
|
}
|
||||||
TABLE: foreach my $tableName ($className->meta->get_tables) {
|
TABLE: foreach my $tableName ($className->meta->get_tables) {
|
||||||
next TABLE if $tableName eq 'assetData';
|
next TABLE if $tableName eq 'assetData';
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@ use WebGUI::Config;
|
||||||
use WebGUI::SQL;
|
use WebGUI::SQL;
|
||||||
use WebGUI::User;
|
use WebGUI::User;
|
||||||
use WebGUI::Session::DateTime;
|
use WebGUI::Session::DateTime;
|
||||||
use WebGUI::Session::ErrorHandler;
|
use WebGUI::Session::Log;
|
||||||
use WebGUI::Session::Form;
|
use WebGUI::Session::Form;
|
||||||
use WebGUI::Session::Http;
|
use WebGUI::Session::Http;
|
||||||
use WebGUI::Session::Icon;
|
use WebGUI::Session::Icon;
|
||||||
|
|
@ -182,7 +182,7 @@ sub close {
|
||||||
|
|
||||||
# Kill circular references. The literal list is so that the order
|
# Kill circular references. The literal list is so that the order
|
||||||
# can be explicitly shuffled as necessary.
|
# can be explicitly shuffled as necessary.
|
||||||
foreach my $key (qw/_asset _datetime _icon _slave _db _form _http _id _output _privilege _scratch _setting _stow _style _url _user _var _cache _errorHandler _response _request/) {
|
foreach my $key (qw/_asset _datetime _icon _slave _db _form _http _id _output _privilege _scratch _setting _stow _style _url _user _var _cache _log _response _request/) {
|
||||||
delete $self->{$key};
|
delete $self->{$key};
|
||||||
}
|
}
|
||||||
$self->{closed} = 1;
|
$self->{closed} = 1;
|
||||||
|
|
@ -241,7 +241,7 @@ sub db {
|
||||||
unless (exists $self->{_db}) {
|
unless (exists $self->{_db}) {
|
||||||
my $db = WebGUI::SQL->connect($self,$self->config->get("dsn"), $self->config->get("dbuser"), $self->config->get("dbpass"));
|
my $db = WebGUI::SQL->connect($self,$self->config->get("dsn"), $self->config->get("dbuser"), $self->config->get("dbpass"));
|
||||||
if (!defined $db && defined $self->config->get("failoverdb")) {
|
if (!defined $db && defined $self->config->get("failoverdb")) {
|
||||||
$self->errorHandler->warn("Main DB down, resorting to using failover.");
|
$self->log->warn("Main DB down, resorting to using failover.");
|
||||||
my $failover = $self->config->get("failoverdb");
|
my $failover = $self->config->get("failoverdb");
|
||||||
$db = WebGUI::SQL->connect($self,$failover->{dsn}, $failover->{user}, $failover->{password});
|
$db = WebGUI::SQL->connect($self,$failover->{dsn}, $failover->{user}, $failover->{password});
|
||||||
}
|
}
|
||||||
|
|
@ -253,7 +253,7 @@ sub db {
|
||||||
return undef;
|
return undef;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$self->errorHandler->fatal("Couldn't connect to WebGUI database, and can't continue without it.");
|
$self->log->fatal("Couldn't connect to WebGUI database, and can't continue without it.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -435,16 +435,16 @@ sub id {
|
||||||
|
|
||||||
=head2 log ( )
|
=head2 log ( )
|
||||||
|
|
||||||
Returns a WebGUI::Session::ErrorHandler object, which is used for logging.
|
Returns a WebGUI::Session::Log object, which is used for logging.
|
||||||
|
|
||||||
=cut
|
=cut
|
||||||
|
|
||||||
sub log {
|
sub log {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
unless (exists $self->{_errorHandler}) {
|
unless (exists $self->{_log}) {
|
||||||
$self->{_errorHandler} = WebGUI::Session::ErrorHandler->new($self);
|
$self->{_log} = WebGUI::Session::Log->new($self);
|
||||||
}
|
}
|
||||||
return $self->{_errorHandler};
|
return $self->{_log};
|
||||||
}
|
}
|
||||||
|
|
||||||
#-------------------------------------------------------------------
|
#-------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
|
@ -721,7 +721,7 @@ sub mailToEpoch {
|
||||||
my $parser = DateTime::Format::Mail->new->loose;
|
my $parser = DateTime::Format::Mail->new->loose;
|
||||||
my $dt = eval {$parser->parse_datetime($date)};
|
my $dt = eval {$parser->parse_datetime($date)};
|
||||||
if ($@) {
|
if ($@) {
|
||||||
$self->session->errorHandler->warn($date." is not a valid date for email, and is so poorly formatted, we can't even guess what it is.");
|
$self->session->log->warn($date." is not a valid date for email, and is so poorly formatted, we can't even guess what it is.");
|
||||||
return undef;
|
return undef;
|
||||||
}
|
}
|
||||||
return $dt->epoch;
|
return $dt->epoch;
|
||||||
|
|
@ -919,7 +919,7 @@ sub setToEpoch {
|
||||||
$dt = $parser->parse_datetime($set);
|
$dt = $parser->parse_datetime($set);
|
||||||
}
|
}
|
||||||
unless ($dt) {
|
unless ($dt) {
|
||||||
$self->session->errorHandler->warn("Could not format date $set for epoch. Returning current time");
|
$self->session->log->warn("Could not format date $set for epoch. Returning current time");
|
||||||
return time();
|
return time();
|
||||||
}
|
}
|
||||||
return $dt->epoch;
|
return $dt->epoch;
|
||||||
|
|
|
||||||
|
|
@ -504,7 +504,7 @@ sub setRedirect {
|
||||||
my $type = shift || 302;
|
my $type = shift || 302;
|
||||||
my @params = $self->session->form->param;
|
my @params = $self->session->form->param;
|
||||||
return undef if ($url eq $self->session->url->page() && scalar(@params) < 1); # prevent redirecting to self
|
return undef if ($url eq $self->session->url->page() && scalar(@params) < 1); # prevent redirecting to self
|
||||||
$self->session->errorHandler->info("Redirecting to $url");
|
$self->session->log->info("Redirecting to $url");
|
||||||
$self->setRedirectLocation($url);
|
$self->setRedirectLocation($url);
|
||||||
$self->setStatus($type);
|
$self->setStatus($type);
|
||||||
$self->session->style->setMeta({"http-equiv"=>"refresh",content=>"0; URL=".$url});
|
$self->session->style->setMeta({"http-equiv"=>"refresh",content=>"0; URL=".$url});
|
||||||
|
|
|
||||||
|
|
@ -253,7 +253,7 @@ sub getToolbarOptions {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
$options{useLanguageDefault} = WebGUI::International->new($self->session,'WebGUI')->get(1084);
|
$options{useLanguageDefault} = WebGUI::International->new($self->session,'WebGUI')->get(1084);
|
||||||
my $dir = $self->session->config->get("extrasPath")."/toolbar";
|
my $dir = $self->session->config->get("extrasPath")."/toolbar";
|
||||||
opendir (DIR,$dir) or $self->session->errorHandler->warn("Can't open toolbar directory!: $!");
|
opendir (DIR,$dir) or $self->session->log->warn("Can't open toolbar directory!: $!");
|
||||||
my @files = readdir(DIR);
|
my @files = readdir(DIR);
|
||||||
foreach my $file (@files) {
|
foreach my $file (@files) {
|
||||||
if (substr($file,0,1) ne ".") {
|
if (substr($file,0,1) ne ".") {
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
package WebGUI::Session::ErrorHandler;
|
package WebGUI::Session::Log;
|
||||||
|
|
||||||
=head1 LEGAL
|
=head1 LEGAL
|
||||||
|
|
||||||
|
|
@ -23,7 +23,7 @@ use Scalar::Util qw(weaken);
|
||||||
|
|
||||||
=head1 NAME
|
=head1 NAME
|
||||||
|
|
||||||
Package WebGUI::Session::ErrorHandler
|
Package WebGUI::Session::Log
|
||||||
|
|
||||||
=head1 DESCRIPTION
|
=head1 DESCRIPTION
|
||||||
|
|
||||||
|
|
@ -31,22 +31,22 @@ This package provides simple but effective error handling, debugging, and loggi
|
||||||
|
|
||||||
=head1 SYNOPSIS
|
=head1 SYNOPSIS
|
||||||
|
|
||||||
use WebGUI::Session::ErrorHandler;
|
use WebGUI::Session::Log;
|
||||||
|
|
||||||
my $errorHandler = WebGUI::Session::ErrorHandler->new($session);
|
my $log = WebGUI::Session::Log->new($session);
|
||||||
|
|
||||||
$errorHandler->audit($message);
|
$log->audit($message);
|
||||||
$errorHandler->debug($message);
|
$log->debug($message);
|
||||||
$errorHandler->error($message);
|
$log->error($message);
|
||||||
$errorHandler->fatal($message);
|
$log->fatal($message);
|
||||||
$errorHandler->info($message);
|
$log->info($message);
|
||||||
$errorHandler->security($message);
|
$log->security($message);
|
||||||
$errorHandler->warn($message);
|
$log->warn($message);
|
||||||
|
|
||||||
$logger = $errorHandler->getLogger;
|
$logger = $log->getLogger;
|
||||||
|
|
||||||
$text = $errorHandler->getStackTrace;
|
$text = $log->getStackTrace;
|
||||||
$html = $errorHandler->showDebug;
|
$html = $log->showDebug;
|
||||||
|
|
||||||
=head1 METHODS
|
=head1 METHODS
|
||||||
|
|
||||||
|
|
@ -279,7 +279,7 @@ sub cancelRecurringPayment {
|
||||||
|
|
||||||
# Get the payment definition XML
|
# Get the payment definition XML
|
||||||
my $xml = $self->_generateCancelRecurXml( $transaction );
|
my $xml = $self->_generateCancelRecurXml( $transaction );
|
||||||
$session->errorHandler->debug("XML Request: $xml");
|
$session->log->debug("XML Request: $xml");
|
||||||
|
|
||||||
# Post the xml to ITransact
|
# Post the xml to ITransact
|
||||||
my $response = $self->doXmlRequest( $xml, 1 );
|
my $response = $self->doXmlRequest( $xml, 1 );
|
||||||
|
|
@ -287,11 +287,11 @@ sub cancelRecurringPayment {
|
||||||
# Process response
|
# Process response
|
||||||
if ($response->is_success) {
|
if ($response->is_success) {
|
||||||
# We got some XML back from iTransact, now parse it.
|
# We got some XML back from iTransact, now parse it.
|
||||||
$session->errorHandler->info('Starting request');
|
$session->log->info('Starting request');
|
||||||
my $transactionResult = XMLin( $response->content );
|
my $transactionResult = XMLin( $response->content );
|
||||||
unless (defined $transactionResult->{ RecurUpdateResponse }) {
|
unless (defined $transactionResult->{ RecurUpdateResponse }) {
|
||||||
# GatewayFailureResponse: This means the xml is invalid or has the wrong mime type
|
# GatewayFailureResponse: This means the xml is invalid or has the wrong mime type
|
||||||
$session->errorHandler->info( "GatewayFailureResponse: result: [" . $response->content . "]" );
|
$session->log->info( "GatewayFailureResponse: result: [" . $response->content . "]" );
|
||||||
return(
|
return(
|
||||||
0,
|
0,
|
||||||
"Status: " . $transactionResult->{ Status }
|
"Status: " . $transactionResult->{ Status }
|
||||||
|
|
@ -301,7 +301,7 @@ sub cancelRecurringPayment {
|
||||||
} else {
|
} else {
|
||||||
# RecurUpdateResponse: We have succesfully sent the XML and it was correct. Note that this doesn't mean
|
# RecurUpdateResponse: We have succesfully sent the XML and it was correct. Note that this doesn't mean
|
||||||
# that the cancellation has succeeded. It only has if Status is set to OK and the remaining terms is 0.
|
# that the cancellation has succeeded. It only has if Status is set to OK and the remaining terms is 0.
|
||||||
$session->errorHandler->info( "RecurUpdateResponse: result: [" . $response->content . "]" );
|
$session->log->info( "RecurUpdateResponse: result: [" . $response->content . "]" );
|
||||||
my $transactionData = $transactionResult->{ RecurUpdateResponse };
|
my $transactionData = $transactionResult->{ RecurUpdateResponse };
|
||||||
|
|
||||||
my $status = $transactionData->{ Status };
|
my $status = $transactionData->{ Status };
|
||||||
|
|
@ -316,7 +316,7 @@ sub cancelRecurringPayment {
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
# Connection Error
|
# Connection Error
|
||||||
$session->errorHandler->info("Connection error");
|
$session->log->info("Connection error");
|
||||||
|
|
||||||
return ( 0, undef, 'ConnectionError', $response->status_line );
|
return ( 0, undef, 'ConnectionError', $response->status_line );
|
||||||
}
|
}
|
||||||
|
|
@ -371,26 +371,26 @@ sub checkRecurringTransaction {
|
||||||
my $response = $self->doXmlRequest( $xml, 1 );
|
my $response = $self->doXmlRequest( $xml, 1 );
|
||||||
|
|
||||||
if ($response->is_success) {
|
if ($response->is_success) {
|
||||||
$session->errorHandler->info("Check recurring postback response: [".$response->content."]");
|
$session->log->info("Check recurring postback response: [".$response->content."]");
|
||||||
# We got some XML back from iTransact, now parse it.
|
# We got some XML back from iTransact, now parse it.
|
||||||
my $transactionResult = XMLin( $response->content || '<empty></empty>');
|
my $transactionResult = XMLin( $response->content || '<empty></empty>');
|
||||||
|
|
||||||
unless (defined $transactionResult->{ RecurDetailsResponse }) {
|
unless (defined $transactionResult->{ RecurDetailsResponse }) {
|
||||||
# Something went wrong.
|
# Something went wrong.
|
||||||
$session->errorHandler->info("Check recurring postback failed!");
|
$session->log->info("Check recurring postback failed!");
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
} else {
|
} else {
|
||||||
$session->errorHandler->info("Check recurring postback! Response: [".$response->content."]");
|
$session->log->info("Check recurring postback! Response: [".$response->content."]");
|
||||||
|
|
||||||
my $data = $transactionResult->{ RecurDetailsResponse };
|
my $data = $transactionResult->{ RecurDetailsResponse };
|
||||||
|
|
||||||
my $status = $data->{ Status };
|
my $status = $data->{ Status };
|
||||||
my $amount = $data->{ RecurDetails }->{ RecurTotal };
|
my $amount = $data->{ RecurDetails }->{ RecurTotal };
|
||||||
|
|
||||||
$session->errorHandler->info("Check recurring postback! Status: $status");
|
$session->log->info("Check recurring postback! Status: $status");
|
||||||
if ( $amount != $expectedAmount ) {
|
if ( $amount != $expectedAmount ) {
|
||||||
$session->errorHandler->info(
|
$session->log->info(
|
||||||
"Check recurring postback, received amount: $amount not equal to expected amount: $expectedAmount"
|
"Check recurring postback, received amount: $amount not equal to expected amount: $expectedAmount"
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
@ -401,7 +401,7 @@ sub checkRecurringTransaction {
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
# Connection Error
|
# Connection Error
|
||||||
$session->errorHandler->info("Connection error");
|
$session->log->info("Connection error");
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
@ -529,7 +529,7 @@ sub processPayment {
|
||||||
#### TODO: More checking: price, address, etc
|
#### TODO: More checking: price, address, etc
|
||||||
unless (defined $transactionResult->{ TransactionData }) {
|
unless (defined $transactionResult->{ TransactionData }) {
|
||||||
# GatewayFailureResponse: This means the xml is invalid or has the wrong mime type
|
# GatewayFailureResponse: This means the xml is invalid or has the wrong mime type
|
||||||
$session->errorHandler->info("GatewayFailureResponse: result: [".$response->content."]");
|
$session->log->info("GatewayFailureResponse: result: [".$response->content."]");
|
||||||
return(
|
return(
|
||||||
0,
|
0,
|
||||||
undef,
|
undef,
|
||||||
|
|
@ -539,7 +539,7 @@ sub processPayment {
|
||||||
} else {
|
} else {
|
||||||
# SaleResponse: We have succesfully sent the XML and it was correct. Note that this doesn't mean that
|
# SaleResponse: We have succesfully sent the XML and it was correct. Note that this doesn't mean that
|
||||||
# the transaction has succeeded. It only has if Status is set to OK.
|
# the transaction has succeeded. It only has if Status is set to OK.
|
||||||
$session->errorHandler->info("SaleResponse: result: [".$response->content."]");
|
$session->log->info("SaleResponse: result: [".$response->content."]");
|
||||||
my $transactionData = $transactionResult->{ TransactionData };
|
my $transactionData = $transactionResult->{ TransactionData };
|
||||||
|
|
||||||
my $status = $transactionData->{ Status };
|
my $status = $transactionData->{ Status };
|
||||||
|
|
@ -554,7 +554,7 @@ sub processPayment {
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
# Connection Error
|
# Connection Error
|
||||||
$session->errorHandler->info("Connection error");
|
$session->log->info("Connection error");
|
||||||
|
|
||||||
return ( 0, undef, 'ConnectionError', $response->status_line );
|
return ( 0, undef, 'ConnectionError', $response->status_line );
|
||||||
}
|
}
|
||||||
|
|
@ -714,7 +714,7 @@ sub www_processRecurringTransactionPostback {
|
||||||
#---- Check the validity of the request -------
|
#---- Check the validity of the request -------
|
||||||
# First check whether the original transaction actualy exists
|
# First check whether the original transaction actualy exists
|
||||||
if (WebGUI::Error->caught || !(defined $baseTransaction) ) {
|
if (WebGUI::Error->caught || !(defined $baseTransaction) ) {
|
||||||
$session->errorHandler->warn("Check recurring postback: No base transction for XID: [$originatingXid]");
|
$session->log->warn("Check recurring postback: No base transction for XID: [$originatingXid]");
|
||||||
$session->http->setStatus(500);
|
$session->http->setStatus(500);
|
||||||
return "Check recurring postback. No base transction for XID: [$originatingXid]";
|
return "Check recurring postback. No base transction for XID: [$originatingXid]";
|
||||||
}
|
}
|
||||||
|
|
@ -722,7 +722,7 @@ sub www_processRecurringTransactionPostback {
|
||||||
# Secondly check if the postback is coming from secure.paymentclearing.com
|
# Secondly check if the postback is coming from secure.paymentclearing.com
|
||||||
# This will most certainly fail on mod_proxied webgui instances
|
# This will most certainly fail on mod_proxied webgui instances
|
||||||
# unless ( $ENV{ HTTP_HOST } eq 'secure.paymentclearing.com') {
|
# unless ( $ENV{ HTTP_HOST } eq 'secure.paymentclearing.com') {
|
||||||
# $session->errorHandler->info('ITransact Recurring Payment Postback is coming from host: ['.$ENV{ HTTP_HOST }.']');
|
# $session->log->info('ITransact Recurring Payment Postback is coming from host: ['.$ENV{ HTTP_HOST }.']');
|
||||||
# return;
|
# return;
|
||||||
# }
|
# }
|
||||||
|
|
||||||
|
|
@ -731,7 +731,7 @@ sub www_processRecurringTransactionPostback {
|
||||||
# $baseTransaction->get('amount') + $baseTransaction->get('taxes') + $baseTransaction->get('shippingPrice') );
|
# $baseTransaction->get('amount') + $baseTransaction->get('taxes') + $baseTransaction->get('shippingPrice') );
|
||||||
|
|
||||||
# unless ( $self->checkRecurringTransaction( $xid, $expectedAmount ) ) {
|
# unless ( $self->checkRecurringTransaction( $xid, $expectedAmount ) ) {
|
||||||
# $session->errorHandler->warn('Check recurring postback: transaction check failed.');
|
# $session->log->warn('Check recurring postback: transaction check failed.');
|
||||||
# return 'Check recurring postback: transaction check failed.';
|
# return 'Check recurring postback: transaction check failed.';
|
||||||
# }
|
# }
|
||||||
#---- Passed all test, continue ---------------
|
#---- Passed all test, continue ---------------
|
||||||
|
|
|
||||||
|
|
@ -1226,7 +1226,7 @@ sub www_refundItem {
|
||||||
my $form = $session->form;
|
my $form = $session->form;
|
||||||
my $item = eval { $self->getItem($form->get("itemId")) };
|
my $item = eval { $self->getItem($form->get("itemId")) };
|
||||||
if (WebGUI::Error->caught()) {
|
if (WebGUI::Error->caught()) {
|
||||||
$session->errorHandler->error("Can't get item ".$form->get("itemId"));
|
$session->log->error("Can't get item ".$form->get("itemId"));
|
||||||
return $class->www_view($session);
|
return $class->www_view($session);
|
||||||
}
|
}
|
||||||
$item->issueCredit;
|
$item->issueCredit;
|
||||||
|
|
@ -1461,7 +1461,7 @@ sub www_viewItem {
|
||||||
my $self = $class->new($session, $session->form->get("transactionId"));
|
my $self = $class->new($session, $session->form->get("transactionId"));
|
||||||
my $item = eval { $self->getItem($session->form->get("itemId")) };
|
my $item = eval { $self->getItem($session->form->get("itemId")) };
|
||||||
if (WebGUI::Error->caught()) {
|
if (WebGUI::Error->caught()) {
|
||||||
$session->errorHandler->error("Can't get item ".$session->form->get("itemId"));
|
$session->log->error("Can't get item ".$session->form->get("itemId"));
|
||||||
return $class->www_view($session);
|
return $class->www_view($session);
|
||||||
}
|
}
|
||||||
return $item->getSku->www_view;
|
return $item->getSku->www_view;
|
||||||
|
|
@ -1516,7 +1516,7 @@ sub www_updateItem {
|
||||||
my $form = $session->form;
|
my $form = $session->form;
|
||||||
my $item = eval { $self->getItem($form->get("itemId")) };
|
my $item = eval { $self->getItem($form->get("itemId")) };
|
||||||
if (WebGUI::Error->caught()) {
|
if (WebGUI::Error->caught()) {
|
||||||
$session->errorHandler->error("Can't get item ".$form->get("itemId"));
|
$session->log->error("Can't get item ".$form->get("itemId"));
|
||||||
return $class->www_view($session);
|
return $class->www_view($session);
|
||||||
}
|
}
|
||||||
$item->update({
|
$item->update({
|
||||||
|
|
|
||||||
|
|
@ -104,7 +104,7 @@ sub _addError {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
my $errorMessage = shift;
|
my $errorMessage = shift;
|
||||||
push(@{$self->{_errors}},$errorMessage);
|
push(@{$self->{_errors}},$errorMessage);
|
||||||
$self->session->errorHandler->error($errorMessage);
|
$self->session->log->error($errorMessage);
|
||||||
}
|
}
|
||||||
|
|
||||||
#-------------------------------------------------------------------
|
#-------------------------------------------------------------------
|
||||||
|
|
@ -247,40 +247,40 @@ sub addFileFromCaptcha {
|
||||||
my $image = Image::Magick->new();
|
my $image = Image::Magick->new();
|
||||||
$error = $image->Set(size=>'200x50');
|
$error = $image->Set(size=>'200x50');
|
||||||
if($error) {
|
if($error) {
|
||||||
$self->session->errorHandler->warn("Error setting captcha image size: $error");
|
$self->session->log->warn("Error setting captcha image size: $error");
|
||||||
}
|
}
|
||||||
$error = $image->ReadImage('xc:white');
|
$error = $image->ReadImage('xc:white');
|
||||||
if($error) {
|
if($error) {
|
||||||
$self->session->errorHandler->warn("Error initializing image: $error");
|
$self->session->log->warn("Error initializing image: $error");
|
||||||
}
|
}
|
||||||
$error = $image->AddNoise(noise=>"Multiplicative");
|
$error = $image->AddNoise(noise=>"Multiplicative");
|
||||||
if($error) {
|
if($error) {
|
||||||
$self->session->errorHandler->warn("Error adding noise: $error");
|
$self->session->log->warn("Error adding noise: $error");
|
||||||
}
|
}
|
||||||
# AddNoise generates a different average color depending on library. This is ugly, but the best I can see for now
|
# AddNoise generates a different average color depending on library. This is ugly, but the best I can see for now
|
||||||
$error = $image->Annotate(font=>WebGUI::Paths->share.'/default.ttf', pointsize=>40, skewY=>0, skewX=>0, gravity=>'center', fill=>'#ffffff', antialias=>'true', text=>$challenge);
|
$error = $image->Annotate(font=>WebGUI::Paths->share.'/default.ttf', pointsize=>40, skewY=>0, skewX=>0, gravity=>'center', fill=>'#ffffff', antialias=>'true', text=>$challenge);
|
||||||
if($error) {
|
if($error) {
|
||||||
$self->session->errorHandler->warn("Error Annotating image: $error");
|
$self->session->log->warn("Error Annotating image: $error");
|
||||||
}
|
}
|
||||||
$error = $image->Draw(primitive=>"line", points=>"5,5 195,45", stroke=>'#ffffff', antialias=>'true', strokewidth=>2);
|
$error = $image->Draw(primitive=>"line", points=>"5,5 195,45", stroke=>'#ffffff', antialias=>'true', strokewidth=>2);
|
||||||
if($error) {
|
if($error) {
|
||||||
$self->session->errorHandler->warn("Error drawing line: $error");
|
$self->session->log->warn("Error drawing line: $error");
|
||||||
}
|
}
|
||||||
$error = $image->Blur(geometry=>"9");
|
$error = $image->Blur(geometry=>"9");
|
||||||
if($error) {
|
if($error) {
|
||||||
$self->session->errorHandler->warn("Error blurring image: $error");
|
$self->session->log->warn("Error blurring image: $error");
|
||||||
}
|
}
|
||||||
$error = $image->Set(type=>"Grayscale");
|
$error = $image->Set(type=>"Grayscale");
|
||||||
if($error) {
|
if($error) {
|
||||||
$self->session->errorHandler->warn("Error setting grayscale: $error");
|
$self->session->log->warn("Error setting grayscale: $error");
|
||||||
}
|
}
|
||||||
$error = $image->Border(fill=>'black', width=>1, height=>1);
|
$error = $image->Border(fill=>'black', width=>1, height=>1);
|
||||||
if($error) {
|
if($error) {
|
||||||
$self->session->errorHandler->warn("Error setting border: $error");
|
$self->session->log->warn("Error setting border: $error");
|
||||||
}
|
}
|
||||||
$error = $image->Write($self->getPath($filename));
|
$error = $image->Write($self->getPath($filename));
|
||||||
if($error) {
|
if($error) {
|
||||||
$self->session->errorHandler->warn("Error writing image: $error");
|
$self->session->log->warn("Error writing image: $error");
|
||||||
}
|
}
|
||||||
return ($filename, $challenge);
|
return ($filename, $challenge);
|
||||||
}
|
}
|
||||||
|
|
@ -364,7 +364,7 @@ sub addFileFromFormPost {
|
||||||
my $filename;
|
my $filename;
|
||||||
my $attachmentCount = 1;
|
my $attachmentCount = 1;
|
||||||
foreach my $upload ($session->request->upload($formVariableName)) {
|
foreach my $upload ($session->request->upload($formVariableName)) {
|
||||||
$session->errorHandler->info("Trying to get " . $upload->filename." from ".$formVariableName);
|
$session->log->info("Trying to get " . $upload->filename." from ".$formVariableName);
|
||||||
if ( $attachmentCount > $attachmentLimit ) {
|
if ( $attachmentCount > $attachmentLimit ) {
|
||||||
$self->_cdnAdd;
|
$self->_cdnAdd;
|
||||||
return $filename;
|
return $filename;
|
||||||
|
|
@ -384,7 +384,7 @@ sub addFileFromFormPost {
|
||||||
$attachmentCount++;
|
$attachmentCount++;
|
||||||
if (File::Copy::move($upload->path, $filePath)) {
|
if (File::Copy::move($upload->path, $filePath)) {
|
||||||
$self->_changeOwner($filePath);
|
$self->_changeOwner($filePath);
|
||||||
$self->session->errorHandler->info("Got ".$upload->filename);
|
$self->session->log->info("Got ".$upload->filename);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$self->_addError("Couldn't open file ".$self->getPath($filename)." for writing due to error: ".$!);
|
$self->_addError("Couldn't open file ".$self->getPath($filename)." for writing due to error: ".$!);
|
||||||
|
|
@ -638,7 +638,7 @@ sub create {
|
||||||
my $self = $class->get($session,$id);
|
my $self = $class->get($session,$id);
|
||||||
$self->_makePath;
|
$self->_makePath;
|
||||||
|
|
||||||
$session->errorHandler->info("Created storage location $id as a $class");
|
$session->log->info("Created storage location $id as a $class");
|
||||||
return $self;
|
return $self;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -690,7 +690,7 @@ sub delete {
|
||||||
}
|
}
|
||||||
# Delete the content from the CDN - enqueue
|
# Delete the content from the CDN - enqueue
|
||||||
$self->_cdnDel(0);
|
$self->_cdnDel(0);
|
||||||
$self->session->errorHandler->info("Deleted storage ".$self->getId);
|
$self->session->log->info("Deleted storage ".$self->getId);
|
||||||
return undef;
|
return undef;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -814,17 +814,17 @@ sub generateThumbnail {
|
||||||
my $filename = shift;
|
my $filename = shift;
|
||||||
my $thumbnailSize = shift || $self->session->setting->get("thumbnailSize") || 100;
|
my $thumbnailSize = shift || $self->session->setting->get("thumbnailSize") || 100;
|
||||||
unless (defined $filename) {
|
unless (defined $filename) {
|
||||||
$self->session->errorHandler->error("Can't generate a thumbnail when you haven't specified a file.");
|
$self->session->log->error("Can't generate a thumbnail when you haven't specified a file.");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
unless ($self->isImage($filename)) {
|
unless ($self->isImage($filename)) {
|
||||||
$self->session->errorHandler->warn("Can't generate a thumbnail for something that's not an image.");
|
$self->session->log->warn("Can't generate a thumbnail for something that's not an image.");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
my $image = Image::Magick->new;
|
my $image = Image::Magick->new;
|
||||||
my $error = $image->Read($self->getPath($filename));
|
my $error = $image->Read($self->getPath($filename));
|
||||||
if ($error) {
|
if ($error) {
|
||||||
$self->session->errorHandler->error("Couldn't read image for thumbnail creation: ".$error);
|
$self->session->log->error("Couldn't read image for thumbnail creation: ".$error);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
my ($x, $y) = $image->Get('width','height');
|
my ($x, $y) = $image->Get('width','height');
|
||||||
|
|
@ -840,7 +840,7 @@ sub generateThumbnail {
|
||||||
}
|
}
|
||||||
$error = $image->Write($self->getPath.'/'.'thumb-'.$filename);
|
$error = $image->Write($self->getPath.'/'.'thumb-'.$filename);
|
||||||
if ($error) {
|
if ($error) {
|
||||||
$self->session->errorHandler->error("Couldn't create thumbnail: ".$error);
|
$self->session->log->error("Couldn't create thumbnail: ".$error);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
return 1;
|
return 1;
|
||||||
|
|
@ -884,11 +884,11 @@ sub getCdnFileIterator {
|
||||||
return $sub;
|
return $sub;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$session->errorHandler->warn("CDN: cannot read directory $cdnCfg->{'queuePath'}");
|
$session->log->warn("CDN: cannot read directory $cdnCfg->{'queuePath'}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$session->errorHandler->warn("CDN: enabled but no queuePath");
|
$session->log->warn("CDN: enabled but no queuePath");
|
||||||
}
|
}
|
||||||
} ## end if ( $cdnCfg and $cdnCfg...
|
} ## end if ( $cdnCfg and $cdnCfg...
|
||||||
} ## end sub getCdnFileIterator
|
} ## end sub getCdnFileIterator
|
||||||
|
|
@ -911,7 +911,7 @@ sub getSize {
|
||||||
my $image = Image::Magick->new;
|
my $image = Image::Magick->new;
|
||||||
my $error = $image->Read($self->getPath($filename));
|
my $error = $image->Read($self->getPath($filename));
|
||||||
if ($error) {
|
if ($error) {
|
||||||
$self->session->errorHandler->error("Couldn't read image for size reading: ".$error);
|
$self->session->log->error("Couldn't read image for size reading: ".$error);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
my ($x, $y) = $image->Get('width','height');
|
my ($x, $y) = $image->Get('width','height');
|
||||||
|
|
@ -1229,17 +1229,17 @@ sub getSizeInPixels {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
my $filename = shift;
|
my $filename = shift;
|
||||||
unless (defined $filename) {
|
unless (defined $filename) {
|
||||||
$self->session->errorHandler->error("Can't check the size when you haven't specified a file.");
|
$self->session->log->error("Can't check the size when you haven't specified a file.");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
unless ($self->isImage($filename)) {
|
unless ($self->isImage($filename)) {
|
||||||
$self->session->errorHandler->error("Can't check the size of something that's not an image.");
|
$self->session->log->error("Can't check the size of something that's not an image.");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
my $image = Image::Magick->new;
|
my $image = Image::Magick->new;
|
||||||
my $error = $image->Read($self->getPath($filename));
|
my $error = $image->Read($self->getPath($filename));
|
||||||
if ($error) {
|
if ($error) {
|
||||||
$self->session->errorHandler->error("Couldn't read image to check the size of it: ".$error);
|
$self->session->log->error("Couldn't read image to check the size of it: ".$error);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
return $image->Get('width','height');
|
return $image->Get('width','height');
|
||||||
|
|
@ -1262,7 +1262,7 @@ sub getThumbnailUrl {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
my $filename = shift;
|
my $filename = shift;
|
||||||
if (! defined $filename) {
|
if (! defined $filename) {
|
||||||
$self->session->errorHandler->error("Can't find a thumbnail url without a filename.");
|
$self->session->log->error("Can't find a thumbnail url without a filename.");
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
if (! $self->isImage($filename)) {
|
if (! $self->isImage($filename)) {
|
||||||
|
|
@ -1270,7 +1270,7 @@ sub getThumbnailUrl {
|
||||||
}
|
}
|
||||||
my $thumbname = 'thumb-' . $filename;
|
my $thumbname = 'thumb-' . $filename;
|
||||||
if (! -e $self->getPath($thumbname)) {
|
if (! -e $self->getPath($thumbname)) {
|
||||||
$self->session->errorHandler->error("Can't find a thumbnail for a file named '$filename' that is not in my storage location.");
|
$self->session->log->error("Can't find a thumbnail for a file named '$filename' that is not in my storage location.");
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
return $self->getUrl($thumbname);
|
return $self->getUrl($thumbname);
|
||||||
|
|
@ -1398,34 +1398,34 @@ sub crop {
|
||||||
my $x = shift;
|
my $x = shift;
|
||||||
my $y = shift;
|
my $y = shift;
|
||||||
unless (defined $filename) {
|
unless (defined $filename) {
|
||||||
$self->session->errorHandler->error("Can't resize when you haven't specified a file.");
|
$self->session->log->error("Can't resize when you haven't specified a file.");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
unless ($self->isImage($filename)) {
|
unless ($self->isImage($filename)) {
|
||||||
$self->session->errorHandler->error("Can't resize something that's not an image.");
|
$self->session->log->error("Can't resize something that's not an image.");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
unless ($width || $height || $x || $y) {
|
unless ($width || $height || $x || $y) {
|
||||||
$self->session->errorHandler->error("Can't resize with no resizing parameters.");
|
$self->session->log->error("Can't resize with no resizing parameters.");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
my $image = Image::Magick->new;
|
my $image = Image::Magick->new;
|
||||||
my $error = $image->Read($self->getPath($filename));
|
my $error = $image->Read($self->getPath($filename));
|
||||||
if ($error) {
|
if ($error) {
|
||||||
$self->session->errorHandler->error("Couldn't read image for resizing: ".$error);
|
$self->session->log->error("Couldn't read image for resizing: ".$error);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
# Next, resize dimensions
|
# Next, resize dimensions
|
||||||
if ( $width || $height || $x || $y ) {
|
if ( $width || $height || $x || $y ) {
|
||||||
$self->session->errorHandler->info( "Resizing $filename to w:$width h:$height x:$x y:$y" );
|
$self->session->log->info( "Resizing $filename to w:$width h:$height x:$x y:$y" );
|
||||||
$image->Crop( height => $height, width => $width, x => $x, y => $y );
|
$image->Crop( height => $height, width => $width, x => $x, y => $y );
|
||||||
}
|
}
|
||||||
|
|
||||||
# Write our changes to disk
|
# Write our changes to disk
|
||||||
$error = $image->Write($self->getPath($filename));
|
$error = $image->Write($self->getPath($filename));
|
||||||
if ($error) {
|
if ($error) {
|
||||||
$self->session->errorHandler->error("Couldn't resize image: ".$error);
|
$self->session->log->error("Couldn't resize image: ".$error);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1458,19 +1458,19 @@ sub annotate {
|
||||||
my $asset = shift;
|
my $asset = shift;
|
||||||
my $form = shift;
|
my $form = shift;
|
||||||
unless (defined $filename) {
|
unless (defined $filename) {
|
||||||
$self->session->errorHandler->error("Can't rotate when you haven't specified a file.");
|
$self->session->log->error("Can't rotate when you haven't specified a file.");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
unless ($self->isImage($filename)) {
|
unless ($self->isImage($filename)) {
|
||||||
$self->session->errorHandler->error("Can't rotate something that's not an image.");
|
$self->session->log->error("Can't rotate something that's not an image.");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
# unless ($annotate_text) {
|
# unless ($annotate_text) {
|
||||||
# $self->session->errorHandler->error("Can't annotate with no text.");
|
# $self->session->log->error("Can't annotate with no text.");
|
||||||
# return 0;
|
# return 0;
|
||||||
# }
|
# }
|
||||||
# unless ($annotate_top && $annotate_left && $annotate_width && $annotate_height) {
|
# unless ($annotate_top && $annotate_left && $annotate_width && $annotate_height) {
|
||||||
# $self->session->errorHandler->error("Can't annotate with no dimensions.");
|
# $self->session->log->error("Can't annotate with no dimensions.");
|
||||||
# return 0;
|
# return 0;
|
||||||
# }
|
# }
|
||||||
|
|
||||||
|
|
@ -1534,27 +1534,27 @@ sub rotate {
|
||||||
my $filename = shift;
|
my $filename = shift;
|
||||||
my $degree = shift || 0;
|
my $degree = shift || 0;
|
||||||
unless (defined $filename) {
|
unless (defined $filename) {
|
||||||
$self->session->errorHandler->error("Can't rotate when you haven't specified a file.");
|
$self->session->log->error("Can't rotate when you haven't specified a file.");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
unless ($self->isImage($filename)) {
|
unless ($self->isImage($filename)) {
|
||||||
$self->session->errorHandler->error("Can't rotate something that's not an image.");
|
$self->session->log->error("Can't rotate something that's not an image.");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
my $image = Image::Magick->new;
|
my $image = Image::Magick->new;
|
||||||
my $error = $image->Read($self->getPath($filename));
|
my $error = $image->Read($self->getPath($filename));
|
||||||
if ($error) {
|
if ($error) {
|
||||||
$self->session->errorHandler->error("Couldn't read image for resizing: ".$error);
|
$self->session->log->error("Couldn't read image for resizing: ".$error);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
$self->session->errorHandler->info( "Rotating $filename by $degree degrees" );
|
$self->session->log->info( "Rotating $filename by $degree degrees" );
|
||||||
$image->Rotate( $degree );
|
$image->Rotate( $degree );
|
||||||
|
|
||||||
# Write our changes to disk
|
# Write our changes to disk
|
||||||
$error = $image->Write($self->getPath($filename));
|
$error = $image->Write($self->getPath($filename));
|
||||||
if ($error) {
|
if ($error) {
|
||||||
$self->session->errorHandler->error("Couldn't rotate image: ".$error);
|
$self->session->log->error("Couldn't rotate image: ".$error);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1594,27 +1594,27 @@ sub resize {
|
||||||
my $height = shift;
|
my $height = shift;
|
||||||
my $density = shift;
|
my $density = shift;
|
||||||
unless (defined $filename) {
|
unless (defined $filename) {
|
||||||
$self->session->errorHandler->error("Can't resize when you haven't specified a file.");
|
$self->session->log->error("Can't resize when you haven't specified a file.");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
unless ($self->isImage($filename)) {
|
unless ($self->isImage($filename)) {
|
||||||
$self->session->errorHandler->error("Can't resize something that's not an image.");
|
$self->session->log->error("Can't resize something that's not an image.");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
unless ($width || $height || $density) {
|
unless ($width || $height || $density) {
|
||||||
$self->session->errorHandler->error("Can't resize with no resizing parameters.");
|
$self->session->log->error("Can't resize with no resizing parameters.");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
my $image = Image::Magick->new;
|
my $image = Image::Magick->new;
|
||||||
my $error = $image->Read($self->getPath($filename));
|
my $error = $image->Read($self->getPath($filename));
|
||||||
if ($error) {
|
if ($error) {
|
||||||
$self->session->errorHandler->error("Couldn't read image for resizing: ".$error);
|
$self->session->log->error("Couldn't read image for resizing: ".$error);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
# First, change image density
|
# First, change image density
|
||||||
if ( $density ) {
|
if ( $density ) {
|
||||||
$self->session->errorHandler->info( "Setting $filename to $density" );
|
$self->session->log->info( "Setting $filename to $density" );
|
||||||
$image->Set( density => "${density}x${density}" );
|
$image->Set( density => "${density}x${density}" );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1631,14 +1631,14 @@ sub resize {
|
||||||
elsif (!$width) { # proportional scale by height
|
elsif (!$width) { # proportional scale by height
|
||||||
$width = $height * $x / $y;
|
$width = $height * $x / $y;
|
||||||
}
|
}
|
||||||
$self->session->errorHandler->info( "Resizing $filename to w:$width h:$height" );
|
$self->session->log->info( "Resizing $filename to w:$width h:$height" );
|
||||||
$image->Resize( height => $height, width => $width );
|
$image->Resize( height => $height, width => $width );
|
||||||
}
|
}
|
||||||
|
|
||||||
# Write our changes to disk
|
# Write our changes to disk
|
||||||
$error = $image->Write($self->getPath($filename));
|
$error = $image->Write($self->getPath($filename));
|
||||||
if ($error) {
|
if ($error) {
|
||||||
$self->session->errorHandler->error("Couldn't resize image: ".$error);
|
$self->session->log->error("Couldn't resize image: ".$error);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -84,7 +84,7 @@ sub _create {
|
||||||
my @fields = @{WebGUI::ProfileField->getFields($session)};
|
my @fields = @{WebGUI::ProfileField->getFields($session)};
|
||||||
my $privacy = {};
|
my $privacy = {};
|
||||||
foreach my $field (@fields) {
|
foreach my $field (@fields) {
|
||||||
#$session->errorHandler->warn('getting privacy setting for field: '.$fieldName);
|
#$session->log->warn('getting privacy setting for field: '.$fieldName);
|
||||||
my $privacySetting = $field->get('defaultPrivacySetting');
|
my $privacySetting = $field->get('defaultPrivacySetting');
|
||||||
next unless $privacySetting ~~ [qw(all none friends)];
|
next unless $privacySetting ~~ [qw(all none friends)];
|
||||||
$privacy->{$field->get('fieldName')} = $privacySetting;
|
$privacy->{$field->get('fieldName')} = $privacySetting;
|
||||||
|
|
@ -152,7 +152,7 @@ sub acceptsPrivateMessages {
|
||||||
if($pmSetting eq "friends") {
|
if($pmSetting eq "friends") {
|
||||||
my $friendsGroup = $self->friends;
|
my $friendsGroup = $self->friends;
|
||||||
my $sentBy = WebGUI::User->new($self->session,$userId);
|
my $sentBy = WebGUI::User->new($self->session,$userId);
|
||||||
#$self->session->errorHandler->warn($self->isInGroup($friendsGroup->getId));
|
#$self->session->log->warn($self->isInGroup($friendsGroup->getId));
|
||||||
return $sentBy->isInGroup($friendsGroup->getId);
|
return $sentBy->isInGroup($friendsGroup->getId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -571,7 +571,7 @@ sub get {
|
||||||
# XXX Should the defaults be set in new() ...
|
# XXX Should the defaults be set in new() ...
|
||||||
if ( !exists $self->{_profile}->{$field} ) {
|
if ( !exists $self->{_profile}->{$field} ) {
|
||||||
if ( !WebGUI::ProfileField->exists( $session, $field ) ) {
|
if ( !WebGUI::ProfileField->exists( $session, $field ) ) {
|
||||||
$self->session->errorHandler->warn("No such profile field: $field");
|
$self->session->log->warn("No such profile field: $field");
|
||||||
}
|
}
|
||||||
|
|
||||||
my $default = $session->db->quickScalar("SELECT dataDefault FROM userProfileField WHERE fieldName=?", [$field]);
|
my $default = $session->db->quickScalar("SELECT dataDefault FROM userProfileField WHERE fieldName=?", [$field]);
|
||||||
|
|
@ -1407,7 +1407,7 @@ sub update {
|
||||||
my @profileValues = ();
|
my @profileValues = ();
|
||||||
for my $key ( keys %{$properties} ) {
|
for my $key ( keys %{$properties} ) {
|
||||||
if (!exists $self->{_profile}{$key} && !WebGUI::ProfileField->exists($session,$key)) {
|
if (!exists $self->{_profile}{$key} && !WebGUI::ProfileField->exists($session,$key)) {
|
||||||
$self->session->errorHandler->warn("No such profile field: $key");
|
$self->session->log->warn("No such profile field: $key");
|
||||||
next;
|
next;
|
||||||
}
|
}
|
||||||
push @profileFields, $db->quote_identifier( $key ) . " = ?";
|
push @profileFields, $db->quote_identifier( $key ) . " = ?";
|
||||||
|
|
|
||||||
|
|
@ -371,7 +371,7 @@ sub getAssets {
|
||||||
ASSETID: while (my ($id,$version) = $sth->array) {
|
ASSETID: while (my ($id,$version) = $sth->array) {
|
||||||
my $asset = eval { WebGUI::Asset->newById($self->session,$id,$version); };
|
my $asset = eval { WebGUI::Asset->newById($self->session,$id,$version); };
|
||||||
unless (defined $asset) {
|
unless (defined $asset) {
|
||||||
$self->session->errorHandler->error("Asset $id $version could not be instanciated by version tag ".$self->getId.". Perhaps it is corrupt.");
|
$self->session->log->error("Asset $id $version could not be instanciated by version tag ".$self->getId.". Perhaps it is corrupt.");
|
||||||
next ASSETID;
|
next ASSETID;
|
||||||
}
|
}
|
||||||
push(@assets, $asset);
|
push(@assets, $asset);
|
||||||
|
|
@ -736,7 +736,7 @@ sub rollback {
|
||||||
my $outputSub = exists $options->{outputSub} ? $options->{outputSub} : sub {};
|
my $outputSub = exists $options->{outputSub} ? $options->{outputSub} : sub {};
|
||||||
my $tagId = $self->getId;
|
my $tagId = $self->getId;
|
||||||
if ($tagId eq "pbversion0000000000001") {
|
if ($tagId eq "pbversion0000000000001") {
|
||||||
$session->errorHandler->warn("You cannot rollback a tag that is required for the system to operate.");
|
$session->log->warn("You cannot rollback a tag that is required for the system to operate.");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
my $sth = $session->db->read("select asset.assetId, assetData.revisionDate from assetData left join asset using(assetId) where assetData.tagId = ? order by asset.lineage desc, assetData.revisionDate desc", [ $tagId ]);
|
my $sth = $session->db->read("select asset.assetId, assetData.revisionDate from assetData left join asset using(assetId) where assetData.tagId = ? order by asset.lineage desc, assetData.revisionDate desc", [ $tagId ]);
|
||||||
|
|
|
||||||
|
|
@ -293,7 +293,7 @@ sub new {
|
||||||
$class = $main->{className};
|
$class = $main->{className};
|
||||||
eval { WebGUI::Pluggable::load($class) };
|
eval { WebGUI::Pluggable::load($class) };
|
||||||
if ($@) {
|
if ($@) {
|
||||||
$session->errorHandler->error($@);
|
$session->log->error($@);
|
||||||
return undef;
|
return undef;
|
||||||
}
|
}
|
||||||
my $sub = $session->db->buildHashRef("select name,value from WorkflowActivityData where activityId=?",[$activityId]);
|
my $sub = $session->db->buildHashRef("select name,value from WorkflowActivityData where activityId=?",[$activityId]);
|
||||||
|
|
@ -333,7 +333,7 @@ sub newByPropertyHashRef {
|
||||||
my $className = $properties->{className};
|
my $className = $properties->{className};
|
||||||
eval { WebGUI::Pluggable::load($className) };
|
eval { WebGUI::Pluggable::load($className) };
|
||||||
if ($@) {
|
if ($@) {
|
||||||
$session->errorHandler->error($@);
|
$session->log->error($@);
|
||||||
return undef;
|
return undef;
|
||||||
}
|
}
|
||||||
bless {_session=>$session, _id=>$properties->{activityId}, _data => $properties}, $className;
|
bless {_session=>$session, _id=>$properties->{activityId}, _data => $properties}, $className;
|
||||||
|
|
|
||||||
|
|
@ -84,7 +84,7 @@ sub execute {
|
||||||
} else {
|
} else {
|
||||||
# If something strange happened and we ended up with > 1 matching rows, cut our losses and remove offending userLoginLog rows (otherwise we
|
# If something strange happened and we ended up with > 1 matching rows, cut our losses and remove offending userLoginLog rows (otherwise we
|
||||||
# could end up with ridiculously long user recorded times)
|
# could end up with ridiculously long user recorded times)
|
||||||
$self->session->errorHandler->warn("More than 1 old userLoginLog rows found, removing offending rows");
|
$self->session->log->warn("More than 1 old userLoginLog rows found, removing offending rows");
|
||||||
$self->session->db->write("delete from userLoginLog where lastPageViewed = timeStamp and sessionId = ? ", [$sessionId] );
|
$self->session->db->write("delete from userLoginLog where lastPageViewed = timeStamp and sessionId = ? ", [$sessionId] );
|
||||||
}
|
}
|
||||||
my $session = WebGUI::Session->open($self->session->config, undef, $sessionId, 1);
|
my $session = WebGUI::Session->open($self->session->config, undef, $sessionId, 1);
|
||||||
|
|
|
||||||
|
|
@ -102,14 +102,14 @@ sub execute {
|
||||||
my $instance = shift;
|
my $instance = shift;
|
||||||
|
|
||||||
unless ($self->session->config->get('exportPath')) {
|
unless ($self->session->config->get('exportPath')) {
|
||||||
$self->session->errorHandler->warn("DeleteExportedFiles: no export path, so not doing anything");
|
$self->session->log->warn("DeleteExportedFiles: no export path, so not doing anything");
|
||||||
return $self->COMPLETE;
|
return $self->COMPLETE;
|
||||||
}
|
}
|
||||||
|
|
||||||
my $time = time;
|
my $time = time;
|
||||||
my $filesRef = Storable::thaw($instance->getScratch(DELETE_FILES_SCRATCH));
|
my $filesRef = Storable::thaw($instance->getScratch(DELETE_FILES_SCRATCH));
|
||||||
unless ($filesRef) {
|
unless ($filesRef) {
|
||||||
$self->session->errorHandler->error("DeleteExportedFiles: can't find list of files to delete");
|
$self->session->log->error("DeleteExportedFiles: can't find list of files to delete");
|
||||||
return $self->ERROR;
|
return $self->ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -119,14 +119,14 @@ sub execute {
|
||||||
my $ttl = $self->getTTL;
|
my $ttl = $self->getTTL;
|
||||||
while (defined(my $filename = shift @files)) {
|
while (defined(my $filename = shift @files)) {
|
||||||
my $cfilename = $self->_canonExportPath($filename);
|
my $cfilename = $self->_canonExportPath($filename);
|
||||||
unlink $cfilename or $self->session->errorHandler->warn("DeleteExportedFiles: Couldn't unlink $filename: $!"), next;
|
unlink $cfilename or $self->session->log->warn("DeleteExportedFiles: Couldn't unlink $filename: $!"), next;
|
||||||
push @dirs, $self->_pruneOfFile($filename);
|
push @dirs, $self->_pruneOfFile($filename);
|
||||||
goto pause if (time - $time > $ttl);
|
goto pause if (time - $time > $ttl);
|
||||||
}
|
}
|
||||||
|
|
||||||
while (defined(my $dirname = shift @dirs)) {
|
while (defined(my $dirname = shift @dirs)) {
|
||||||
my $cdirname = $self->_canonExportPath($dirname);
|
my $cdirname = $self->_canonExportPath($dirname);
|
||||||
rmdir $cdirname or $self->session->errorHandler->warn("DeleteExportedFiles: couldn't rmdir $dirname: $!"), next;
|
rmdir $cdirname or $self->session->log->warn("DeleteExportedFiles: couldn't rmdir $dirname: $!"), next;
|
||||||
push @dirs, $self->_pruneOfFile($dirname);
|
push @dirs, $self->_pruneOfFile($dirname);
|
||||||
goto pause if (time - $time > $ttl);
|
goto pause if (time - $time > $ttl);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -79,7 +79,7 @@ sub execute {
|
||||||
my $object = shift;
|
my $object = shift;
|
||||||
my $instance = shift;
|
my $instance = shift;
|
||||||
my $start = time();
|
my $start = time();
|
||||||
my $log = $self->session->errorHandler;
|
my $log = $self->session->log;
|
||||||
$log->info('Searching for EMS items that have been in the cart too long.');
|
$log->info('Searching for EMS items that have been in the cart too long.');
|
||||||
my $ttl = $self->getTTL;
|
my $ttl = $self->getTTL;
|
||||||
my $items = $self->session->db->read("select itemId, cartId, assetId from cartItem where
|
my $items = $self->session->db->read("select itemId, cartId, assetId from cartItem where
|
||||||
|
|
|
||||||
|
|
@ -181,10 +181,10 @@ sub execute {
|
||||||
unless (defined $user) { #if no user
|
unless (defined $user) { #if no user
|
||||||
unless ($postGroup eq 1 || $postGroup eq 7) { #reject mail if no registered email, unless post group is Visitors (1) or Everyone (7)
|
unless ($postGroup eq 1 || $postGroup eq 7) { #reject mail if no registered email, unless post group is Visitors (1) or Everyone (7)
|
||||||
if ($message->{from} eq "") {
|
if ($message->{from} eq "") {
|
||||||
$self->session->errorHandler->error("For some reason the message ".$message->{subject}." (".$message->{messageId}.") has no from address.");
|
$self->session->log->error("For some reason the message ".$message->{subject}." (".$message->{messageId}.") has no from address.");
|
||||||
}
|
}
|
||||||
elsif ($message->{from} eq $cs->get("mailAddress")) {
|
elsif ($message->{from} eq $cs->get("mailAddress")) {
|
||||||
$self->session->errorHandler->error("For some reason the message ".$message->{subject}." (".$message->{messageId}.") has the same from address as the collaboration system's mail address.");
|
$self->session->log->error("For some reason the message ".$message->{subject}." (".$message->{messageId}.") has the same from address as the collaboration system's mail address.");
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
my $send = WebGUI::Mail::Send->create($self->session, {
|
my $send = WebGUI::Mail::Send->create($self->session, {
|
||||||
|
|
|
||||||
|
|
@ -73,7 +73,7 @@ sub execute {
|
||||||
my $object = shift;
|
my $object = shift;
|
||||||
my $instance = shift;
|
my $instance = shift;
|
||||||
unless (defined $instance) {
|
unless (defined $instance) {
|
||||||
$self->session->errorHandler->error("Could not instanciate Workflow Instance in GetSyndicatedContent Activity");
|
$self->session->log->error("Could not instanciate Workflow Instance in GetSyndicatedContent Activity");
|
||||||
return $self->ERROR;
|
return $self->ERROR;
|
||||||
}
|
}
|
||||||
my $log = $self->session->log;
|
my $log = $self->session->log;
|
||||||
|
|
|
||||||
|
|
@ -78,7 +78,7 @@ See WebGUI::Workflow::Activity::execute() for details.
|
||||||
sub execute {
|
sub execute {
|
||||||
my ($self, $nothing, $instance) = @_;
|
my ($self, $nothing, $instance) = @_;
|
||||||
my $session = $self->session;
|
my $session = $self->session;
|
||||||
my $log = $session->errorHandler;
|
my $log = $session->log;
|
||||||
|
|
||||||
# keep track of how much time it's taking
|
# keep track of how much time it's taking
|
||||||
my $start = time();
|
my $start = time();
|
||||||
|
|
|
||||||
|
|
@ -83,7 +83,7 @@ sub execute {
|
||||||
$self->session->user({user=>$user});
|
$self->session->user({user=>$user});
|
||||||
WebGUI::Macro::process($self->session, \$cmd);
|
WebGUI::Macro::process($self->session, \$cmd);
|
||||||
if (system($cmd)) {
|
if (system($cmd)) {
|
||||||
$self->session->errorHandler->error("Workflow: RunCommandAsUser failed because: $!");
|
$self->session->log->error("Workflow: RunCommandAsUser failed because: $!");
|
||||||
$self->session->user({user=>$previousUser});
|
$self->session->user({user=>$previousUser});
|
||||||
return $self->ERROR;
|
return $self->ERROR;
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
|
|
@ -66,7 +66,7 @@ See WebGUI::Workflow::Activity::execute() for details.
|
||||||
|
|
||||||
sub execute {
|
sub execute {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
my ($db,$eh) = $self->session->quick(qw(db errorHandler));
|
my ($db,$eh) = $self->session->quick(qw(db log));
|
||||||
|
|
||||||
my $time = time();
|
my $time = time();
|
||||||
my $newsletter = undef;
|
my $newsletter = undef;
|
||||||
|
|
|
||||||
|
|
@ -96,7 +96,7 @@ sub execute {
|
||||||
my $request = POST 'https://www.webgui.org/stats', [ func => 'receiveStats', stats => $statsAsJson ];
|
my $request = POST 'https://www.webgui.org/stats', [ func => 'receiveStats', stats => $statsAsJson ];
|
||||||
my $response = $userAgent->request($request);
|
my $response = $userAgent->request($request);
|
||||||
if ($response->is_error) {
|
if ($response->is_error) {
|
||||||
$self->session->errorHandler->error("WebGUI Stats could not be sent.");
|
$self->session->log->error("WebGUI Stats could not be sent.");
|
||||||
}
|
}
|
||||||
return $self->COMPLETE;
|
return $self->COMPLETE;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -132,11 +132,11 @@ sub execute {
|
||||||
filter =>$ldapLink->getValue("ldapIdentity").'='.$userObject->username
|
filter =>$ldapLink->getValue("ldapIdentity").'='.$userObject->username
|
||||||
);
|
);
|
||||||
if($search->code) {
|
if($search->code) {
|
||||||
$self->session->errorHandler->warn("Couldn't search LDAP ".$uri->host." to find user ".$userObject->username." (".$userId.").\nError Message from LDAP: ".$ldapStatusCode{$search->code});
|
$self->session->log->warn("Couldn't search LDAP ".$uri->host." to find user ".$userObject->username." (".$userId.").\nError Message from LDAP: ".$ldapStatusCode{$search->code});
|
||||||
return $self->COMPLETE;
|
return $self->COMPLETE;
|
||||||
}
|
}
|
||||||
elsif ($search->count == 0) {
|
elsif ($search->count == 0) {
|
||||||
$self->session->errorHandler->warn("No results returned for user with dn ".$userData->{connectDN});
|
$self->session->log->warn("No results returned for user with dn ".$userData->{connectDN});
|
||||||
return $self->COMPLETE;
|
return $self->COMPLETE;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
@ -149,7 +149,7 @@ sub execute {
|
||||||
}
|
}
|
||||||
$ldap->unbind;
|
$ldap->unbind;
|
||||||
} else {
|
} else {
|
||||||
$self->session->errorHandler->warn("Error connecting to LDAP: ".$ldapLink->getErrorMessage);
|
$self->session->log->warn("Error connecting to LDAP: ".$ldapLink->getErrorMessage);
|
||||||
return $self->ERROR;
|
return $self->ERROR;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -81,7 +81,7 @@ sub _alias {
|
||||||
}
|
}
|
||||||
#Print an error message if no aliases are found
|
#Print an error message if no aliases are found
|
||||||
unless (scalar(keys %{$alias}) > 0) {
|
unless (scalar(keys %{$alias}) > 0) {
|
||||||
$session->errorHandler->warn("SynchProfilesToLdap: ldapAlias is not configured properly in your WebGUI config file. Please check to make sure that this setting is enabled and contains alias mappings");
|
$session->log->warn("SynchProfilesToLdap: ldapAlias is not configured properly in your WebGUI config file. Please check to make sure that this setting is enabled and contains alias mappings");
|
||||||
}
|
}
|
||||||
#Return the value of the key passed in
|
#Return the value of the key passed in
|
||||||
return $alias->{$key} || $key;
|
return $alias->{$key} || $key;
|
||||||
|
|
@ -137,7 +137,7 @@ sub execute {
|
||||||
if ($rowLinkId ne $currentLinkId) {
|
if ($rowLinkId ne $currentLinkId) {
|
||||||
$link->unbind if defined $link;
|
$link->unbind if defined $link;
|
||||||
$skippingLink = 0;
|
$skippingLink = 0;
|
||||||
# $self->session->errorHandler->warn("DEBUG: SyncProfilesToLdap: Switching to link $rowLinkId");
|
# $self->session->log->warn("DEBUG: SyncProfilesToLdap: Switching to link $rowLinkId");
|
||||||
|
|
||||||
$currentLinkId = $rowLinkId;
|
$currentLinkId = $rowLinkId;
|
||||||
$link = WebGUI::LDAPLink->new($self->session, $rowLinkId);
|
$link = WebGUI::LDAPLink->new($self->session, $rowLinkId);
|
||||||
|
|
@ -146,14 +146,14 @@ sub execute {
|
||||||
$ldap = $link->bind;
|
$ldap = $link->bind;
|
||||||
|
|
||||||
if (my $error = $link->getErrorMessage) {
|
if (my $error = $link->getErrorMessage) {
|
||||||
$self->session->errorHandler->error("SyncProfilesToLdap: Couldn't bind to LDAP link $ldapUrl ($currentLinkId), skipping: $error");
|
$self->session->log->error("SyncProfilesToLdap: Couldn't bind to LDAP link $ldapUrl ($currentLinkId), skipping: $error");
|
||||||
$skippingLink = 1;
|
$skippingLink = 1;
|
||||||
next;
|
next;
|
||||||
}
|
}
|
||||||
} elsif ($skippingLink) {
|
} elsif ($skippingLink) {
|
||||||
next;
|
next;
|
||||||
}
|
}
|
||||||
# $self->session->errorHandler->warn("DEBUG: SyncProfilesToLdap: Syncing profile for user $userId");
|
# $self->session->log->warn("DEBUG: SyncProfilesToLdap: Syncing profile for user $userId");
|
||||||
|
|
||||||
my $user = WebGUI::User->new($self->session, $userId);
|
my $user = WebGUI::User->new($self->session, $userId);
|
||||||
my $username = $user->username;
|
my $username = $user->username;
|
||||||
|
|
@ -163,16 +163,16 @@ sub execute {
|
||||||
filter => "&(objectClass=*)");
|
filter => "&(objectClass=*)");
|
||||||
|
|
||||||
if ($result->code && ! $result->code ~~ @noResultsCodes) {
|
if ($result->code && ! $result->code ~~ @noResultsCodes) {
|
||||||
$self->session->errorHandler->error("SyncProfilesToLdap: Couldn't search LDAP link $ldapUrl ($currentLinkId) to find user $username ($userId) with DN ".$userData->{connectDN}.": LDAP returned: ".$ldapStatusCode{$result->code});
|
$self->session->log->error("SyncProfilesToLdap: Couldn't search LDAP link $ldapUrl ($currentLinkId) to find user $username ($userId) with DN ".$userData->{connectDN}.": LDAP returned: ".$ldapStatusCode{$result->code});
|
||||||
} elsif ($result->code ~~ @noResultsCodes || $result->count == 0) {
|
} elsif ($result->code ~~ @noResultsCodes || $result->count == 0) {
|
||||||
$self->session->errorHandler->warn("SyncProfilesToLdap: No results returned by LDAP server for user with dn ".$userData->{connectDN});
|
$self->session->log->warn("SyncProfilesToLdap: No results returned by LDAP server for user with dn ".$userData->{connectDN});
|
||||||
} else {
|
} else {
|
||||||
my $entry = $result->entry(0);
|
my $entry = $result->entry(0);
|
||||||
|
|
||||||
foreach my $fieldName (@fieldNames) {
|
foreach my $fieldName (@fieldNames) {
|
||||||
my $value = $entry->get_value($self->_alias($fieldName));
|
my $value = $entry->get_value($self->_alias($fieldName));
|
||||||
next unless length $value;
|
next unless length $value;
|
||||||
# $self->session->errorHandler->warn("DEBUG: SyncProfilesToLdap: Got data for profile field '$fieldName'");
|
# $self->session->log->warn("DEBUG: SyncProfilesToLdap: Got data for profile field '$fieldName'");
|
||||||
$user->profileField($fieldName, $value);
|
$user->profileField($fieldName, $value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -180,7 +180,7 @@ sub execute {
|
||||||
$index++;
|
$index++;
|
||||||
|
|
||||||
if (time - $startTime >= $ttl) {
|
if (time - $startTime >= $ttl) {
|
||||||
# $self->session->errorHandler->warn("DEBUG: SyncProfilesToLdap: next round");
|
# $self->session->log->warn("DEBUG: SyncProfilesToLdap: next round");
|
||||||
$link->unbind if defined $link;
|
$link->unbind if defined $link;
|
||||||
$instance->setScratch('ldapSelectIndex', $index);
|
$instance->setScratch('ldapSelectIndex', $index);
|
||||||
$sth->finish;
|
$sth->finish;
|
||||||
|
|
@ -188,7 +188,7 @@ sub execute {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
# $self->session->errorHandler->warn("DEBUG: SyncProfilesToLdap: done");
|
# $self->session->log->warn("DEBUG: SyncProfilesToLdap: done");
|
||||||
$link->unbind if defined $link;
|
$link->unbind if defined $link;
|
||||||
$instance->deleteScratch('ldapSelectIndex');
|
$instance->deleteScratch('ldapSelectIndex');
|
||||||
return $self->COMPLETE;
|
return $self->COMPLETE;
|
||||||
|
|
|
||||||
|
|
@ -191,7 +191,7 @@ sub getAllInstances {
|
||||||
push(@instances, $instance);
|
push(@instances, $instance);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$session->errorHandler->warn('Tried to instance instanceId '.$instanceId.' but it returned undef');
|
$session->log->warn('Tried to instance instanceId '.$instanceId.' but it returned undef');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return \@instances;
|
return \@instances;
|
||||||
|
|
@ -361,7 +361,7 @@ sub run {
|
||||||
}
|
}
|
||||||
my $activity = $self->getNextActivity;
|
my $activity = $self->getNextActivity;
|
||||||
unless (defined $activity) {
|
unless (defined $activity) {
|
||||||
$session->errorHandler->error(
|
$session->log->error(
|
||||||
sprintf q{Unable to load Workflow Activity for activity after id %s in workflow %s},
|
sprintf q{Unable to load Workflow Activity for activity after id %s in workflow %s},
|
||||||
$self->get('currentActivityId'),
|
$self->get('currentActivityId'),
|
||||||
$workflow->getId
|
$workflow->getId
|
||||||
|
|
@ -369,7 +369,7 @@ sub run {
|
||||||
$self->set({lastStatus=>"error"}, 1);
|
$self->set({lastStatus=>"error"}, 1);
|
||||||
return "error";
|
return "error";
|
||||||
}
|
}
|
||||||
$session->errorHandler->info("Running workflow activity ".$activity->getId.", which is a ".(ref $activity).", for instance ".$self->getId.".");
|
$session->log->info("Running workflow activity ".$activity->getId.", which is a ".(ref $activity).", for instance ".$self->getId.".");
|
||||||
my $object = eval { $self->getObject };
|
my $object = eval { $self->getObject };
|
||||||
if ( my $e = WebGUI::Error::ObjectNotFound->caught ) {
|
if ( my $e = WebGUI::Error::ObjectNotFound->caught ) {
|
||||||
$session->log->warn(
|
$session->log->warn(
|
||||||
|
|
@ -379,7 +379,7 @@ sub run {
|
||||||
return "done";
|
return "done";
|
||||||
}
|
}
|
||||||
elsif ($@) {
|
elsif ($@) {
|
||||||
$session->errorHandler->error(
|
$session->log->error(
|
||||||
q{Error on workflow instance '} . $self->getId . q{': }. $@
|
q{Error on workflow instance '} . $self->getId . q{': }. $@
|
||||||
);
|
);
|
||||||
$self->set({lastStatus=>"error"}, 1);
|
$self->set({lastStatus=>"error"}, 1);
|
||||||
|
|
@ -388,7 +388,7 @@ sub run {
|
||||||
|
|
||||||
my $status = eval { $activity->execute($object, $self) };
|
my $status = eval { $activity->execute($object, $self) };
|
||||||
if ($@) {
|
if ($@) {
|
||||||
$session->errorHandler->error("Caught exception executing workflow activity ".$activity->getId." for instance ".$self->getId." which reported ".$@);
|
$session->log->error("Caught exception executing workflow activity ".$activity->getId." for instance ".$self->getId." which reported ".$@);
|
||||||
$self->set({lastStatus=>"error"}, 1);
|
$self->set({lastStatus=>"error"}, 1);
|
||||||
return "error";
|
return "error";
|
||||||
}
|
}
|
||||||
|
|
@ -639,7 +639,7 @@ When a workflow instance is started WebGUI tries to run it immediately to see if
|
||||||
|
|
||||||
sub start {
|
sub start {
|
||||||
my ($self, $skipRealtime) = @_;
|
my ($self, $skipRealtime) = @_;
|
||||||
my $log = $self->session->errorHandler;
|
my $log = $self->session->log;
|
||||||
$self->{_started} = 1;
|
$self->{_started} = 1;
|
||||||
|
|
||||||
# run the workflow in realtime to start.
|
# run the workflow in realtime to start.
|
||||||
|
|
|
||||||
|
|
@ -57,7 +57,7 @@ sub notify {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
my $module = shift;
|
my $module = shift;
|
||||||
my $params = shift;
|
my $params = shift;
|
||||||
my ($config, $error) = $self->session->quick("config", "errorHandler");
|
my ($config, $error) = $self->session->quick("config", "log");
|
||||||
my $remote = create_ikc_client(
|
my $remote = create_ikc_client(
|
||||||
port=>$config->get("spectrePort"),
|
port=>$config->get("spectrePort"),
|
||||||
ip=>$config->get("spectreIp"),
|
ip=>$config->get("spectreIp"),
|
||||||
|
|
|
||||||
|
|
@ -96,7 +96,7 @@ test_psgi $fatal_app, sub {
|
||||||
test_psgi $fatal_app, sub {
|
test_psgi $fatal_app, sub {
|
||||||
my $cb = shift;
|
my $cb = shift;
|
||||||
|
|
||||||
local *WebGUI::Session::ErrorHandler::canShowDebug = sub {1};
|
local *WebGUI::Session::Log::canShowDebug = sub {1};
|
||||||
my $res = $cb->( GET "/" );
|
my $res = $cb->( GET "/" );
|
||||||
is $res->code, 500, 'generic dead app, debug, status code';
|
is $res->code, 500, 'generic dead app, debug, status code';
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,7 @@ my $session = WebGUI::Test->session;
|
||||||
my $env = $session->request->env;
|
my $env = $session->request->env;
|
||||||
$env->{REMOTE_ADDR} = '192.168.0.6';
|
$env->{REMOTE_ADDR} = '192.168.0.6';
|
||||||
|
|
||||||
my $eh = $session->errorHandler;
|
my $eh = $session->log;
|
||||||
|
|
||||||
####################################################
|
####################################################
|
||||||
#
|
#
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue