fixed: loginBox macro can no longer return the user to the logout page, logging them out

This commit is contained in:
Doug Bell 2008-08-19 20:39:43 +00:00
parent 27a76cd9a3
commit 57b8cc4bae
11 changed files with 78 additions and 123 deletions

View file

@ -109,28 +109,21 @@ C<options> is a hash reference of options and is currently not used.
sub applyConstraints {
my $self = shift;
my $options = shift;
my $gallery = $self->getGallery;
# Update the asset's size and make a thumbnail
my $maxImageSize = $gallery->get("imageViewSize")
my $maxImageSize = $self->getGallery->get("imageViewSize")
|| $self->session->setting->get("maxImageSize");
my $thumbnailSize = $self->getGallery->get("imageThumbnailSize")
|| $self->session->setting->get("thumbnailSize");
my $parameters = $self->get("parameters");
my $storage = $self->getStorageLocation;
my $file = $self->get("filename");
# Make resolutions before fixing image, so that we can get higher quality
# resolutions
$self->makeResolutions;
# adjust density before size, so that the dimensions won't change
$storage->resize( $file, undef, undef, $gallery->get( 'imageDensity' ) );
$storage->adjustMaxImageSize($file, $maxImageSize);
$self->generateThumbnail;
$self->setSize;
$self->makeResolutions;
$self->updateExifDataFromFile;
$self->SUPER::applyConstraints( $options );
}
#-------------------------------------------------------------------
@ -368,7 +361,7 @@ sub makeResolutions {
}
my $newFilename = $res . ".jpg";
$storage->copyFile( $self->get("filename"), $newFilename );
$storage->resize( $newFilename, $res, undef, $self->getGallery->get( 'imageDensity' ) );
$storage->resize( $newFilename, $res );
}
}

View file

@ -77,17 +77,23 @@ sub process {
$var{'logout.label'} = $i18n->get(49);
# A hidden field with the current URL
my $returnUrl = $session->url->page;
if ( !$session->form->get("op") eq "auth" ) {
$returnUrl .= '?' . $session->env->get( "QUERY_STRING" );
}
$var{'form.returnUrl'}
= WebGUI::Form::hidden( $session, {
name => 'returnUrl',
value => $session->url->page($session->env->get("QUERY_STRING")),
});
# Fix box size
my $boxSize = $param[0];
$boxSize = 12 unless ($boxSize);
if (index(lc($session->env->get("HTTP_USER_AGENT")),"msie") < 0) {
$boxSize = int($boxSize=$boxSize*2/3);
}
my $action;
if ($session->setting->get("encryptLogin")) {
$action = $session->url->page(undef,1);