fixing some typos. also the File/Storage bug. also fixing the changelogs.
This commit is contained in:
parent
21188e7949
commit
e4bf3c60b0
6 changed files with 24 additions and 27 deletions
|
|
@ -1,8 +1,6 @@
|
||||||
6.9.0
|
6.9.0
|
||||||
- Converted WebGUI to use a new object oriented session system. More details
|
- Converted WebGUI to use a new object oriented session system. More details
|
||||||
in migation.txt.
|
in migation.txt.
|
||||||
- fix [ 1379384 ] image uploads to non-public pages
|
|
||||||
- fixed a problem with SynchFileToLDAP hourly script.
|
|
||||||
|
|
||||||
|
|
||||||
6.8.4
|
6.8.4
|
||||||
|
|
@ -10,7 +8,7 @@
|
||||||
ilance.nl)
|
ilance.nl)
|
||||||
- fix [ 1379915 ] Survey can only be completed once per user
|
- fix [ 1379915 ] Survey can only be completed once per user
|
||||||
- Fixed broken UI Level examples in the config file.
|
- Fixed broken UI Level examples in the config file.
|
||||||
- fixed a bug in SyncProfilesToLDAP
|
- fixed a bug in SyncProfilesToLDAP script
|
||||||
- fix [ 1387242 ] uploadsHandler fails
|
- fix [ 1387242 ] uploadsHandler fails
|
||||||
- fix [ 1389086 ] 6.8.3 RichEdit buttons disappear
|
- fix [ 1389086 ] 6.8.3 RichEdit buttons disappear
|
||||||
- fix [ 1379915 ] Survey can only be completed once per user
|
- fix [ 1379915 ] Survey can only be completed once per user
|
||||||
|
|
@ -20,6 +18,7 @@
|
||||||
- fix [ 1387505 ] Hover help not working on Matrix
|
- fix [ 1387505 ] Hover help not working on Matrix
|
||||||
- fix [ 1393867 ] Data Form Not Emailing
|
- fix [ 1393867 ] Data Form Not Emailing
|
||||||
- fix [ 1392643 ] 2006 Calendar dates are not correct?
|
- fix [ 1392643 ] 2006 Calendar dates are not correct?
|
||||||
|
- fix [ 1384794 ] editSave on an existing File or Image asset loses storageId.
|
||||||
- Removed the If macro, since it was scheduled for removal in 6.8.0.
|
- Removed the If macro, since it was scheduled for removal in 6.8.0.
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -67,8 +67,8 @@ sub contentHandler {
|
||||||
### Open new or existing user session based on user-agent's cookie.
|
### Open new or existing user session based on user-agent's cookie.
|
||||||
my $session = WebGUI::Session->open($s->dir_config('WebguiRoot'),$r->dir_config('WebguiConfig'),$r, $s);
|
my $session = WebGUI::Session->open($s->dir_config('WebguiRoot'),$r->dir_config('WebguiConfig'),$r, $s);
|
||||||
### form variables
|
### form variables
|
||||||
foreach ($session{req}->param) {
|
foreach ($session->{_request}->param) {
|
||||||
$session{form}{$_} = $session{req}->body($_) || $session{req}->param($_);
|
$session{form}{$_} = $session->{_request}->body($_) || $session->{_request}->param($_);
|
||||||
}
|
}
|
||||||
if ($session->env->get("HTTP_X_MOZ") eq "prefetch") { # browser prefetch is a bad thing
|
if ($session->env->get("HTTP_X_MOZ") eq "prefetch") { # browser prefetch is a bad thing
|
||||||
$session->http->setStatus("403","We don't allow prefetch, because it increases bandwidth, hurts stats, and can break web sites.");
|
$session->http->setStatus("403","We don't allow prefetch, because it increases bandwidth, hurts stats, and can break web sites.");
|
||||||
|
|
@ -114,8 +114,8 @@ sub page {
|
||||||
$method = "view";
|
$method = "view";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$output = tryAssetMethod($asset,$method);
|
$output = tryAssetMethod($session,$asset,$method);
|
||||||
$output = tryAssetMethod($asset,"view") unless ($method eq "view" || $output);
|
$output = tryAssetMethod($session,$asset,"view") unless ($method eq "view" || $output);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ($output eq "") {
|
if ($output eq "") {
|
||||||
|
|
@ -167,14 +167,15 @@ sub setup {
|
||||||
|
|
||||||
#-------------------------------------------------------------------
|
#-------------------------------------------------------------------
|
||||||
sub tryAssetMethod {
|
sub tryAssetMethod {
|
||||||
|
my $session = shift;
|
||||||
my $asset = shift;
|
my $asset = shift;
|
||||||
my $method = shift;
|
my $method = shift;
|
||||||
$session{asset} = $asset;
|
$session{asset} = $asset;
|
||||||
my $methodToTry = "www_".$method;
|
my $methodToTry = "www_".$method;
|
||||||
my $output = eval{$asset->$methodToTry()};
|
my $output = eval{$asset->$methodToTry()};
|
||||||
if ($@) {
|
if ($@) {
|
||||||
WebGUI::ErrorHandler::warn("Couldn't call method ".$method." on asset for url: ".$session{requestedUrl}." Root cause: ".$@);
|
$session->errorHandler->warn("Couldn't call method ".$method." on asset for url: ".$session{requestedUrl}." Root cause: ".$@);
|
||||||
$output = tryAssetMethod($asset,'view') if ($method ne "view");
|
$output = tryAssetMethod($session,$asset,'view') if ($method ne "view");
|
||||||
}
|
}
|
||||||
return $output;
|
return $output;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -198,13 +198,13 @@ sub processPropertiesFromFormPost {
|
||||||
delete $self->{_storageLocation};
|
delete $self->{_storageLocation};
|
||||||
my $storage = $self->getStorageLocation;
|
my $storage = $self->getStorageLocation;
|
||||||
my $filename = $storage->addFileFromFormPost("file",1);
|
my $filename = $storage->addFileFromFormPost("file",1);
|
||||||
if (defined $filename) {
|
if (defined $filename && $filename ne $self->get("filename")) {
|
||||||
my %data;
|
my %data;
|
||||||
$data{filename} = $filename;
|
$data{filename} = $filename;
|
||||||
$data{storageId} = $storage->getId;
|
$data{storageId} = $storage->getId;
|
||||||
$data{title} = $filename unless ($self->session->form->process("title"));
|
$data{title} = $filename unless ($session{form}{title});
|
||||||
$data{menuTitle} = $filename unless ($self->session->form->process("menuTitle"));
|
$data{menuTitle} = $filename unless ($session{form}{menuTitle});
|
||||||
$data{url} = $self->getParent->get('url').'/'.$filename unless ($self->session->form->process("url"));
|
$data{url} = $self->getParent->get('url').'/'.$filename unless ($session{form}{url});
|
||||||
$self->update(\%data);
|
$self->update(\%data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,6 @@ use DBI;
|
||||||
use Exporter;
|
use Exporter;
|
||||||
use strict;
|
use strict;
|
||||||
use Tie::IxHash;
|
use Tie::IxHash;
|
||||||
use WebGUI::ErrorHandler;
|
|
||||||
use WebGUI::Id;
|
use WebGUI::Id;
|
||||||
use WebGUI::Session;
|
use WebGUI::Session;
|
||||||
use WebGUI::Utility;
|
use WebGUI::Utility;
|
||||||
|
|
@ -301,7 +300,8 @@ Returns an error code for the current handler.
|
||||||
=cut
|
=cut
|
||||||
|
|
||||||
sub errorCode {
|
sub errorCode {
|
||||||
return $self->dbh->err;
|
my $self = shift;
|
||||||
|
return $self->dbh->err;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -314,7 +314,8 @@ Returns a text error message for the current handler.
|
||||||
=cut
|
=cut
|
||||||
|
|
||||||
sub errorMessage {
|
sub errorMessage {
|
||||||
return $self->dbh->errstr;
|
my $self = shift;
|
||||||
|
return $self->dbh->errstr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -644,7 +645,7 @@ sub setRow {
|
||||||
my ($self, $table, $keyColumn, $data, $id) = @_;
|
my ($self, $table, $keyColumn, $data, $id) = @_;
|
||||||
if ($data->{$keyColumn} eq "new" || $id) {
|
if ($data->{$keyColumn} eq "new" || $id) {
|
||||||
$data->{$keyColumn} = $id || WebGUI::Id::generate();
|
$data->{$keyColumn} = $id || WebGUI::Id::generate();
|
||||||
$self->write("insert into $table ($keyColumn) values (".$self->quote($data->{$keyColumn}).")", $dbh);
|
$self->write("insert into $table ($keyColumn) values (".$self->quote($data->{$keyColumn}).")");
|
||||||
}
|
}
|
||||||
my (@pairs);
|
my (@pairs);
|
||||||
foreach my $key (keys %{$data}) {
|
foreach my $key (keys %{$data}) {
|
||||||
|
|
@ -653,7 +654,7 @@ sub setRow {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ($pairs[0] ne "") {
|
if ($pairs[0] ne "") {
|
||||||
$self->write("update $table set ".join(", ", @pairs)." where ".$keyColumn."=".$self->quote($data->{$keyColumn}), $dbh);
|
$self->write("update $table set ".join(", ", @pairs)." where ".$keyColumn."=".$self->quote($data->{$keyColumn}));
|
||||||
}
|
}
|
||||||
return $data->{$keyColumn};
|
return $data->{$keyColumn};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -39,7 +39,7 @@ Package WebGUI::Session
|
||||||
|
|
||||||
=head1 DESCRIPTION
|
=head1 DESCRIPTION
|
||||||
|
|
||||||
This package is the heart and lifeblood of WebGUI; it is the glue that holds WebGUI together. When you create a session object, you'll immidiately have access to all sorts of other objects. By passing the session object around in code you'll have access to the default database connection, error handler, user and more without having to create it each time. The lends much speed to WebGUI.
|
This package is the heart and lifeblood of WebGUI; it is the glue that holds WebGUI together. When you create a session object, you'll immediately have access to all sorts of other objects. By passing the session object around in code you'll have access to the default database connection, error handler, user and more without having to create it each time. The lends much speed to WebGUI.
|
||||||
|
|
||||||
B<NOTE:> It is important to distinguish the difference between a WebGUI session and a user session. A user session is just part of a WebGUI session. A WebGUI session is all of the basic data the WebGUI needs to operate.
|
B<NOTE:> It is important to distinguish the difference between a WebGUI session and a user session. A user session is just part of a WebGUI session. A WebGUI session is all of the basic data the WebGUI needs to operate.
|
||||||
|
|
||||||
|
|
@ -204,7 +204,7 @@ sub errorHandler {
|
||||||
unless (exists $self->{_errorHandler}) {
|
unless (exists $self->{_errorHandler}) {
|
||||||
$self->{_errorHandler} = WebGUI::Session::ErrorHandler->new($self);
|
$self->{_errorHandler} = WebGUI::Session::ErrorHandler->new($self);
|
||||||
}
|
}
|
||||||
return $self-{_errorHandler};
|
return $self->{_errorHandler};
|
||||||
}
|
}
|
||||||
|
|
||||||
#-------------------------------------------------------------------
|
#-------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
|
@ -203,14 +203,9 @@ sub addFileFromFormPost {
|
||||||
my $attachmentCount = 1;
|
my $attachmentCount = 1;
|
||||||
foreach my $upload ($session{req}->upload($formVariableName)) {
|
foreach my $upload ($session{req}->upload($formVariableName)) {
|
||||||
return $filename if $attachmentCount > $attachmentLimit;
|
return $filename if $attachmentCount > $attachmentLimit;
|
||||||
my $tempPath = $upload->tempname();
|
|
||||||
$filename = $upload->filename();
|
$filename = $upload->filename();
|
||||||
next unless $filename;
|
next unless $filename;
|
||||||
if ($tempPath =~ /([^\/\\]+)$/) {
|
if ($filename =~ /([^\/\\]+)$/) { $filename = $1; }
|
||||||
$filename = $1;
|
|
||||||
} else {
|
|
||||||
$filename = $tempPath;
|
|
||||||
}
|
|
||||||
my $type = $self->getFileExtension($filename);
|
my $type = $self->getFileExtension($filename);
|
||||||
if (isIn($type, qw(pl perl sh cgi php asp))) { # make us safe from malicious uploads
|
if (isIn($type, qw(pl perl sh cgi php asp))) { # make us safe from malicious uploads
|
||||||
$filename =~ s/\./\_/g;
|
$filename =~ s/\./\_/g;
|
||||||
|
|
@ -233,7 +228,8 @@ sub addFileFromFormPost {
|
||||||
return undef;
|
return undef;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return $filename;
|
return $filename if $filename;
|
||||||
|
return undef;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue