merging 6.2.9 changes
This commit is contained in:
parent
1bb82bd7b9
commit
48caad2d74
42 changed files with 224 additions and 119 deletions
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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"});
|
||||
|
|
|
|||
|
|
@ -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}){
|
||||
|
|
|
|||
|
|
@ -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}){
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
|
|
@ -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};
|
||||
|
|
|
|||
|
|
@ -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}
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
|
|
@ -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}});
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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",
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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];
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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',
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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");
|
||||
|
|
|
|||
|
|
@ -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 "";
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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};
|
||||
|
|
|
|||
|
|
@ -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'});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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),
|
||||
|
|
|
|||
|
|
@ -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});
|
||||
|
|
|
|||
|
|
@ -388,7 +388,7 @@ sub getFileSize {
|
|||
$size = round($attributes[7]/1024);
|
||||
$size .= 'kB';
|
||||
} else {
|
||||
$size = $attributes[7]."B";
|
||||
$size = $attributes[7].'B';
|
||||
}
|
||||
return $size;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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});
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
});
|
||||
|
|
|
|||
|
|
@ -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}) {
|
||||
|
|
|
|||
|
|
@ -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' => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue