diff --git a/docs/changelog/6.x.x.txt b/docs/changelog/6.x.x.txt index 87d78f75d..5ce197f15 100644 --- a/docs/changelog/6.x.x.txt +++ b/docs/changelog/6.x.x.txt @@ -77,8 +77,9 @@ webgui. to allow templates to be hidden from forms and/or management. - Added dTree menu to the navigation system (Thanks to Geir Landro, http://www.destroydrop.com) - - Added Cool Menus to the navigation system. (Thanks to Thomas Bratili, + - Added Cool Menus to the navigation system. (Thanks to Thomas Brattli, http://www.dhtmlcentral.com) + - Added a config file option for per-site International message caching. diff --git a/docs/credits.txt b/docs/credits.txt index 7c6540d6e..c6a57ddbd 100644 --- a/docs/credits.txt +++ b/docs/credits.txt @@ -82,8 +82,6 @@ Convert::ASN1........................Graham Barr Data::Config.........................Sébastien Aperghis-Tramoni -HTML::CalendarMonthSimple............Gregor Mosheh - HTML::TagFilter......................William Ross HTML::Template.......................Sam Tregar diff --git a/docs/gotcha.txt b/docs/gotcha.txt index 1fbced943..e4cb5a15b 100644 --- a/docs/gotcha.txt +++ b/docs/gotcha.txt @@ -26,6 +26,7 @@ save you many hours of grief. * WebGUI now requires the following Perl modules to be installed: Data::Serializer SOAP::Lite + Cache::Cache (no longer optional) WARNING: Be sure you install these modules BEFORE you attempt to upgrade or the upgrade will fail and you'll have a mess to @@ -36,6 +37,7 @@ save you many hours of grief. calendars. Your old templates will remain intact, however, so that you can migrate them manually to the new template variables. + 5.5.0 diff --git a/docs/install.txt b/docs/install.txt index fc6f8d668..8fd2662eb 100644 --- a/docs/install.txt +++ b/docs/install.txt @@ -26,7 +26,7 @@ QnD INSTALL INSTRUCTIONS: SOAP::Lite Data::Serializer Image::Magick (optional) - Cache::Cache (optional) + Cache::Cache 3. Install Apache (preferably with mod_perl) and set up your config. diff --git a/docs/upgrades/upgrade_5.9.9-6.0.0.pl b/docs/upgrades/upgrade_5.9.9-6.0.0.pl index f14bb79fd..2d75f7060 100644 --- a/docs/upgrades/upgrade_5.9.9-6.0.0.pl +++ b/docs/upgrades/upgrade_5.9.9-6.0.0.pl @@ -500,6 +500,7 @@ push(@newWobjects,"WSClient"); $conf->set("wobjects"=>\@newWobjects); $conf->set("emailRecoveryLoggingEnabled"=>1); $conf->set("passwordChangeLoggingEnabled"=>1); +$conf->set("useSharedInternationalCache"=>1); $conf->write; diff --git a/docs/upgrades/upgrade_5.9.9-6.0.0.sql b/docs/upgrades/upgrade_5.9.9-6.0.0.sql index 8fac24521..27ffa118d 100644 --- a/docs/upgrades/upgrade_5.9.9-6.0.0.sql +++ b/docs/upgrades/upgrade_5.9.9-6.0.0.sql @@ -167,8 +167,8 @@ insert into international (internationalId,languageId,namespace,message,lastUpda delete from international where languageId=1 and namespace='USS' and internationalId=71; insert into international (internationalId,languageId,namespace,message,lastUpdated,context) values (71,1,'USS','User Submission Systems (USS) are a great way to add a sense of community to any site as well as get free content from your users. The User Submission System name is misleading to some people, because they immediately think of users as visitors. However, users are also staff, or business partners, or even yourself. With the USS you can select who can add new content, and even who can moderate that content.\r\n

\r\nUser Submission systems are so versatile that they allow you to create all kinds of applications, just by editing a few templates. Example applications are Photo Galleries, FAQs, Link Lists, Guest Books, Classifieds, and more.\r\n\r\n\r\n

\r\nSubmission Template
\r\nChoose a layout for the individual submissions.\r\n

\r\n\r\nSubmission Form Template
\r\nChoose a layout of the form users see when submitting content.\r\n

\r\n\r\n\r\nSubmissions Per Page
\r\nHow many submissions should be listed per page in the submissions index?\r\n

\r\n\r\n\r\nFilter Content
\r\nSelect the level of content filtering you wish to perform on all submitted content.\r\n

\r\n\r\nSort By
\r\nThe field to sort the submission list by.\r\n

\r\n\r\nSort Order
\r\nThe direction to sort the submission list by.\r\n

\r\n\r\n\r\n\r\n\r\nWho can approve?
\r\nWhat group is allowed to approve and deny content?\r\n

\r\n\r\nWho can contribute?
\r\nWhat group is allowed to contribute content?\r\n

\r\n\r\n\r\nDefault Status
\r\nShould submissions be set to Approved, Pending, or Denied by default?\r\n

\r\nNote: If you set the default status to Pending, then be prepared to monitor your message log for new submissions.\r\n

\r\n\r\nKarma Per Submission
\r\nHow much karma should be given to a user when they contribute to this user submission system?\r\n

\r\n\r\n\r\nAllow discussion?
\r\nChecking this box will enable responses to your article much like Articles on Slashdot.org.\r\n

\r\n\r\n\r\n', 1070199700,NULL); -INSERT INTO template VALUES (1,'Default Login Box','

\n\n \n
\n \n

\n \n
\n \n \n \n

\n
\n\n \n \">.\n \n \n \n \n
\n
\n','Macro/L_loginBox'); -INSERT INTO template VALUES (2,'Horizontal Login Box','
\n\n \n \n \n \n \n \n \n \n \n \n \n \n
\n \n \n\n \n \">.\n
\n \n \n
\n \n
\n
\n','Macro/L_loginBox'); +INSERT INTO template VALUES (1,'Default Login Box','
\n\n \n
\n \n

\n \n
\n \n \n \n

\">

\n
\n\n \n \">.\n \n \n \n \n
\n
\n','Macro/L_loginBox'); +INSERT INTO template VALUES (2,'Horizontal Login Box','
\n\n \n \n \n \n \n \n \n \n \n \n \n \n
\n \">\n \n\n \n \">.\n
\n \n \n
\n \n
\n
\n','Macro/L_loginBox'); delete from international where internationalId=34 and namespace='WebGUI'; delete from international where internationalId=19 and namespace='SQLReport'; delete from international where internationalId=21 and namespace='SQLReport'; @@ -525,6 +525,6 @@ INSERT INTO template VALUES (2,'Events List','\r\n

INSERT INTO template VALUES (3,'Calendar Month (Small)','\r\n

\r\n
\r\n\r\n\r\n

\r\n\r\n\r\n\r\n \">\r\n

\r\n\r\n\r\n\n\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n

 
HeaderData\" width=\"28\" valign=\"top\" align=\"left\">

\n \n \">\n \n \n \n

 
\n
\n\n\n\n

\n · · \n
\n
\n','EventsCalendar'); INSERT INTO template VALUES (1,'Calendar Month (Big)','\r\n

\r\n
\r\n\r\n\r\n

\r\n\r\n\r\n\r\n \">\r\n

\r\n\r\n\r\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n

 
HeaderData\" width=\"14%\" valign=\"top\" align=\"left\">

\n \n \n ·\">
\n
\n
\n
 
\n
\n\n\n\n

\n · · \n
\n
\n','EventsCalendar'); -INSERT INTO template VALUES (7,'Cool Menus','\n\n \n\n\n\n\n','Navigation',1,1); +INSERT INTO template VALUES (7,'Cool Menus','\n\n \n\n\n\n\n','Navigation'); INSERT INTO Navigation VALUES (17,'coolmenu',99,'descendants','WebGUIroot',-1,7,0,0,0,0); diff --git a/etc/WebGUI.conf.original b/etc/WebGUI.conf.original index 20d38524a..7658dabf4 100644 --- a/etc/WebGUI.conf.original +++ b/etc/WebGUI.conf.original @@ -12,6 +12,11 @@ extrasPath = /data/WebGUI/www/extras uploadsURL = /uploads uploadsPath = /data/WebGUI/www/uploads +useSharedInternationalCache = 1 + +emailRecoveryLoggingEnabled = 1 +passwordChangeLoggingEnabled = 1 + authMethods = LDAP, WebGUI wobjects = Article, EventsCalendar, FileManager, HttpProxy, \ diff --git a/lib/WebGUI/Cache.pm b/lib/WebGUI/Cache.pm index 77f95ab63..927d813b8 100644 --- a/lib/WebGUI/Cache.pm +++ b/lib/WebGUI/Cache.pm @@ -15,9 +15,7 @@ package WebGUI::Cache; =cut -#Test to see if Cache::FileCache will load. -my $hasCache=1; -eval " use Cache::FileCache; "; $hasCache=0 if $@; +use Cache::FileCache; use HTTP::Headers; use HTTP::Request; @@ -32,7 +30,7 @@ Package WebGUI::Cache =head1 DESCRIPTION -This package provides a means for WebGUI to cache data to the filesystem. Caching is only enabled, however, if Cache::Filecache is installed on the system. +This package provides a means for WebGUI to cache data to the filesystem. =head1 SYNOPSIS @@ -45,11 +43,6 @@ These methods are available from this class: =cut -#------------------------------------------------------------------- -sub _canCache { - return ($hasCache); -} - #------------------------------------------------------------------- @@ -61,11 +54,7 @@ Remove content from the filesystem cache. =cut sub delete { - if (_canCache()) { - $_[0]->{_cache}->remove($_[0]->{_key}); - } else { - $_[0]->{_cache} = ""; - } + $_[0]->{_cache}->remove($_[0]->{_key}); } @@ -86,16 +75,12 @@ A regular expression that will match keys in the current namespace. Example: m/^ =cut sub deleteByRegex { - if (_canCache()) { my @keys = $_[0]->{_cache}->get_keys(); foreach my $key (@keys) { if ($key =~ $_[1]) { $_[0]->{_cache}->remove($key); } } - } else { - $_[0]->{_cache} = ""; - } } #------------------------------------------------------------------- @@ -107,11 +92,7 @@ Retrieve content from the filesystem cache. =cut sub get { - if (_canCache()) { return $_[0]->{_cache}->get($_[0]->{_key}); - } else { - return $_[0]->{_cache}; - } } #------------------------------------------------------------------- @@ -124,12 +105,8 @@ Retrieves an datastructure from the filesystem cache. sub getDataStructure { my ($serializer); - if (_canCache()) { $serializer = Data::Serializer->new(serializer => 'Storable'); return $serializer->deserialize($_[0]->{_cache}->get($_[0]->{_key})); - } else { - return $_[0]->{_cache}; - } } #------------------------------------------------------------------- @@ -157,7 +134,7 @@ sub new { my $class = shift; my $key = shift; my $namespace = shift || $session{config}{configFile}; - $cache = new Cache::FileCache({namespace=>$namespace, auto_purge_on_set=>1}) if (_canCache()); + $cache = new Cache::FileCache({namespace=>$namespace, auto_purge_on_set=>1}); bless {_cache => $cache, _key => $key}, $class; } @@ -184,11 +161,7 @@ The time to live for this content. This is the amount of time (in seconds) that sub set { my $ttl = $_[2] || 60; - if (_canCache()) { $_[0]->{_cache}->set($_[0]->{_key},$_[1],$ttl); - } else { - $_[0]->{_cache} = $_[1]; - } } #------------------------------------------------------------------- @@ -217,12 +190,8 @@ in the cache. Defaults to "60". sub setDataStructure { my $ttl = $_[2] || 60; - if (_canCache()) { $serializer = Data::Serializer->new(serializer => 'Storable'); $_[0]->{_cache}->set($_[0]->{_key},$serializer->serialize($_[1]),$ttl); - } else { - $_[0]->{_cache} = $_[1]; - } } #------------------------------------------------------------------- diff --git a/lib/WebGUI/International.pm b/lib/WebGUI/International.pm index 64123f497..e8169dd64 100644 --- a/lib/WebGUI/International.pm +++ b/lib/WebGUI/International.pm @@ -80,7 +80,11 @@ sub get { } else { $namespace = "WebGUI"; } - $cache = WebGUI::Cache->new($language."_".$namespace."_".$_[0],"International"); + my $cachetag = $session{config}{configFile}."-International"; + if ($session{config}{useSharedInternationalCache}) { + $cachetag = "International"; + } + $cache = WebGUI::Cache->new($language."_".$namespace."_".$_[0],$cachetag); $output = $cache->get; if (not defined $output) { ($output) = WebGUI::SQL->quickArray("select message from international diff --git a/sbin/preload.perl b/sbin/preload.perl index 3b943cdbc..6a28d3067 100644 --- a/sbin/preload.perl +++ b/sbin/preload.perl @@ -17,7 +17,7 @@ use Apache::Registry (); # Uncomment this for use with mod_perl 1.0 #---------------------------------------- # System controlled Perl modules. #---------------------------------------- -eval "use Cache::FileCache ();"; # eval, may not be installed +use Cache::FileCache (); use CGI (); CGI->compile(':all'); use CGI::Carp (); use CGI::Util (); @@ -29,6 +29,8 @@ use FileHandle (); use Net::SMTP (); use POSIX (); use URI::Escape (); +use Data::Serializer (); +use SOAP::Lite (); #---------------------------------------- diff --git a/sbin/testEnvironment.pl b/sbin/testEnvironment.pl index abae68ae2..bfe787cb5 100644 --- a/sbin/testEnvironment.pl +++ b/sbin/testEnvironment.pl @@ -187,23 +187,45 @@ if (eval { require Date::Calc }) { } } -print "Cache::FileCache module (optional*) ...... "; -if (eval { require Cache::FileCache }) { +print "Cache::Cache module ...................... "; +if (eval { require Cache::Cache }) { print "OK\n"; } else { - print "Not installed. Caching not possible.\n"; + if ($< == 0 && $os eq "Linuxish") { + print "Attempting to install...\n"; + CPAN::Shell->install("Cache::Cache"); + } else { + print "Please install.\n"; + $prereq = 0; + } } -print <install("SOAP::Lite"); + } else { + print "Please install.\n"; + $prereq = 0; + } +} -* Please note that Cache::FileCache is not - optional in all environments (such as Mac - OS X). Also note, that Cache::FileCache - is not available for Windows style - environments due to limitations on those - systems. +print "Data::Serializer module .................. "; +if (eval { require Data::Serializer }) { + print "OK\n"; +} else { + if ($< == 0 && $os eq "Linuxish") { + print "Attempting to install...\n"; + CPAN::Shell->install("Data::Serializer"); + } else { + print "Please install.\n"; + $prereq = 0; + } +} -STOP print "Image::Magick module (optional) .......... "; if (eval { require Image::Magick }) {