merging 6.2.9 changes

This commit is contained in:
JT Smith 2004-11-19 22:59:25 +00:00
parent 1bb82bd7b9
commit 48caad2d74
42 changed files with 224 additions and 119 deletions

View file

@ -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 <input type="button"> 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

View file

@ -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

View file

@ -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.

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -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;

View file

@ -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"});

View file

@ -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} = '<h1>'.WebGUI::International::get(61).'</h1>';
$vars->{'account.message'} = WebGUI::International::get(856);
if($session{setting}{useKarma}){

View file

@ -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} = '<h1>'.WebGUI::International::get(61).'</h1>';
$vars->{'account.message'} = WebGUI::International::get(856);
if($session{setting}{useKarma}){

View file

@ -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 = '<li>'.WebGUI::International::get(81).'<p>';
my $error = "";
if($self->userId == 1){
if($self->userId eq '1'){
return $self->displayLogin;
}

View file

@ -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;

View file

@ -136,7 +136,7 @@ sub button {
my $params = shift;
my $value = $params->{value} || $params->{defaultValue} || WebGUI::International::get(62);
$value = _fixQuotes($value);
return '<input type="button" value="'.$value.'" '.$params->{extras}.'>';
return '<input type="button" value="'.$value.'" '.$params->{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 '<input type="checkbox" name="'.$params->{name}.'" value="'.$value.'"'.$checkedText.' '.$params->{extras}.'>';
return '<input type="checkbox" name="'.$params->{name}.'" value="'.$value.'"'.$checkedText.' '.$params->{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 '<input type="file" name="'.$params->{name}.'" size="'.$size.'" '.$params->{extras}.'>';
return '<input type="file" name="'.$params->{name}.'" size="'.$size.'" '.$params->{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 '<form action="'.$action.'" enctype="'.$enctype.'" method="'.$method.'" '.$params->{extras}.'><div class="formContents">'.$hidden;
}
@ -1071,7 +1071,7 @@ sub HTMLArea {
# Other variables
$var{"button"} = '<input type="button" onClick="openEditWindow(this.form.'.$params->{name}.')" value="'
.WebGUI::International::get(171).'" style="font-size: 8pt;"><br>';
.WebGUI::International::get(171).'" style="font-size: 8pt;" /><br />';
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 '<input type="password" name="'.$params->{name}.'" value="'.$value.'" size="'.
$size.'" maxlength="'.$maxLength.'" '.$params->{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 '<input type="radio" name="'.$params->{name}.'" value="'.$value.'"'.$checkedText.' '.$params->{extras}.'>';
return '<input type="radio" name="'.$params->{name}.'" value="'.$value.'"'.$checkedText.' '.$params->{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 '<input type="submit" value="'.$value.'" onClick="this.value=\''.$wait.'\'" '.$params->{extras}.'>';
return '<input type="submit" value="'.$value.'" onClick="this.value=\''.$wait.'\'" '.$params->{extras}.' />';
}
@ -1657,7 +1657,7 @@ sub timeField {
$output .= '<input type="button" style="font-size: 8pt;" onClick="window.timeField = this.form.'.
$params->{name}.';clockSet = window.open(\''.$session{config}{extrasURL}.
'/timeChooser.html\',\'timeChooser\',\'WIDTH=230,HEIGHT=100\');return false" value="'.
WebGUI::International::get(970).'">';
WebGUI::International::get(970).'" />';
return $output;
}

View file

@ -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) {

View file

@ -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};

View file

@ -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}

View file

@ -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) {

View file

@ -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}});
}

View file

@ -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);

View file

@ -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);

View file

@ -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",

View file

@ -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;

View file

@ -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];

View file

@ -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

View file

@ -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',

View file

@ -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

View file

@ -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 .= '<table border=1 cellpadding=5 cellspacing=0 align="center">';
$output .= '<tr><td class="tableHeader">'.WebGUI::International::get(84).'</td><td class="tableHeader">'
.WebGUI::International::get(85).'</td><td class="tableHeader">'
@ -533,7 +533,7 @@ sub www_manageUsersInGroup {
$output .= '<p><h1>'.WebGUI::International::get(976).'</h1>';
$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");

View file

@ -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 "";

View file

@ -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} .= '<h1>'.WebGUI::International::get(338).'</h1>';
@ -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);

View file

@ -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};

View file

@ -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'});
}

View file

@ -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).'<p>';
@ -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),

View file

@ -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});

View file

@ -388,7 +388,7 @@ sub getFileSize {
$size = round($attributes[7]/1024);
$size .= 'kB';
} else {
$size = $attributes[7]."B";
$size = $attributes[7].'B';
}
return $size;
}

View file

@ -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;
}
#-------------------------------------------------------------------

View file

@ -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;

View file

@ -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});

View file

@ -947,7 +947,7 @@ sub www_viewGradebook {
push(@responseloop, {
'response.url'=>WebGUI::URL::page('func=viewIndividualSurvey&amp;wid='.$self->get("wobjectId")
.'&amp;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)
});

View file

@ -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}) {

View file

@ -70,7 +70,7 @@ Choose a layout for the individual events within the calendars.
<p>
<b>Paginate After</b><br>
When using a list-style calendar, how many events should be shown per page?
How many months of data should be shown before paginating?
<p>
<hr size="1">
@ -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' => {

View file

@ -30,7 +30,7 @@ use WebGUI::Utility;
my $configFile;
my $folderId;
my $folderId = '0';
my $help;
my $override;
my $pathToFiles;