merging 6.7.8 changes and bug fixes

This commit is contained in:
JT Smith 2005-11-30 20:33:40 +00:00
parent 4bd429bcac
commit fdfb9bf5ae
8 changed files with 95 additions and 58 deletions

View file

@ -34,6 +34,37 @@
Assets that come with templates for the Dashboard:
StockData, WeatherData, SearchBox, SyndicatedContent
6.7.8
- fix [ 1364895 ] Error in ITransact Commerce Module
- fix [ 1365033 ] Commerce Templates not saving to settings
- fix [ 1358317 ] Upgrade from 6.6.0 to 6.7.x does not work
- fix [ 1339611 ] Sm Calendar: date links broke, unusable for >1 event per
day
- Fixed a problem with Random Asset Proxy
- Fixed a caching bug in the user system.
- Fixed a problem in the user system for negating macros on profile fields.
- Added a missing use statement in Storage
- Renamed the "Page" asset to "Page Layout" for clarity.
- fix [1329023] Doc for EventsCalendar
- fix [1336414] All default profile fields not protected
- fix [ 1343269 ] add Content Profiling field yesNo type i18n
- fix [ 1342623 ] -noDate flag in WebGUI::Form::Date not working
- fix [ 1345261 ] addFileFromFormPost always returns 1 file uploaded
- fix [ 1347584 ] Wobject "Product" copy fails
- fix [ 1340614 ] page: "what next?" both choices take you to new page
- fix [ 1350687 ] 6.7.7 editProfile doesn't work...
- fix [ 1350770 ] generateContent.pl fails
- fix [ 1352362 ] can't add version tag in Content Versioning
- fix [ 1352647 ] WebGUI::HTTP::setCookie does not accept 0 as time to live
- fix [ 1358547 ] Syntax Error in Default Edit Profile Template
- fix [ 1304479 ] CS Content Approval Request Email Link Issue
- fix [ 1358264 ] syncprofiletoldap bug
- fix [ 1324000 ] SyncProfilesToLDAP does not work
- Fixed a documentation error related to SQL Report placeholder parameters.
- fix [ 1328951 ] someone screwed up RandomAssetProxy.pm
- fix [ 1333572 ] testEnvironment - broken loop
- fix [ 1341004 ] ArchiveOldPosts isn't fully versioned
6.7.7
- added two new template variables to the EventsCalendar -

File diff suppressed because one or more lines are too long

View file

@ -760,7 +760,7 @@ sub setStatusApproved {
$self->commit;
$self->getThread->incrementReplies($self->get("dateUpdated"),$self->getId) if $self->isReply;
unless ($self->isPoster) {
WebGUI::MessageLog::addInternationalizedEntry($self->get("ownerUserId"),'',$self->getUrl,579);
WebGUI::MessageLog::addInternationalizedEntry($self->get("ownerUserId"),'',WebGUI::URL::getSiteUrl().'/'.$self->getUrl,579);
}
$self->notifySubscribers unless ($session{form}{func} eq 'add');
}
@ -793,7 +793,7 @@ Sets the status of this post to denied.
sub setStatusDenied {
my ($self) = @_;
$self->update({status=>'denied'});
WebGUI::MessageLog::addInternationalizedEntry($self->get("ownerUserId"),'',$self->getUrl,580);
WebGUI::MessageLog::addInternationalizedEntry($self->get("ownerUserId"),'',WebGUI::URL::getSiteUrl().'/'.$self->getUrl,580);
}
#-------------------------------------------------------------------
@ -811,7 +811,7 @@ sub setStatusPending {
} else {
$self->update({status=>'pending'});
WebGUI::MessageLog::addInternationalizedEntry('',$self->getThread->getParent->get("moderateGroupId"),
$self->getUrl("revision=".$self->get("revisionDate")),578,'WebGUI','pending');
WebGUI::URL::getSiteUrl().'/'.$self->getUrl("revision=".$self->get("revisionDate")),578,'WebGUI','pending');
}
}

View file

@ -18,6 +18,7 @@ package WebGUI::Cache::FileCache;
use Storable qw(nstore retrieve);
use WebGUI::Session;
use File::Path;
use File::Find;
our @ISA = qw(WebGUI::Cache);
@ -166,34 +167,33 @@ Returns the size (in bytes) of the current cache under this namespace. Consequen
=cut
#-------------------------------------------------------------------
=head2 getNamespaceSize ( )
Returns the size (in bytes) of the current cache under this namespace. Consequently it also cleans up expired cache items.
=cut
sub getNamespaceSize {
my $self = shift;
my $expiresModifier = shift || 0;
my $path = shift || $self->getNamespaceRoot;
my $filesRemaining = 0;
if (opendir(DIR,$path)) {
my @files = readdir(DIR);
foreach my $file (@files) {
unless ($file eq "." || $file eq "..") {
if (open(FILE,"<".$path."/expires")) {
$session{cacheSize} = 0;
File::Find::find({no_chdir=>1, wanted=> sub {
return unless $File::Find::name =~ m/^(.*)expires$/;
my $dir = $1;
if (open(FILE,"<".$dir."/expires")) {
my $expires = <FILE>;
close(FILE);
if ($expires < time()+$expiresModifier) {
if (-e $path) {
rmtree($path);
}
rmtree($dir);
} else {
my (@attributes) = stat($path.'/'.$file);
$filesRemaining += $attributes[7];
}
} else {
$filesRemaining += $self->getNamespaceSize($expiresModifier,$path."/".$file);
$session{cacheSize} += -s $dir.'cache';
}
}
}
closedir(DIR);
}
return $filesRemaining;
}, $self->getNamespaceRoot);
return $session{cacheSize};
}
#-------------------------------------------------------------------

View file

@ -13,6 +13,7 @@ package Hourly::ArchiveOldPosts;
use strict;
use WebGUI::Asset::Post;
use WebGUI::Asset::Wobject::Collaboration;
use WebGUI::DateTime;
use WebGUI::Session;
use WebGUI::SQL;
@ -20,15 +21,18 @@ use WebGUI::SQL;
#-----------------------------------------
sub process {
my $epoch = WebGUI::DateTime::time();
my $a = WebGUI::SQL->read("select asset.lineage,Collaboration.archiveAfter from Collaboration left join asset on Collaboration.assetId=asset.assetId");
while (my ($lineage, $archiveAfter) = $a->array) {
my $archiveDate = $epoch - $archiveAfter;
my $sql = "select asset.assetId,asset.className, max(assetData.revisionDate) from Post left join asset on Post.assetId=asset.assetId
left join assetData on Post.assetId=assetData.assetId and assetData.revisionDate=Post.revisionDate
where Post.dateUpdated<$archiveDate and assetData.status='approved' and asset.lineage like ".quote($lineage."%")." group by asset.assetId";
my $a = WebGUI::SQL->read("select assetId from asset where className='WebGUI::Asset::Wobject::Collaboration'");
while (my ($assetId) = $a->array) {
my $cs = WebGUI::Asset::Wobject::Collaboration->new($assetId);
my $archiveDate = $epoch - $cs->get("archiveAfter");
my $sql = "select asset.assetId, assetData.revisionDate from Post left join asset on asset.assetId=Post.assetId
left join assetData on Post.assetId=assetData.assetId and Post.revisionDate=assetData.revisionDate
where Post.dateUpdated<$archiveDate and assetData.status='approved' and asset.state='published'
and asset.lineage like ".quote($cs->get("lineage").'%');
my $b = WebGUI::SQL->read($sql);
while (my ($id, $class, $version) = $b->array) {
WebGUI::Asset::Post->new($id,$class,$version)->setStatusArchived;
while (my ($id, $version) = $b->array) {
my $post = WebGUI::Asset::Post->new($id,undef,$version);
$post->setStatusArchived if (defined $post && $post->get("dateUpdated") < $archiveDate);
}
$b->finish;
}

View file

@ -15,10 +15,14 @@ use strict;
use WebGUI::Asset;
use WebGUI::Session;
use WebGUI::SQL;
use WebGUI::DateTime;
#-----------------------------------------
sub process {
if ($session{config}{DeleteExpiredRevisions_offset} ne "") {
my $hour = WebGUI::DateTime::epochToHuman(time(),"%H");
my $dow = WebGUI::DateTime::epochToHuman(time(),"%W");
return unless ($hour == 3 && $dow eq "Sun");
my $expireDate = (time()-(86400*$session{config}{DeleteExpiredRevisions_offset}));
my $sth = WebGUI::SQL->read("select assetData.assetId,asset.className,assetData.revisionDate from asset left join assetData on asset.assetId=assetData.assetId where assetData.revisionDate<".$expireDate." order by assetData.revisionDate asc");
while (my ($id, $class, $version) = $sth->array) {

View file

@ -1,22 +1,24 @@
package Hourly::SyncProfilesToLDAP;
#-------------------------------------------------------------------
#------------------------------------------------------ -------------
# WebGUI is Copyright 2001-2005 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
#-------------------------------------------------------------------
#------------------------------------------------------ -------------
use Net::LDAP;
use strict;
use WebGUI::DateTime;
use WebGUI::Session;
use WebGUI::SQL;
use WebGUI::Auth;
use WebGUI::User;
#-------------------------------------------------------------------
#------------------------------------------------------ -------------
sub _alias {
my %alias = (
firstName=>"givenname",
@ -27,7 +29,7 @@ sub _alias {
return $alias{$_[0]} || $_[0];
}
#-------------------------------------------------------------------
#------------------------------------------------------ -------------
sub process {
my (@date, $userId, $u, $userData, $uri, $port, %args, $fieldName, $ldap, $search, $a, $b);
@date = WebGUI::DateTime::localtime(WebGUI::DateTime::time());
@ -35,7 +37,8 @@ sub process {
$a = WebGUI::SQL->read("select userId from users where authMethod='LDAP'");
while (($userId) = $a->array) {
$u = WebGUI::User->new($userId);
$userData = WebGUI::Authentication::getParams($userId, 'LDAP');
my $auth = WebGUI::Auth->new("LDAP",$userId);
$userData = $auth->getParams;
$uri = URI->new($userData->{ldapUrl});
if ($uri->port < 1) {
$port = 389;
@ -48,15 +51,11 @@ sub process {
$ldap->bind;
$search = $ldap->search (base => $uri->dn, filter => $userData->{connectDN});
if (defined $search->entry(0)) {
my $user = WebGUI::User->new($userId);
$b = WebGUI::SQL->read("select fieldName from userProfileField where profileCategoryId<>4");
while (($fieldName) = $b->array) {
if ($search->entry(0)->get_value(_alias($fieldName)) ne "") {
WebGUI::SQL->write("replace into userProfileData
(userId,fieldName,fieldData) values ("
.$userId.","
.quote($fieldName).","
.quote($search->entry(0)->get_value(_alias($fieldName)))
.")");
$user->profileField($fieldName,$search->entry(0)->get_value(_alias($fieldName)));
}
}
$b->finish;
@ -71,4 +70,3 @@ sub process {
}
1;

View file

@ -159,7 +159,9 @@ sub checkModule {
unless (defined $afterinstall) { $afterinstall = 0; }
printTest("Checking for module $module");
my $statement = "require ".$module.";";
if (eval($statement)) {
if ($afterinstall == 1) {
failAndExit("Install of $module failed!");
} elsif (eval($statement)) {
$statement = '$'.$module."::VERSION";
my $currentVersion = eval($statement);
if ($currentVersion >= $version) {
@ -179,8 +181,6 @@ sub checkModule {
failAndExit("Aborting test, not all modules available, and you're not root so I can't install them.");
}
}
} elsif ($afterinstall == 1) {
failAndExit("Install of $module failed!");
} else {
printResult("Not Installed");
return if $skipInstall;