Merge commit 'bfe9780ce0' into WebGUI8. Merged up to 7.10.3

This commit is contained in:
Colin Kuskie 2010-11-02 14:49:33 -07:00
commit a90eadda7c
37 changed files with 537 additions and 92 deletions

View file

@ -1,3 +1,22 @@
7.10.3
- fixed #11903: Unnecessary debug in Thingy
- fixed #11908: Inbox messages linger after deleting a user
- fixed #11909: Wrong message count in the inbox
- fixed #11773: Form injection in the EMS event ordering code.
- fixed #11773: SQL injection vulnerability in Edit Thing form processing code.
- fixed #11906: Carousel slide height problems
- fixed #11900: Request Approval for Version Tag Workflow activity can't select --Continue with this workflow
- fixed #11898: String eval used in Image::Graph
- fixed #11913: Editing the survey doesn't work
- fixed #11915: Date macro returns hour value w/ leading space
- fixed #11901: NotifyAboutVersionTag includes URL, even when inappropriate
- fixed #11902: forums bug
- fixed #11912: Corrupt cookie causes server 500 errors
- fixed #11919: Survey rendering with section text
- fixed #11916: Collaboration System security
- fixed #11918: Make password recovery email templatable
- fixed #11905: CrystalX nav breaks with 3rd level assets
7.10.2
- fixed #11884: Editing Templates impossible / Code editor not loaded
- recommitted ukplayer. Removal broke Matrix. Licencing information was available but overlooked.

View file

@ -7,7 +7,8 @@ The following people/companies are responsible for WebGUI:
WebGUI Core..........................JT Smith / Plain Black
Contributing Developers..............Meg O'Keefe Andrea / Plain Black
Contributing Developers..............C.J. Adams-Collier / <cjac@colliertech.org>
Meg O'Keefe Andrea / Plain Black
Lucas Bartholemy
Peter Beardsley / Appropriate Solutions
Doug Bell / Plain Black

View file

@ -21,6 +21,14 @@ save you many hours of grief.
Account Macro template
Admin Toggle Macro template
7.10.3
--------------------------------------------------------------------
* In the Collaboration System, previously the Group to Post group
was also allowed to view the CS. This made it difficult to
make the CS not viewable to regular users, so the behavior was
removed in 7.10.3. If your site depended on the Group To Post being
able to view the CS, then make the it a sub-group of Group To View.
7.10.2
--------------------------------------------------------------------
* The URL used by Display Message on Login always returns the user to

View file

@ -1,6 +1,7 @@
This is a running list of template changes made during upgrades. If you have copied the default
templates, you will need to apply these changes manually to your copies.
7.8.0
* Account Macro template variables renamed:
@ -11,6 +12,21 @@ templates, you will need to apply these changes manually to your copies.
toggle.url => toggle_url
toggle.text => toggle_text
7.10.3
* Carousel Default Template - root/import/carousel/carousel-default
Add a height parameter to the template.
* survey.css
Removed relative positioning and offset from top.
* root/import/survey/surveyedit.css
Reexported the package from the default content due to potential issues with earlier upgrades
not installing correctly.
* root/import/workflow-activity-templates
Added a folder to hold the assorted Workflow Activity templates.
7.10.2
* The Make Page Printable template has changed (as per bug #11857). The HTML

Binary file not shown.

Binary file not shown.

View file

@ -22,6 +22,7 @@ use Getopt::Long;
use WebGUI::Session;
use WebGUI::Storage;
use WebGUI::Asset;
use WebGUI::Inbox;
my $toVersion = '7.10.2';

View file

@ -0,0 +1,172 @@
#!/usr/bin/env perl
#-------------------------------------------------------------------
# WebGUI is Copyright 2001-2009 Plain Black Corporation.
#-------------------------------------------------------------------
# Please read the legal notices (docs/legal.txt) and the license
# (docs/license.txt) that came with this distribution before using
# this software.
#-------------------------------------------------------------------
# http://www.plainblack.com info@plainblack.com
#-------------------------------------------------------------------
our ($webguiRoot);
BEGIN {
$webguiRoot = "../..";
unshift (@INC, $webguiRoot."/lib");
}
use strict;
use Getopt::Long;
use WebGUI::Session;
use WebGUI::Storage;
use WebGUI::Asset;
my $toVersion = '7.10.3';
my $quiet; # this line required
my $session = start(); # this line required
# upgrade functions go here
pruneInboxMessagesFromDeletedUsers($session);
addTemplateToNotifyAboutVersionTag($session);
addPasswordRecoveryEmailTemplate($session);
finish($session); # this line required
#----------------------------------------------------------------------------
# Describe what our function does
sub pruneInboxMessagesFromDeletedUsers {
my $session = shift;
print "\tPruning inbox messages from deleted users. This may take a while... " unless $quiet;
my $sth = $session->db->prepare(<<EOSQL);
select messageId, inbox.userId
from inbox_messageState
join inbox using (messageId)
left outer join users on inbox.userId=users.userId
where users.userId IS NULL
EOSQL
$sth->execute([]);
use WebGUI::Inbox;
my $inbox = WebGUI::Inbox->new($session);
while (my ($messageId, $userId) = $sth->array) {
my $message = $inbox->getMessage($messageId, $userId);
if ($message) {
$message->delete;
}
}
print "...DONE!\n" unless $quiet;
}
#----------------------------------------------------------------------------
# Describe what our function does
sub addTemplateToNotifyAboutVersionTag {
my $session = shift;
print "\tAdd template to Notify About Version Tag workflow activities." unless $quiet;
use WebGUI::Workflow::Activity;
use WebGUI::Workflow::Activity::NotifyAboutVersionTag;
my $templateId = WebGUI::Workflow::Activity::NotifyAboutVersionTag->definition($session)->[0]->{properties}->{templateId}->{defaultValue};
my $activityList = $session->db->read(q|select activityId from WorkflowActivity|);
while (my ($activityId) = $activityList->array) {
my $activity = WebGUI::Workflow::Activity->new($session, $activityId);
next unless $activity;
next unless $activity->isa('WebGUI::Workflow::Activity::NotifyAboutVersionTag')
|| $activity->isa('WebGUI::Workflow::Activity::RequestApprovalForVersionTag')
;
$activity->set('templateId', $templateId);
}
print "...DONE!\n" unless $quiet;
}
#----------------------------------------------------------------------------
# Describe what our function does
sub addPasswordRecoveryEmailTemplate {
my $session = shift;
print "\tAdd a template for the password recovery email." unless $quiet;
$session->setting->add('webguiPasswordRecoveryEmailTemplate', 'sK_0zVw4kwdJ1sqREIsSzA');
print "...DONE!\n" unless $quiet;
}
# -------------- DO NOT EDIT BELOW THIS LINE --------------------------------
#----------------------------------------------------------------------------
# Add a package to the import node
sub addPackage {
my $session = shift;
my $file = shift;
print "\tUpgrading package $file\n" unless $quiet;
# Make a storage location for the package
my $storage = WebGUI::Storage->createTemp( $session );
$storage->addFileFromFilesystem( $file );
# Import the package into the import node
my $package = eval {
my $node = WebGUI::Asset->getImportNode($session);
$node->importPackage( $storage, {
overwriteLatest => 1,
clearPackageFlag => 1,
setDefaultTemplate => 1,
} );
};
if ($package eq 'corrupt') {
die "Corrupt package found in $file. Stopping upgrade.\n";
}
if ($@ || !defined $package) {
die "Error during package import on $file: $@\nStopping upgrade\n.";
}
return;
}
#-------------------------------------------------
sub start {
my $configFile;
$|=1; #disable output buffering
GetOptions(
'configFile=s'=>\$configFile,
'quiet'=>\$quiet
);
my $session = WebGUI::Session->open($webguiRoot,$configFile);
$session->user({userId=>3});
my $versionTag = WebGUI::VersionTag->getWorking($session);
$versionTag->set({name=>"Upgrade to ".$toVersion});
return $session;
}
#-------------------------------------------------
sub finish {
my $session = shift;
updateTemplates($session);
my $versionTag = WebGUI::VersionTag->getWorking($session);
$versionTag->commit;
$session->db->write("insert into webguiVersion values (".$session->db->quote($toVersion).",'upgrade',".time().")");
$session->close();
}
#-------------------------------------------------
sub updateTemplates {
my $session = shift;
return undef unless (-d "packages-".$toVersion);
print "\tUpdating packages.\n" unless ($quiet);
opendir(DIR,"packages-".$toVersion);
my @files = readdir(DIR);
closedir(DIR);
my $newFolder = undef;
foreach my $file (@files) {
next unless ($file =~ /\.wgpkg$/);
# Fix the filename to include a path
$file = "packages-" . $toVersion . "/" . $file;
addPackage( $session, $file );
}
}
#vim:ft=perl