From 48caad2d74cd7795436dc4f9a9494a882e5c556b Mon Sep 17 00:00:00 2001 From: JT Smith Date: Fri, 19 Nov 2004 22:59:25 +0000 Subject: [PATCH] merging 6.2.9 changes --- docs/changelog/6.x.x.txt | 49 +++++++++++++++---- docs/gotcha.txt | 7 ++- docs/migration.txt | 35 ++++++++++++- docs/previousVersion.sql | 8 +-- docs/upgrades/upgrade_6.2.8-6.2.9.sql | 5 ++ ..._6.2.8-6.3.0.pl => upgrade_6.2.9-6.3.0.pl} | 0 ....2.8-6.3.0.sql => upgrade_6.2.9-6.3.0.sql} | 0 lib/WebGUI/Asset.pm | 37 ++++++++------ lib/WebGUI/Auth.pm | 14 +++--- lib/WebGUI/Auth/LDAP.pm | 4 +- lib/WebGUI/Auth/SMB.pm | 4 +- lib/WebGUI/Auth/WebGUI.pm | 6 +-- lib/WebGUI/DatabaseLink.pm | 2 +- lib/WebGUI/Form.pm | 20 ++++---- lib/WebGUI/FormProcessor.pm | 1 + lib/WebGUI/Forum.pm | 1 + lib/WebGUI/Forum/UI.pm | 18 ++++--- lib/WebGUI/Grouping.pm | 15 +++--- lib/WebGUI/HTTP.pm | 2 +- lib/WebGUI/Macro/GroupAdd.pm | 2 +- lib/WebGUI/Macro/GroupDelete.pm | 2 +- lib/WebGUI/Macro/L_loginBox.pm | 10 ++-- lib/WebGUI/Macro/LoginToggle.pm | 2 +- lib/WebGUI/MessageLog.pm | 4 +- lib/WebGUI/MetaData.pm | 2 +- lib/WebGUI/Operation.pm | 1 + lib/WebGUI/Operation/Auth.pm | 2 +- lib/WebGUI/Operation/Group.pm | 4 +- lib/WebGUI/Operation/Package.pm | 6 +++ lib/WebGUI/Operation/Profile.pm | 6 +-- lib/WebGUI/Operation/Statistics.pm | 2 +- lib/WebGUI/Operation/Trash.pm | 2 +- lib/WebGUI/Operation/User.pm | 10 ++-- lib/WebGUI/Session.pm | 4 +- lib/WebGUI/Storage.pm | 2 +- lib/WebGUI/URL.pm | 30 ++++++++---- lib/WebGUI/Wobject.pm | 4 +- lib/WebGUI/Wobject/EventsCalendar.pm | 2 +- lib/WebGUI/Wobject/Survey.pm | 2 +- lib/WebGUI/Wobject/USS.pm | 10 ++-- lib/WebGUI/i18n/English/EventsCalendar.pm | 4 +- sbin/collateralImport.pl | 2 +- 42 files changed, 224 insertions(+), 119 deletions(-) create mode 100644 docs/upgrades/upgrade_6.2.8-6.2.9.sql rename docs/upgrades/{upgrade_6.2.8-6.3.0.pl => upgrade_6.2.9-6.3.0.pl} (100%) rename docs/upgrades/{upgrade_6.2.8-6.3.0.sql => upgrade_6.2.9-6.3.0.sql} (100%) diff --git a/docs/changelog/6.x.x.txt b/docs/changelog/6.x.x.txt index b7a09becb..7a4aa3e4c 100644 --- a/docs/changelog/6.x.x.txt +++ b/docs/changelog/6.x.x.txt @@ -1,8 +1,4 @@ 6.3.0 - - bugfix [1066029] IDs with dashes break search - - bugfix [1059353] index.fpl broken - - bugfix [1066824] lib/WebGUI/Forum.pm problem, and the fix - - Fixed the Slash_gatewayUrl macro. - Added a "Position" property to the DataForm Edit Field interface. This makes it easier to move a field to a certain position. (Len Kranendonk). - Added the variables "record.edit.icon", "record.delete.url" and "record.delete.icon" to the DataForm DataList template. (Len Kranendonk). - Converted all confirmation pages to client-side confirmation dialogs. Saves @@ -21,11 +17,8 @@ tnx brother for reporting) - Sped up Navigation.pm - bugfix [1041937] List Roots broken - - bugfix [1042680] collateralImport.pl --folderId - - Fixed typo in Wobjects/IndexedSearch.pm - Navigation template variable rename, added template variables for basepage.hasDaughter, page.inRoot. - - bugfix [1059647] Forum search broken, and the fix - Bugfix [ 1055396 ] Template switching issue (Len Kranendonk) - WebGUI Operations are now dynamically loaded (Len Kranendonk) - Added button to Form.pm / HTMLForm.pm (Len Kranendonk) @@ -36,14 +29,50 @@ - bugfix [ 991070 ] 5.5.4 Editor(s) replacing ^ symbol - bugfix [ 1022287 ] WYSIWYG-Editor Add new web link - bugfix [ 1055153 ] Turn Admin ON with SSL and IE. - - Fixed a redirect loop problem. - - Fixed a user profile vulnerability. - - Fixed a sequence ordering problem with the USS. - Added internationalized URL handling. - Moved site icon and fav icon directly into style templates. - Removed all the upgrades prior to 5.5.0. If you need to upgrade from an older version, you'll need to upgrade to 5.5.x first, and then upgrade to 6.x. + - Fixed a bug that caused begin/commit/rollback to fail when using the + internal WebGUI database. This exhibited no problems prior to this release + because no WebGUI functions actually used those methods before. + + +6.2.9 + - bugfix [ 1058105 ] input tag has to be closed with / + - Changed a bunch of comparison operators that could potentially break with + GUIDs. + - bugfix [ 1058090 ] POST in Form.pm should be post + - bugfix [ 1066824 ] lib/WebGUI/Forum.pm problem, and the fix + - bugfix [ 1062108 ] Typo in WebGUI::Attachment + - bugfix [ 1059647 ] Forum search broken, and the fix + - bugfix [ 1059353 ] index.fpl broken (draj) + - bugfix [ 1066029 ] IDs with dashes break search + - bugfix [ 1066759 ] USER I.D. Multiple Issues (Matt Luebke) + - bugfix [ 1060002 ] Unable to delete empty DatabaseLink + - bugfix [ 1068344 ] 6.2.8 gamma - Users can't deactivate account + - bugfix [ 1068920 ] IpFilter non-functional in 6.2.7 + - bugfix [ 1067171 ] DeleteCollateral doesn't delete all recurring in + EventsCalen + - bugfix [ 1069073 ] IDs with dashes break CoolMenus + - bugfix [ 1066778 ] www.plainblack.com/news?wid=920&func=viewRSS + - bugfix [ 1067740 ] pagination for manage users and groups + - bugfix [ 1062543 ] User profile fields don't hide correctly + - bugfix [ 1061115 ] 6.2.8 Encrypt login fails + - Fixed a bug in collateralImport.pl where imported items would not be + displayed if they were imported to the root. + - bugfix [ 1058167 ] admin mode: Menu --> undefined/forum + - bugfix [ 1057394 ] Bug in Notification email + - Fixed a meta refresh problem that resulted from a bug in Internet Explorer. + - Fixed the Slash_gatewayUrl macro. + - Fixed a redirect loop problem. + - Fixed a sequence ordering problem with the USS. + - Fixed a user profile vulnerability. + - Fixed typo in Wobjects/IndexedSearch.pm + - bugfix [ 1040570 ] default values for publicProfile and other preferences + - bugfix [ 1069732 ] redirect URL not working + - bugfix [ 1060003 ] pagination for Events Calendar not working as described 6.2.8 diff --git a/docs/gotcha.txt b/docs/gotcha.txt index d22d67d67..8d6225095 100644 --- a/docs/gotcha.txt +++ b/docs/gotcha.txt @@ -11,7 +11,12 @@ save you many hours of grief. -------------------------------------------------------------------- * If you're using languages other than English, you'll need to get new versions of those language files before upgrading. The - language file format has a new requirement. + language file format has a new requirement. Also, the + language files are now all converted to UTF-8. + + * If you were using any non-English language files on your site, + you may now have to convert your site content to UTF-8 + format. Check with your language file provider for details. 6.2.8 diff --git a/docs/migration.txt b/docs/migration.txt index a783c568a..605e805b2 100644 --- a/docs/migration.txt +++ b/docs/migration.txt @@ -116,6 +116,7 @@ something that uses a macro, wobject, or auth module outside of the usual mechanisms that call those plug-ins, then you'll need to write a piece of code to load the plug-in at use time. + 5.5 Privilege API Change In 6.1 we moved isInGroup from WebGUI::Privilege to WebGUI::Grouping, where it @@ -124,12 +125,14 @@ to canView and canEdit. And finally, we moved canEditWobject and canViewWobject to WebGUI::Wobject and renamed them canView and canEdit and converted them from regular functions into methods. + 5.6 Template API Change In 6.1 we completely rewrote the underlying template framework to add template caching. Any plug-ins that use WebGUI::Template, must be updated to reflect the new API. + 5.7 Internationalization and Help Change In 6.1 we moved the internationalization out of the database and into compiled @@ -150,6 +153,7 @@ help files using a script we provide. You can find the script here: http://www.plainblack.com/translations?wid=1552&func=viewSubmission&sid=1213 + 5.8 WebGUI::Session Changes In 6.1 we changed the session API to remove functions that didn't really @@ -157,6 +161,7 @@ belong in WebGUI::Session. The main changes of interest are that you no longer do HTTP redirects and set cookies via session. Take a look at WebGUI::HTTP for details. + 5.9 Global Unique IDs In 6.2 we added global unique Ids to WebGUI. This means that a lot of the integer- @@ -165,9 +170,10 @@ update your code and database tables to take advantage of this. Some of the more important ID's that have been changed are User Ids, Group Ids, and Wobject Ids. See WebGUI::Id for more information. + 5.10 POD -We've switched to a new Plain Old Documentation (POD) format. See Ruling +In 6.2 we've switched to a new Plain Old Documentation (POD) format. See Ruling WebGUI for details. @@ -181,4 +187,31 @@ the makeUrlCompliant subroutine from lib/WebGUI/i18n/English.pm into your language file. +5.12 UTF-8 Required + +As of 6.3 we're now requiring that all WebGUI sites use the UTF-8 character +set. The language packs distributed from the WebGUI Worldwide members will now +be converted to UTF-8, and you can get instructions on their sites as to how +to convert your content, if necessary. + + +5.13 Form Changes + +The following form changes were made in 6.3: + +The interval subroutine in WebGUI::Form and WebGUI::HTMLForm had an API +change. See the documentation for WebGUI::Form and WebGUI::HTMLForm for +details. + +The select method in WebGUI::HTMLForm that has been depricated forever has +been removed. + +Most of the subroutines in WebGUI::HTMLForm and WebGUI::Form now have a +parameter called "defaultValue" which will be used in the event that "value" +is not specified. + +You can now dynamically add tabs to WebGUI::TabForms. + + + diff --git a/docs/previousVersion.sql b/docs/previousVersion.sql index eae5e90fe..abc9742e4 100644 --- a/docs/previousVersion.sql +++ b/docs/previousVersion.sql @@ -2817,6 +2817,7 @@ INSERT INTO template VALUES ('1','Default SMB Account Display Template','

\n INSERT INTO template VALUES ('1','Default SMB Anonymous Registration Template','

\n \r\n

\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 \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
\r\n\r\n\r\n\r\n
\r\n \r\n
','Auth/SMB/Create',1,1); INSERT INTO template VALUES ('1','Default WebGUI Yes/No Prompt','

\n\n

\n\n

\n\n
\n\n\">\n\n          \n\n\">\n\n
\n','prompt',1,1); INSERT INTO template VALUES ('1','Fail Safe','\n \n \n <tmpl_var session.page.title> - <tmpl_var session.setting.companyName>\n \n \n \n ^AdminBar;\n\n\r\n^H; / ^Navigation(TopLevelMenuHorizontal_1000); / ^Navigation(currentMenuHorizontal_1001); / ^a;\r\n
\n\n\n \n \n\n
\r\n^H; / ^Navigation(TopLevelMenuHorizontal_1000); / ^Navigation(currentMenuHorizontal_1001); / ^a;\r\n\n \n ','style',0,0); +INSERT INTO template VALUES ('1000','WebGUI 6 Admin Style','\n \n \n <tmpl_var session.page.title> - <tmpl_var session.setting.companyName>\n \n \r\n \r\n\r\n\r\n\n \n \r\n\r\n^AdminBar(2);

\r\n\r\n
\r\n \n \n \r\n
\r\n\r\n\r\n
^H; / ^PageTitle; / ^AdminToggle; / ^LoginToggle; / ^a;
\r\n\r\n\r\n\r\n\r\n\r\n\r\n\n \n ','style',1,1); INSERT INTO template VALUES ('4','Clipboard','\n \n \n <tmpl_var session.page.title> - <tmpl_var session.setting.companyName>\n \n \n \n ^AdminBar;\n\n\r\n\r\n\r\n\r\n\r\n
Clipboard\r\n^H; / ^a;
\r\n
PAGES
^Navigation(FlexMenu_1002);
CONTENT
\n\n\n \n \n\n
\r\n\r\n\r\n
\r\n^H; / ^a;\r\n\n \n ','style',0,0); INSERT INTO template VALUES ('1001','WebGUI 6','\n \n \n <tmpl_var session.page.title> - <tmpl_var session.setting.companyName>\n \n \r\n \n \n \r\n^AdminBar(2);\r\n\r\n\r\n\r\n \r\n \r\n \r\n \r\n \r\n
^L(17,\"\",2); ^AdminToggle;
\r\n\r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n
\n         \r\n\"home\" \n \"Email\"\r\n\"Print\" \n \"Site \"Plain\r\n^Spacer(56,1);^Spacer(26,1);
\r\n\r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
^Spacer(53,59);^D(\"%c %D, %y\");
^PageTitle;
^Spacer(53,59);
\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 \r\n
^Spacer(53,1);\r\n
\r\n^Navigation(FlexMenu_1002);\r\n


\r\n\r\n
\n \n ^Spacer(53,1);
\r\n\r\n\r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n

Design by Plain Black
\r\n\n \n ','style',1,1); INSERT INTO template VALUES ('3','Make Page Printable','\n \n \n <tmpl_var session.page.title> - <tmpl_var session.setting.companyName>\n \n \n \n ^AdminBar;\n\n\r\n
\n\n\n \n \n\n
© 2001-2004 Plain Black LLC
\r\n\n \n ','style',1,1); @@ -3092,7 +3093,7 @@ CREATE TABLE webguiVersion ( -- -INSERT INTO webguiVersion VALUES ('6.2.8','initial install',unix_timestamp()); +INSERT INTO webguiVersion VALUES ('6.2.9','initial install',unix_timestamp()); -- -- Table structure for table `wobject` @@ -3144,8 +3145,6 @@ INSERT INTO wobject VALUES ('6','1002','SyndicatedContent',1,'The Latest News',0 INSERT INTO wobject VALUES ('7','1003','DataForm',1,'Tell A Friend',0,'Tell a friend about WebGUI.',1076709292,'3',1076709522,'3',1,946710000,2082783600,NULL,NULL,NULL,NULL,NULL,0,NULL,NULL,NULL,'1','3','3','7',''); INSERT INTO wobject VALUES ('8','1004','SiteMap',0,'Site Map',0,'',1001744792,'3',1016077239,'3',1,1001744792,1336444487,NULL,NULL,NULL,NULL,NULL,0,NULL,NULL,NULL,'2','3','3','7',''); -delete from template where templateId='7' and namespace='Navigation'; -INSERT INTO template VALUES ('7','Cool Menus','\r\n\r\n\r\n\r\n\r\n\r\n \r\n\r\n^JavaScript(\"/coolmenus/coolmenus4.js\");\r\n','Navigation',1,1); alter table SiteMap change startAtThisLevel startAtThisLevel varchar(22); delete from template where templateId in (1,2) and namespace='Macro/L_loginBox'; INSERT INTO template VALUES ('1','Default Login Box','
\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\r\n \r\n \">.\r\n \">\r\n \r\n \r\n \r\n
\r\n
\r\n','Macro/L_loginBox',1,1); @@ -3155,3 +3154,6 @@ alter table forumPost add index status_forumThreadId (status,forumThreadId); alter table forumThread add index forumId_lastPostDate (forumId,lastPostDate); alter table forumThread add index status_forumThreadId (status,forumThreadId); +delete from template where templateId='7' and namespace='Navigation'; +INSERT INTO template VALUES ('7','Cool Menus','\r\n\r\n\r\n\r\n\r\n\r\n \r\n\r\n^JavaScript(\"/coolmenus/coolmenus4.js\");\r\n','Navigation',1,1); + diff --git a/docs/upgrades/upgrade_6.2.8-6.2.9.sql b/docs/upgrades/upgrade_6.2.8-6.2.9.sql new file mode 100644 index 000000000..3f1f95780 --- /dev/null +++ b/docs/upgrades/upgrade_6.2.8-6.2.9.sql @@ -0,0 +1,5 @@ +insert into webguiVersion values ('6.2.9','upgrade',unix_timestamp()); +delete from template where templateId='7' and namespace='Navigation'; +INSERT INTO template VALUES ('7','Cool Menus','\r\n\r\n\r\n\r\n\r\n\r\n \r\n\r\n^JavaScript(\"/coolmenus/coolmenus4.js\");\r\n','Navigation',1,1); +update collateral set collateralFolderId='0' where collateralFolderId is null; + diff --git a/docs/upgrades/upgrade_6.2.8-6.3.0.pl b/docs/upgrades/upgrade_6.2.9-6.3.0.pl similarity index 100% rename from docs/upgrades/upgrade_6.2.8-6.3.0.pl rename to docs/upgrades/upgrade_6.2.9-6.3.0.pl diff --git a/docs/upgrades/upgrade_6.2.8-6.3.0.sql b/docs/upgrades/upgrade_6.2.9-6.3.0.sql similarity index 100% rename from docs/upgrades/upgrade_6.2.8-6.3.0.sql rename to docs/upgrades/upgrade_6.2.9-6.3.0.sql diff --git a/lib/WebGUI/Asset.pm b/lib/WebGUI/Asset.pm index 14ef421c9..b1bda7898 100644 --- a/lib/WebGUI/Asset.pm +++ b/lib/WebGUI/Asset.pm @@ -189,22 +189,6 @@ sub getEditForm { -value=>$self->get("synopsis"), -uiLevel=>3 ); - my @data = WebGUI::DateTime::secondsToInterval($self->get("cacheTimeout")); - $tabform->getTab("properties")->interval( - -name=>"cacheTimeout", - -label=>WebGUI::International::get(895), - -intervalValue=>$data[0], - -unitsValue=>$data[1], - -uiLevel=>8 - ); - @data = WebGUI::DateTime::secondsToInterval($self->get("cacheTimeoutVisitor")); - $tabform->getTab("properties")->interval( - -name=>"cacheTimeoutVisitor", - -label=>WebGUI::International::get(896), - -intervalValue=>$data[0], - -unitsValue=>$data[1], - -uiLevel=>8 - ); $tabform->add("privileges",WebGUI::International::get(107),6); $tabform->getTab("privileges")->dateTime( -name=>"startDate", @@ -262,6 +246,18 @@ sub getId { return $self->get("assetId"); } +#------------------------------------------------------------------- + +=head2 getIndexerParams ( ) + +Override this method and return a hash reference that includes the properties necessary to index the content of the wobject. + +=cut + +sub getIndexerParams { + return {}; +} + sub getNextChildRank { my $self = shift; my ($lineage) = WebGUI::SQL->quickArray("select max(lineage) from asset where parentId=".quote($self->getId)); @@ -352,6 +348,15 @@ sub getUiLevel { return 0; } +sub getValue { + my $self = shift; + my $key = shift; + if (defined $key) { + return $session{form}{$key} || $self->get($key); + } + return undef; +} + sub new { my $class = shift; my $assetId = shift; diff --git a/lib/WebGUI/Auth.pm b/lib/WebGUI/Auth.pm index aeae8fd0d..53824207c 100644 --- a/lib/WebGUI/Auth.pm +++ b/lib/WebGUI/Auth.pm @@ -287,7 +287,7 @@ Auth method that the form for creating users should call sub deactivateAccount { my $self = shift; my $method = $_[0]; - return WebGUI::Privilege::vitalComponent() if($self->userId < 26); + return WebGUI::Privilege::vitalComponent() if($self->userId eq '1' || $self->userId eq '3'); return WebGUI::Privilege::adminOnly() if(!$session{setting}{selfDeactivation}); my %var; $var{title} = WebGUI::International::get(42); @@ -309,7 +309,7 @@ Superclass method that performs general functionality for deactivating accounts. sub deactivateAccountConfirm { my $self = shift; - return WebGUI::Privilege::vitalComponent() if ($self->userId < 26); + return WebGUI::Privilege::vitalComponent() if($self->userId eq '1' || $self->userId eq '3'); my $u = $self->user; $u->status("Selfdestructed"); WebGUI::Session::end($session{var}{sessionId}); @@ -401,10 +401,12 @@ sub displayLogin { WebGUI::Session::setScratch("redirectAfterLogin",$session{env}{REQUEST_URI}); } $vars->{title} = WebGUI::International::get(66); - $vars->{'login.form.header'} = WebGUI::Form::formHeader(); - if ($session{setting}{encryptLogin}) { - $vars->{'login.form.header'} =~ s/http:/https:/; - } + my $action; + if ($session{setting}{encryptLogin}) { + $action = WebGUI::URL::page(undef,1); + $action =~ s/http:/https:/; + } + $vars->{'login.form.header'} = WebGUI::Form::formHeader({action=>$action}); $vars->{'login.form.hidden'} = WebGUI::Form::hidden({"name"=>"op","value"=>"auth"}); $vars->{'login.form.hidden'} .= WebGUI::Form::hidden({"name"=>"method","value"=>$method}); $vars->{'login.form.username'} = WebGUI::Form::text({"name"=>"username"}); diff --git a/lib/WebGUI/Auth/LDAP.pm b/lib/WebGUI/Auth/LDAP.pm index 21702e526..75c68ecff 100644 --- a/lib/WebGUI/Auth/LDAP.pm +++ b/lib/WebGUI/Auth/LDAP.pm @@ -237,7 +237,7 @@ sub createAccountSave { #------------------------------------------------------------------- sub deactivateAccount { my $self = shift; - return $self->displayLogin if($self->userId == 1); + return $self->displayLogin if($self->userId eq '1'); return $self->SUPER::deactivateAccount("deactivateAccountConfirm"); } @@ -252,7 +252,7 @@ sub deactivateAccountConfirm { sub displayAccount { my $self = shift; my $vars; - return $self->displayLogin($_[0]) if ($self->userId == 1); + return $self->displayLogin($_[0]) if ($self->userId eq '1'); $vars->{displayTitle} = '

'.WebGUI::International::get(61).'

'; $vars->{'account.message'} = WebGUI::International::get(856); if($session{setting}{useKarma}){ diff --git a/lib/WebGUI/Auth/SMB.pm b/lib/WebGUI/Auth/SMB.pm index 3d6c52bd5..d95738f47 100644 --- a/lib/WebGUI/Auth/SMB.pm +++ b/lib/WebGUI/Auth/SMB.pm @@ -146,7 +146,7 @@ sub createAccountSave { #------------------------------------------------------------------- sub deactivateAccount { my $self = shift; - return $self->displayLogin if($self->userId == 1); + return $self->displayLogin if($self->userId eq '1'); return $self->SUPER::deactivateAccount("deactivateAccountConfirm"); } @@ -161,7 +161,7 @@ sub deactivateAccountConfirm { sub displayAccount { my $self = shift; my $vars; - return $self->displayLogin($_[0]) if ($self->userId == 1); + return $self->displayLogin($_[0]) if ($self->userId eq '1'); $vars->{displayTitle} = '

'.WebGUI::International::get(61).'

'; $vars->{'account.message'} = WebGUI::International::get(856); if($session{setting}{useKarma}){ diff --git a/lib/WebGUI/Auth/WebGUI.pm b/lib/WebGUI/Auth/WebGUI.pm index d2aebc448..a017d6157 100644 --- a/lib/WebGUI/Auth/WebGUI.pm +++ b/lib/WebGUI/Auth/WebGUI.pm @@ -203,7 +203,7 @@ sub createAccountSave { #------------------------------------------------------------------- sub deactivateAccount { my $self = shift; - return $self->displayLogin if($self->userId == 1); + return $self->displayLogin if($self->userId eq '1'); return $self->SUPER::deactivateAccount("deactivateAccountConfirm"); } @@ -218,7 +218,7 @@ sub deactivateAccountConfirm { sub displayAccount { my $self = shift; my $vars; - return $self->displayLogin($_[0]) if ($self->userId == 1); + return $self->displayLogin($_[0]) if ($self->userId eq '1'); my $userData = $self->getParams; $vars->{'account.message'} = $_[0] if ($_[0]); $vars->{'account.noform'} = 1; @@ -508,7 +508,7 @@ sub updateAccount { my $display = '
  • '.WebGUI::International::get(81).'

    '; my $error = ""; - if($self->userId == 1){ + if($self->userId eq '1'){ return $self->displayLogin; } diff --git a/lib/WebGUI/DatabaseLink.pm b/lib/WebGUI/DatabaseLink.pm index eac666683..6298bde30 100644 --- a/lib/WebGUI/DatabaseLink.pm +++ b/lib/WebGUI/DatabaseLink.pm @@ -90,7 +90,7 @@ A valid databaseLinkId sub whatIsUsing { # get list of SQLReports my $sql = 'select wobject.wobjectId, wobject.title, page.menuTitle, page.urlizedTitle from wobject, SQLReport, page '. - 'where SQLReport.databaseLinkId = '.quote($_[0]). 'and SQLReport.wobjectId = wobject.wobjectId '. + 'where SQLReport.databaseLinkId = '.quote($_[0]).' and SQLReport.wobjectId = wobject.wobjectId '. 'and wobject.pageId = page.pageId'; my $sth = WebGUI::SQL->read($sql); my @using; diff --git a/lib/WebGUI/Form.pm b/lib/WebGUI/Form.pm index bf61b8775..49d245aaf 100644 --- a/lib/WebGUI/Form.pm +++ b/lib/WebGUI/Form.pm @@ -136,7 +136,7 @@ sub button { my $params = shift; my $value = $params->{value} || $params->{defaultValue} || WebGUI::International::get(62); $value = _fixQuotes($value); - return '{extras}.'>'; + return '{extras}.' />'; } #------------------------------------------------------------------- @@ -173,7 +173,7 @@ sub checkbox { my $params = shift; my $checkedText = ' checked="1"' if ($params->{checked}); my $value = $params->{value} || $params->{defaultValue} || 1; - return '{extras}.'>'; + return '{extras}.' />'; } #------------------------------------------------------------------- @@ -709,7 +709,7 @@ The number of characters wide this form element should be. There should be no re sub file { my $params = shift; my $size = $params->{size} || $session{setting}{textBoxSize} || 30; - return '{extras}.'>'; + return '{extras}.' />'; } @@ -785,7 +785,7 @@ The form action. Defaults to the current page. =head3 method -The form method. Defaults to "POST". +The form method. Defaults to "post". =head3 enctype @@ -811,7 +811,7 @@ sub formHeader { $hidden .= hidden({name=>$name,value=>$value}); } } - my $method = $params->{method} || "POST"; + my $method = $params->{method} || "post"; my $enctype = $params->{enctype} || "multipart/form-data"; return '

    {extras}.'>
    '.$hidden; } @@ -1071,7 +1071,7 @@ sub HTMLArea { # Other variables $var{"button"} = '
    '; + .WebGUI::International::get(171).'" style="font-size: 8pt;" />
    '; if ($session{user}{richEditor} eq 'none') { return $var{textarea}; } else { @@ -1224,7 +1224,7 @@ sub password { my $maxLength = $params->{maxlength} || 35; my $size = $params->{size} || $session{setting}{textBoxSize} || 30; return '{extras}.'>'; + $size.'" maxlength="'.$maxLength.'" '.$params->{extras}.' />'; } #------------------------------------------------------------------- @@ -1309,7 +1309,7 @@ sub radio { my $params = shift; my $checkedText = ' checked="1"' if ($params->{checked}); my $value = $params->{value}||$params->{defaultValue}; - return '{extras}.'>'; + return '{extras}.' />'; } #------------------------------------------------------------------- @@ -1468,7 +1468,7 @@ sub submit { my $value = $params->{value} || $params->{defaultValue} || WebGUI::International::get(62); my $value = _fixQuotes($value); my $wait = WebGUI::International::get(452); - return '{extras}.'>'; + return '{extras}.' />'; } @@ -1657,7 +1657,7 @@ sub timeField { $output .= ''; + WebGUI::International::get(970).'" />'; return $output; } diff --git a/lib/WebGUI/FormProcessor.pm b/lib/WebGUI/FormProcessor.pm index c55bc48f9..c503c777b 100644 --- a/lib/WebGUI/FormProcessor.pm +++ b/lib/WebGUI/FormProcessor.pm @@ -416,6 +416,7 @@ The default value for this variable. If the variable is undefined then the defau sub process { my ($name, $type, $default) = @_; my $value; + return undef unless (exists $session{form}{$name}); $type = "text" if ($type eq ""); $value = &$type($name); unless (defined $value) { diff --git a/lib/WebGUI/Forum.pm b/lib/WebGUI/Forum.pm index e733b6585..93242bafe 100644 --- a/lib/WebGUI/Forum.pm +++ b/lib/WebGUI/Forum.pm @@ -326,6 +326,7 @@ sub new { $properties->{karmaPerPost} = $master->{karmaPerPost}; $properties->{groupToView} = $master->{groupToView}; $properties->{groupToPost} = $master->{groupToPost}; + $properties->{groupToView} = $master->{groupToView}; $properties->{groupToModerate} = $master->{groupToModerate}; $properties->{moderatePosts} = $master->{moderatePosts}; $properties->{attachmentsPerPost} = $master->{attachmentsPerPost}; diff --git a/lib/WebGUI/Forum/UI.pm b/lib/WebGUI/Forum/UI.pm index 80e4a01cc..1c3b5adb2 100644 --- a/lib/WebGUI/Forum/UI.pm +++ b/lib/WebGUI/Forum/UI.pm @@ -677,7 +677,9 @@ The unique id for the post. =cut sub formatThreadURL { - return WebGUI::URL::append($_[0],"forumOp=viewThread&forumPostId=".$_[1]."#".$_[1]); + my $callback = shift; + my $postId = shift; + return WebGUI::URL::append($callback,"forumOp=viewThread&forumPostId=".$postId."#".$postId); } #------------------------------------------------------------------- @@ -974,7 +976,7 @@ sub getForumTemplateVars { my (%var, @thread_loop); $var{'callback.url'} = $callback; $var{'callback.label'} = WebGUI::International::get(1039); - $var{'user.isVisitor'} = ($session{user}{userId} == 1); + $var{'user.isVisitor'} = ($session{user}{userId} eq '1'); $var{'thread.new.url'} = formatNewThreadURL($callback,$forum->get("forumId")); $var{'thread.new.label'} = WebGUI::International::get(1018); $var{'forum.description'} = $caller->{description}; @@ -1063,7 +1065,7 @@ sub getForumTemplateVars { 'thread.root.user.name'=>$root->get("username"), 'thread.root.user.alias'=>WebGUI::User->new($root->get("userId"))->profileField("alias"), 'thread.root.user.id'=>$root->get("userId"), - 'thread.root.user.isVisitor'=>($root->get("userId") == 1), + 'thread.root.user.isVisitor'=>($root->get("userId") eq '1'), 'thread.root.status'=>formatStatus($root->get("status")), 'thread.last.subject'=>chopSubject($last->get("subject")), 'thread.last.url'=>formatThreadURL($callback,$last->get("forumPostId")), @@ -1073,7 +1075,7 @@ sub getForumTemplateVars { 'thread.last.user.profile'=>formatUserProfileURL($last->get("userId")), 'thread.last.user.name'=>$last->get("username"), 'thread.last.user.id'=>$last->get("userId"), - 'thread.last.user.isVisitor'=>($root->get("userId") == 1), + 'thread.last.user.isVisitor'=>($root->get("userId") eq '1'), 'thread.last.status'=>formatStatus($last->get("status")) }); } @@ -1131,13 +1133,13 @@ sub getPostTemplateVars { $var->{'post.isLocked'} = $thread->isLocked; $var->{'post.isModerator'} = $forum->isModerator; $var->{'post.canEdit'} = $post->canEdit($session{user}{userId}); - $var->{'post.user.isVisitor'} = ($post->get("userId") == 1); + $var->{'post.user.isVisitor'} = ($post->get("userId") eq '1'); $var->{'post.user.label'} = WebGUI::International::get(244); $var->{'post.user.name'} = $post->get("username"); $var->{'post.user.alias'} = WebGUI::User->new($post->get("userId"))->profileField("alias"); $var->{'post.user.Id'} = $post->get("userId"); $var->{'post.user.Profile'} = formatUserProfileURL($post->get("userId")); - $var->{'post.url'} = formatThreadURL($callback,$post->get("forumPostId")); + $var->{'post.url'} = WebGUI::URL::getSiteURL().formatThreadURL($callback,$post->get("forumPostId")); $var->{'post.id'} = $post->get("forumPostId"); $var->{'post.rate.label'} = WebGUI::International::get(1021); $var->{'post.rate.url.1'} = formatRatePostURL($callback,$post->get("forumPostId"),1); @@ -1193,7 +1195,7 @@ sub getThreadTemplateVars { $var->{'callback.url'} = $callback; $var->{'callback.label'} = WebGUI::International::get(1039); $var->{'user.canPost'} = $forum->canPost; - $var->{'user.isVisitor'} = ($session{user}{userId} == 1); + $var->{'user.isVisitor'} = ($session{user}{userId} eq '1'); $var->{'user.isModerator'} = $forum->isModerator; $var->{'user.isSubscribed'} = $thread->isSubscribed; $var->{'thread.layout.nested.label'} = WebGUI::International::get(1045); @@ -1685,7 +1687,7 @@ sub www_post { $var->{'newpost.isReply'} = ($session{form}{parentId} ne ""); $var->{'newpost.isEdit'} = ($session{form}{forumPostId} ne ""); $var->{'newpost.isNewThread'} = ($session{form}{parentId} eq "" && !$var->{'newpost.isEdit'}); - $var->{'user.isVisitor'} = ($session{user}{userId} == 1); + $var->{'user.isVisitor'} = ($session{user}{userId} eq '1'); $var->{'newpost.isNewMessage'} = ($var->{'newpost.isNewThread'} || $var->{'newpost.isReply'}); $var->{'form.begin'} = WebGUI::Form::formHeader({ action=>$caller->{callback} diff --git a/lib/WebGUI/Grouping.pm b/lib/WebGUI/Grouping.pm index 62fc08bd2..293f69caf 100755 --- a/lib/WebGUI/Grouping.pm +++ b/lib/WebGUI/Grouping.pm @@ -318,12 +318,11 @@ sub isInGroup { $gid = 3 unless (defined $gid); $uid = $session{user}{userId} if ($uid eq ""); ### The following several checks are to increase performance. If this section were removed, everything would continue to work as normal. - return 1 if ($gid == 7); # everyone is in the everyone group - return 1 if ($gid == 1 && $uid == 1); # visitors are in the visitors group - return 0 if ($gid != 1 && $uid == 1); # visitors can't be in any group except the visitors group - return 1 if ($gid==2 && $uid != 1); # if you're not a visitor, then you're a registered user + return 1 if ($gid eq '7'); # everyone is in the everyone group + return 1 if ($gid eq '1' && $uid eq '1'); # visitors are in the visitors group + return 1 if ($gid eq '2' && $uid ne '1'); # if you're not a visitor, then you're a registered user ### Look to see if we've already looked up this group. - if ($session{isInGroup}{$uid}{$gid} == 1) { + if ($session{isInGroup}{$uid}{$gid} eq '1') { return 1; } elsif ($session{isInGroup}{$uid}{$gid} eq "0") { return 0; @@ -334,7 +333,7 @@ sub isInGroup { foreach (@{$groups}) { $session{isInGroup}{$uid}{$_} = 1; } - if ($session{isInGroup}{$uid}{$gid} == 1) { + if ($session{isInGroup}{$uid}{$gid} eq '1') { return 1; } } @@ -374,7 +373,7 @@ sub isInGroup { ### Check karma levels. if ($session{setting}{useKarma}) { my $karma; - if ($uid == $session{user}{userId}) { + if ($uid eq $session{user}{userId}) { $karma = $session{user}{karma}; } else { ($karma) = WebGUI::SQL->quickHash("select karma from users where userId=".quote($uid)); @@ -387,7 +386,7 @@ sub isInGroup { ### Check external database if ($group{dbQuery} ne "" && $group{databaseLinkId}) { # skip if not logged in and query contains a User macro - unless ($group{dbQuery} =~ /\^User/i && $uid == 1) { + unless ($group{dbQuery} =~ /\^User/i && $uid eq '1') { my $dbLink = WebGUI::DatabaseLink->new($group{databaseLinkId}); my $dbh = $dbLink->dbh; if (defined $dbh) { diff --git a/lib/WebGUI/HTTP.pm b/lib/WebGUI/HTTP.pm index 14e03cda4..ef2d2f9a2 100644 --- a/lib/WebGUI/HTTP.pm +++ b/lib/WebGUI/HTTP.pm @@ -237,7 +237,7 @@ The URL to redirect to. sub setRedirect { $session{http}{location} = shift; setStatus("302", "Redirect"); - WebGUI::Style::setMeta({"http-equiv"=>"refresh",content=>"0,".$session{http}{location}}); + WebGUI::Style::setMeta({"http-equiv"=>"refresh",content=>"0, URL=".$session{http}{location}}); } diff --git a/lib/WebGUI/Macro/GroupAdd.pm b/lib/WebGUI/Macro/GroupAdd.pm index e16187ae8..e71b79d4f 100644 --- a/lib/WebGUI/Macro/GroupAdd.pm +++ b/lib/WebGUI/Macro/GroupAdd.pm @@ -23,7 +23,7 @@ sub process { my @param = WebGUI::Macro::getParams($_[0]); return "" if ($param[0] eq ""); return "" if ($param[1] eq ""); - return "" if ($session{user}{userId} == 1); + return "" if ($session{user}{userId} eq '1'); my $g = WebGUI::Group->find($param[0]); return "" if ($g->groupId eq ""); return "" unless ($g->autoAdd); diff --git a/lib/WebGUI/Macro/GroupDelete.pm b/lib/WebGUI/Macro/GroupDelete.pm index 1643e1a5f..f7e830a3e 100644 --- a/lib/WebGUI/Macro/GroupDelete.pm +++ b/lib/WebGUI/Macro/GroupDelete.pm @@ -23,7 +23,7 @@ sub process { my @param = WebGUI::Macro::getParams($_[0]); return "" if ($param[0] eq ""); return "" if ($param[1] eq ""); - return "" if ($session{user}{userId} == 1); + return "" if ($session{user}{userId} eq '1'); my $g = WebGUI::Group->find($param[0]); return "" if ($g->groupId eq ""); return "" unless ($g->autoDelete); diff --git a/lib/WebGUI/Macro/L_loginBox.pm b/lib/WebGUI/Macro/L_loginBox.pm index e7abbf9ae..9fdb4c69b 100644 --- a/lib/WebGUI/Macro/L_loginBox.pm +++ b/lib/WebGUI/Macro/L_loginBox.pm @@ -40,14 +40,16 @@ sub process { if (index(lc($ENV{HTTP_USER_AGENT}),"msie") < 0) { $boxSize = int($boxSize=$boxSize*2/3); } - $var{'form.header'} = WebGUI::Form::formHeader() + my $action; + if ($session{setting}{encryptLogin}) { + $action = WebGUI::URL::page(undef,1); + $action =~ s/http:/https:/; + } + $var{'form.header'} = WebGUI::Form::formHeader({action=>$action}) .WebGUI::Form::hidden({ name=>"op", value=>"login" }); - if ($session{setting}{encryptLogin}) { - $var{'form.header'} =~ s/http:/https:/; - } $var{'username.label'} = WebGUI::International::get(50); $var{'username.form'} = WebGUI::Form::text({ name=>"username", diff --git a/lib/WebGUI/Macro/LoginToggle.pm b/lib/WebGUI/Macro/LoginToggle.pm index b89ea2ac4..8549b2538 100644 --- a/lib/WebGUI/Macro/LoginToggle.pm +++ b/lib/WebGUI/Macro/LoginToggle.pm @@ -23,7 +23,7 @@ sub process { my $login = $param[0] || WebGUI::International::get(716); my $logout = $param[1] || WebGUI::International::get(717); my %var; - if ($session{user}{userId} == 1) { + if ($session{user}{userId} eq '1') { return WebGUI::URL::page("op=displayLogin") if ($param[0] eq "linkonly"); $var{'toggle.url'} = WebGUI::URL::page('op=displayLogin'); $var{'toggle.text'} = $login; diff --git a/lib/WebGUI/MessageLog.pm b/lib/WebGUI/MessageLog.pm index 3e25553dc..06d4b168b 100644 --- a/lib/WebGUI/MessageLog.pm +++ b/lib/WebGUI/MessageLog.pm @@ -121,7 +121,7 @@ sub addEntry { $subject = $_[2]; $message = $_[3]; $url = $_[4]; - unless ($url =~ /^http/) { + unless ($url =~ /^http/ || !defined $url) { $url = WebGUI::URL::getSiteURL().$url; } $status = $_[5]; @@ -186,7 +186,7 @@ sub addInternationalizedEntry { $userId = $_[0]; $groupId = $_[1]; $url = $_[2]; - unless ($url =~ /^http/) { + unless ($url =~ /^http/ || !defined $url) { $url = WebGUI::URL::getSiteURL().$url; } $internationalId = $_[3]; diff --git a/lib/WebGUI/MetaData.pm b/lib/WebGUI/MetaData.pm index cc4fce674..da72b7edb 100644 --- a/lib/WebGUI/MetaData.pm +++ b/lib/WebGUI/MetaData.pm @@ -349,7 +349,7 @@ sub getWobjectByCriteria { } my $wid; # Grab a wid from the results - if ($order == 'random') { + if ($order eq 'random') { $wid = $wids[ rand @wids ]; } else { #default order is mostRecent diff --git a/lib/WebGUI/Operation.pm b/lib/WebGUI/Operation.pm index 35ffb269e..d5ac03ff7 100644 --- a/lib/WebGUI/Operation.pm +++ b/lib/WebGUI/Operation.pm @@ -153,6 +153,7 @@ sub getOperations { 'deleteNavigationConfirm' => 'WebGUI::Operation::Navigation', 'previewNavigation' => 'WebGUI::Operation::Navigation', 'deployPackage' => 'WebGUI::Operation::Package', + 'managePackages' => 'WebGUI::Operation::Package', 'viewPageTree' => 'WebGUI::Operation::Page', 'movePageUp' => 'WebGUI::Operation::Page', 'movePageDown' => 'WebGUI::Operation::Page', diff --git a/lib/WebGUI/Operation/Auth.pm b/lib/WebGUI/Operation/Auth.pm index a10c1f3fd..c5473b4e2 100644 --- a/lib/WebGUI/Operation/Auth.pm +++ b/lib/WebGUI/Operation/Auth.pm @@ -33,7 +33,7 @@ Get the instance of this object or create a new instance if none exists sub getInstance { #Get Auth Settings my $authMethod = $session{user}{authMethod} || $session{setting}{authMethod}; - $authMethod = $session{setting}{authMethod} if($session{user}{userId} == 1); + $authMethod = $session{setting}{authMethod} if($session{user}{userId} eq '1'); $authMethod = $_[0] if($_[0] && isIn($_[0], @{$session{config}{authMethods}})); my $userId = $_[1]; #Create Auth Object diff --git a/lib/WebGUI/Operation/Group.pm b/lib/WebGUI/Operation/Group.pm index 28f172b26..378fdafb1 100644 --- a/lib/WebGUI/Operation/Group.pm +++ b/lib/WebGUI/Operation/Group.pm @@ -407,7 +407,7 @@ sub www_listGroups { return WebGUI::Privilege::adminOnly() unless (WebGUI::Grouping::isInGroup(3)); my $output = getGroupSearchForm("listGroups"); my ($groupCount) = WebGUI::SQL->quickArray("select count(*) from groups"); - return _submenu($output) unless ($session{form}{doit} || $groupCount<250); + return _submenu($output) unless ($session{form}{doit} || $groupCount<250 || $session{form}{pn} > 1); $output .= ''; $output .= '
    '.WebGUI::International::get(84).'' .WebGUI::International::get(85).'' @@ -533,7 +533,7 @@ sub www_manageUsersInGroup { $output .= '

    '.WebGUI::International::get(976).'

    '; $output .= WebGUI::Operation::User::getUserSearchForm("manageUsersInGroup",{gid=>$session{form}{gid}}); my ($userCount) = WebGUI::SQL->quickArray("select count(*) from users"); - return _submenu($output) unless ($session{form}{doit} || $userCount < 250); + return _submenu($output) unless ($session{form}{doit} || $userCount < 250 || $session{form}{pn} > 1); my $f = WebGUI::HTMLForm->new; $f->hidden("gid",$session{form}{gid}); $f->hidden("op","addUsersToGroupSave"); diff --git a/lib/WebGUI/Operation/Package.pm b/lib/WebGUI/Operation/Package.pm index 381146edb..0cd297265 100644 --- a/lib/WebGUI/Operation/Package.pm +++ b/lib/WebGUI/Operation/Package.pm @@ -19,6 +19,11 @@ use WebGUI::Session; use WebGUI::SQL; use WebGUI::URL; + +sub www_managePackages { + return "Packages have been disabled for this release. Check back in a future release to use packages.\n"; +} + #------------------------------------------------------------------- sub _duplicateWobjects { my (%properties); @@ -76,6 +81,7 @@ sub _recursePageTree { #------------------------------------------------------------------- sub www_deployPackage { + return "Packages have been disabled for this release. Check back in a future release to use packages.\n"; if (WebGUI::Page::canEdit()) { _recursePageTree($session{form}{pid},$session{page}{pageId}); return ""; diff --git a/lib/WebGUI/Operation/Profile.pm b/lib/WebGUI/Operation/Profile.pm index 63b2d3b3f..8764960bb 100644 --- a/lib/WebGUI/Operation/Profile.pm +++ b/lib/WebGUI/Operation/Profile.pm @@ -127,7 +127,7 @@ sub validateProfileData { #------------------------------------------------------------------- sub www_editProfile { my ($a, $data, $method, $values, $category, $label, $default, $previousCategory, $subtext, $vars, @profile, @array); - return WebGUI::Operation::Auth::www_auth("init") if($session{user}{userId} == 1); + return WebGUI::Operation::Auth::www_auth("init") if($session{user}{userId} eq '1'); $vars->{displayTitle} .= '

    '.WebGUI::International::get(338).'

    '; @@ -198,7 +198,7 @@ sub www_editProfile { #------------------------------------------------------------------- sub www_editProfileSave { my ($profile, $fieldName, $error, $u, $warning); - return WebGUI::Operation::Auth::www_auth("init") if ($session{user}{userId} == 1); + return WebGUI::Operation::Auth::www_auth("init") if ($session{user}{userId} eq '1'); ($profile, $error, $warning) = validateProfileData(); $error .= $warning; @@ -252,7 +252,7 @@ sub www_viewProfile { } $vars->{'profile.elements'} = \@array; $a->finish; - if ($session{user}{userId} == $session{form}{uid}) { + if ($session{user}{userId} eq $session{form}{uid}) { $vars->{'profile.accountOptions'} = WebGUI::Operation::Shared::accountOptions(); } return WebGUI::Template::process(1,'Operation/Profile/View', $vars); diff --git a/lib/WebGUI/Operation/Statistics.pm b/lib/WebGUI/Operation/Statistics.pm index b7200db5f..436ce36ba 100644 --- a/lib/WebGUI/Operation/Statistics.pm +++ b/lib/WebGUI/Operation/Statistics.pm @@ -44,7 +44,7 @@ sub www_viewPageReport { $sth = WebGUI::SQL->read("select pageTitle,pageId,userId,ipAddress,wobjectId from pageStatistics order by pageTitle,userId,ipAddress"); while ($data = $sth->hashRef) { - if ($data->{userId} == 1) { + if ($data->{userId} eq '1') { $user = $data->{ipAddress}; } else { $user = $data->{userId}; diff --git a/lib/WebGUI/Operation/Trash.pm b/lib/WebGUI/Operation/Trash.pm index f77f1d285..fee825328 100644 --- a/lib/WebGUI/Operation/Trash.pm +++ b/lib/WebGUI/Operation/Trash.pm @@ -51,7 +51,7 @@ sub _purgeUserTrash { $page = WebGUI::Page->getPage(3); foreach ($page->daughters) { $currentPage = WebGUI::Page->new($_); - if ($currentPage->get('bufferUserId') == $userId) { + if ($currentPage->get('bufferUserId') eq $userId) { foreach $currentWobjectPage ($currentPage->self_and_descendants) { _purgeWobjects($currentWobjectPage->{'pageId'}); } diff --git a/lib/WebGUI/Operation/User.pm b/lib/WebGUI/Operation/User.pm index c3138d5eb..e1d7e2cc5 100644 --- a/lib/WebGUI/Operation/User.pm +++ b/lib/WebGUI/Operation/User.pm @@ -160,7 +160,7 @@ sub www_becomeUser { #------------------------------------------------------------------- sub www_deleteGrouping { return WebGUI::Privilege::adminOnly() unless (WebGUI::Grouping::isInGroup(3)); - if (($session{user}{userId} == $session{form}{uid} || $session{form}{uid} == 3) && $session{form}{gid} == 3) { + if (($session{user}{userId} eq $session{form}{uid} || $session{form}{uid} eq '3') && $session{form}{gid} eq '3') { return _submenu(WebGUI::Privilege::vitalComponent()); } my @users = $session{cgi}->param('uid'); @@ -179,7 +179,7 @@ sub www_deleteGrouping { sub www_deleteUser { my ($output); return WebGUI::Privilege::adminOnly() unless (WebGUI::Grouping::isInGroup(3)); - if ($session{form}{uid} == 1 || $session{form}{uid} == 3) { + if ($session{form}{uid} eq '1' || $session{form}{uid} eq '3') { return _submenu(WebGUI::Privilege::vitalComponent()); } else { $output .= WebGUI::International::get(167).'

    '; @@ -195,7 +195,7 @@ sub www_deleteUser { sub www_deleteUserConfirm { return WebGUI::Privilege::adminOnly() unless (WebGUI::Grouping::isInGroup(3)); my ($u); - if ($session{form}{uid} == 1 || $session{form}{uid} == 3) { + if ($session{form}{uid} eq '1' || $session{form}{uid} eq '') { return WebGUI::Privilege::vitalComponent(); } else { $u = WebGUI::User->new($session{form}{uid}); @@ -239,7 +239,7 @@ sub www_editUser { Deactivated =>$i18n->get(818), Selfdestructed =>$i18n->get(819) ); - if ($u->userId == $session{user}{userId}) { + if ($u->userId eq $session{user}{userId}) { $tabform->getTab("account")->hidden("status",$u->status); } else { $tabform->getTab("account")->select("status",\%status,$i18n->get(816),[$u->status]); @@ -423,7 +423,7 @@ sub www_listUsers { my %status; my $output = getUserSearchForm("listUsers"); my ($userCount) = WebGUI::SQL->quickArray("select count(*) from users"); - return _submenu($output) unless ($session{form}{doit} || $userCount<250); + return _submenu($output) unless ($session{form}{doit} || $userCount<250 || $session{form}{pn} > 1); tie %status, 'Tie::IxHash'; %status = ( Active => WebGUI::International::get(817), diff --git a/lib/WebGUI/Session.pm b/lib/WebGUI/Session.pm index 6a8ee4f47..bc2a48035 100644 --- a/lib/WebGUI/Session.pm +++ b/lib/WebGUI/Session.pm @@ -102,8 +102,8 @@ sub _setupUserInfo { from userProfileData, userProfileField where userProfileData.fieldName=userProfileField.fieldName and userProfileData.userId=".quote($user{userId})); %user = (%user, %profile); - $user{language} = $session{page}{languageId} if ($user{userId} == 1 || $user{language} eq ''); - %default = WebGUI::SQL->buildHash("select fieldName, dataDefault from userProfileField where profileCategoryId=4"); + $user{language} = $session{page}{languageId} if ($user{userId} eq '1' || $user{language} eq ''); + %default = WebGUI::SQL->buildHash("select fieldName, dataDefault from userProfileField where profileCategoryId='4'"); foreach $key (keys %default) { if ($user{$key} eq "") { $value = eval($default{$key}); diff --git a/lib/WebGUI/Storage.pm b/lib/WebGUI/Storage.pm index 9b4b2a7e1..a44a1d1ba 100644 --- a/lib/WebGUI/Storage.pm +++ b/lib/WebGUI/Storage.pm @@ -388,7 +388,7 @@ sub getFileSize { $size = round($attributes[7]/1024); $size .= 'kB'; } else { - $size = $attributes[7]."B"; + $size = $attributes[7].'B'; } return $size; } diff --git a/lib/WebGUI/URL.pm b/lib/WebGUI/URL.pm index 47c1d7173..ab62645f1 100644 --- a/lib/WebGUI/URL.pm +++ b/lib/WebGUI/URL.pm @@ -233,7 +233,7 @@ sub makeCompliant { #------------------------------------------------------------------- -=head2 page ( [ pairs ] ) +=head2 page ( [ pairs, useSiteUrl ] ) Returns the URL of the current page. @@ -243,17 +243,29 @@ Name value pairs to add to the URL in the form of: name1=value1&name2=value2&name3=value3 +=head3 useSiteUrl + +If set to "1" we'll use the full site URL rather than the script (gateway) URL. + =cut sub page { - my $url = getScriptURL().$session{page}{urlizedTitle}; - if ($_[0]) { - $url = append($url,$_[0]); - } - if ($session{setting}{preventProxyCache} == 1) { - $url = append($url,"noCache=".randint(0,1000).';'.time()); - } - return $url; + my $pairs = shift; + my $useFullUrl = shift; + my $url; + if ($useFullUrl) { + $url = getSiteURL(); + } else { + $url = getScriptURL(); + } + $url .= $session{page}{urlizedTitle}; + if ($pairs) { + $url = append($url,$pairs); + } + if ($session{setting}{preventProxyCache} == 1) { + $url = append($url,"noCache=".randint(0,1000).';'.time()); + } + return $url; } #------------------------------------------------------------------- diff --git a/lib/WebGUI/Wobject.pm b/lib/WebGUI/Wobject.pm index 855075766..df90f1871 100644 --- a/lib/WebGUI/Wobject.pm +++ b/lib/WebGUI/Wobject.pm @@ -105,7 +105,7 @@ Returns a boolean (0|1) value signifying that the user has the required privileg sub canEdit { my $self = shift; return WebGUI::Page::canEdit() if ($session{page}{wobjectPrivileges} != 1 || $self->get("wobjectId") eq "new"); - if ($session{user}{userId} == $self->get("ownerId")) { + if ($session{user}{userId} eq $self->get("ownerId")) { return 1; } else { return WebGUI::Grouping::isInGroup($self->get("groupIdEdit")); @@ -123,7 +123,7 @@ Returns a boolean (0|1) value signifying that the user has the required privileg sub canView { my $self = shift; return WebGUI::Page::canView() unless ($session{page}{wobjectPrivileges} == 1); - if ($session{user}{userId} == $self->get("ownerId")) { + if ($session{user}{userId} eq $self->get("ownerId")) { return 1; } elsif ($self->get("startDate") < WebGUI::DateTime::time() && $self->get("endDate") > WebGUI::DateTime::time() && WebGUI::Grouping::isInGroup($self->get("groupIdView"))) { return 1; diff --git a/lib/WebGUI/Wobject/EventsCalendar.pm b/lib/WebGUI/Wobject/EventsCalendar.pm index a999b7c39..13e8bf7ba 100644 --- a/lib/WebGUI/Wobject/EventsCalendar.pm +++ b/lib/WebGUI/Wobject/EventsCalendar.pm @@ -155,7 +155,7 @@ sub www_deleteEvent { #------------------------------------------------------------------- sub www_deleteEventConfirm { return WebGUI::Privilege::insufficient() unless ($_[0]->canEdit); - if ($session{form}{rid} > 0) { + if ($session{form}{rid} ne "") { $_[0]->deleteCollateral("EventsCalendar_event","EventsCalendar_recurringId",$session{form}{rid}); } else { $_[0]->deleteCollateral("EventsCalendar_event","EventsCalendar_eventId",$session{form}{eid}); diff --git a/lib/WebGUI/Wobject/Survey.pm b/lib/WebGUI/Wobject/Survey.pm index 7cc5e528c..3a9e944a4 100644 --- a/lib/WebGUI/Wobject/Survey.pm +++ b/lib/WebGUI/Wobject/Survey.pm @@ -947,7 +947,7 @@ sub www_viewGradebook { push(@responseloop, { 'response.url'=>WebGUI::URL::page('func=viewIndividualSurvey&wid='.$self->get("wobjectId") .'&responseId='.$user->{Survey_responseId}), - 'response.user.name'=>($user->{userId} == 1) ? $user->{ipAddress} : $user->{username}, + 'response.user.name'=>($user->{userId} eq '1') ? $user->{ipAddress} : $user->{username}, 'response.count.correct' => $correctCount, 'response.percent' => round(($correctCount/$var->{'question.count'})*100) }); diff --git a/lib/WebGUI/Wobject/USS.pm b/lib/WebGUI/Wobject/USS.pm index a503fa15d..99c895fff 100644 --- a/lib/WebGUI/Wobject/USS.pm +++ b/lib/WebGUI/Wobject/USS.pm @@ -275,7 +275,7 @@ sub www_approveSubmission { %submission = WebGUI::SQL->quickHash("select * from USS_submission where USS_submissionId=".quote($session{form}{sid})); WebGUI::SQL->write("update USS_submission set status='Approved' where USS_submissionId=".quote($session{form}{sid})); WebGUI::MessageLog::addInternationalizedEntry($submission{userId},'',WebGUI::URL::page('func=viewSubmission&wid='. - $session{form}{wid}.'&sid='.$session{form}{sid}),4,$self->get("namespace")); + $session{form}{wid}.'&sid='.$session{form}{sid},1),4,$self->get("namespace")); WebGUI::MessageLog::completeEntry($session{form}{mlog}); $self->deleteCachedSubmission($session{form}{sid}); return WebGUI::Operation::www_viewMessageLog(); @@ -337,7 +337,7 @@ sub www_denySubmission { %submission = WebGUI::SQL->quickHash("select * from USS_submission where USS_submissionId=".quote($session{form}{sid})); WebGUI::SQL->write("update USS_submission set status='Denied' where USS_submissionId=".quote($session{form}{sid})); WebGUI::MessageLog::addInternationalizedEntry($submission{userId},'',WebGUI::URL::page('func=viewSubmission&wid='. - $session{form}{wid}.'&sid='.$session{form}{sid}),5,$self->get("namespace")); + $session{form}{wid}.'&sid='.$session{form}{sid},1),5,$self->get("namespace")); WebGUI::MessageLog::completeEntry($session{form}{mlog}); $self->deleteCachedSubmission($session{form}{sid}); return WebGUI::Operation::www_viewMessageLog(); @@ -454,7 +454,7 @@ sub www_editSubmission { $var{'link.header.label'} = WebGUI::International::get(90,$_[0]->get("namespace")); $var{'question.header.label'} = WebGUI::International::get(84,$_[0]->get("namespace")); $var{'submission.header.label'} = WebGUI::International::get(19,$_[0]->get("namespace")); - $var{'user.isVisitor'} = ($session{user}{userId} == 1); + $var{'user.isVisitor'} = ($session{user}{userId} eq '1'); $var{'visitorName.label'} = WebGUI::International::get(438); $var{'visitorName.form'} = WebGUI::Form::text({ name=>"visitorName" @@ -689,7 +689,7 @@ sub www_editSubmissionSave { $hash{status} = $_[0]->get("defaultStatus"); WebGUI::MessageLog::addInternationalizedEntry('',$_[0]->get("groupToApprove"), WebGUI::URL::page('func=viewSubmission&wid='.$_[0]->get("wobjectId").'&sid='. - $session{form}{sid}),3,$_[0]->get("namespace"),'pending'); + $session{form}{sid},1),3,$_[0]->get("namespace"),'pending'); } else { $hash{status} = "Approved"; } @@ -738,7 +738,7 @@ sub www_view { $var{"search.label"} = WebGUI::International::get(364); $var{"search.Form"} = WebGUI::Search::form({wid=>$_[0]->get("wobjectId"),func=>'view',search=>1}); $var{"search.url"} = WebGUI::Search::toggleURL("wid=".$_[0]->get("wobjectId")."&func=view"); - $var{"rss.url"} = WebGUI::URL::page('func=viewRSS&wid='.$_[0]->get("wobjectId")); + $var{"rss.url"} = WebGUI::URL::page('func=viewRSS&wid='.$_[0]->get("wobjectId"),1); $var{canModerate} = WebGUI::Grouping::isInGroup($_[0]->get("groupToApprove"),$session{user}{userId}); WebGUI::Style::setLink($var{"rss.url"},{ rel=>'alternate', type=>'application/rss+xml', title=>'RSS' }); if ($session{scratch}{search}) { diff --git a/lib/WebGUI/i18n/English/EventsCalendar.pm b/lib/WebGUI/i18n/English/EventsCalendar.pm index dadaef30b..72f446523 100644 --- a/lib/WebGUI/i18n/English/EventsCalendar.pm +++ b/lib/WebGUI/i18n/English/EventsCalendar.pm @@ -70,7 +70,7 @@ Choose a layout for the individual events within the calendars.

    Paginate After
    -When using a list-style calendar, how many events should be shown per page? +How many months of data should be shown before paginating?


    @@ -81,7 +81,7 @@ When using a list-style calendar, how many events should be shown per page? The title of an individual event. |, - lastUpdated => 1099551537, + lastUpdated => 1100902948, }, '80' => { diff --git a/sbin/collateralImport.pl b/sbin/collateralImport.pl index f179856ac..306307ea1 100644 --- a/sbin/collateralImport.pl +++ b/sbin/collateralImport.pl @@ -30,7 +30,7 @@ use WebGUI::Utility; my $configFile; -my $folderId; +my $folderId = '0'; my $help; my $override; my $pathToFiles;