more bugfixes. last of this round of syntaxCheck.t fixes.
This commit is contained in:
parent
9b867ab627
commit
f8de599f35
11 changed files with 40 additions and 31 deletions
|
|
@ -125,11 +125,11 @@ sub definition {
|
|||
dateSubmitted => {
|
||||
noFormPost=>1,
|
||||
fieldType=>"hidden",
|
||||
defaultValue=$session->datetime->time()
|
||||
defaultValue=>$session->datetime->time()
|
||||
},
|
||||
dateUpdated => {
|
||||
fieldType=>"hidden",
|
||||
defaultValue=$session->datetime->time()
|
||||
defaultValue=>$session->datetime->time()
|
||||
},
|
||||
username => {
|
||||
fieldType=>"hidden",
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@ package WebGUI::Asset::Post::Thread;
|
|||
use strict;
|
||||
use WebGUI::Asset::Template;
|
||||
use WebGUI::Asset::Post;
|
||||
use WebGUI::Group;
|
||||
use WebGUI::International;
|
||||
use WebGUI::MessageLog;
|
||||
use WebGUI::Paginator;
|
||||
|
|
@ -66,8 +67,9 @@ sub decrementReplies {
|
|||
#-------------------------------------------------------------------
|
||||
sub definition {
|
||||
my $class = shift;
|
||||
my $definition = shift;
|
||||
my $i18n = WebGUI::International->new($self->session,"Asset_Thread");
|
||||
my $session = shift;
|
||||
my $definition = shift;
|
||||
my $i18n = WebGUI::International->new($session,"Asset_Thread");
|
||||
push(@{$definition}, {
|
||||
assetName=>$i18n->get('assetName'),
|
||||
icon=>'thread.gif',
|
||||
|
|
@ -104,7 +106,7 @@ sub definition {
|
|||
}
|
||||
},
|
||||
});
|
||||
return $class->SUPER::definition($definition);
|
||||
return $class->SUPER::definition($session,$definition);
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
|
@ -146,7 +148,7 @@ A string indicating the type of layout to use. Can be flat or nested.
|
|||
sub getLayoutUrl {
|
||||
my $self = shift;
|
||||
my $layout = shift;
|
||||
return $self->session->asset->getUrl("layout=".$layout.'#id'.$self->session->asset->getId) if (exists $self->session->asset);
|
||||
return $self->session->asset->getUrl("layout=".$layout.'#id'.$self->session->asset->getId) if ($self->session->asset);
|
||||
return $self->getUrl("layout=".$layout);
|
||||
}
|
||||
|
||||
|
|
@ -547,7 +549,8 @@ sub subscribe {
|
|||
my $self = shift;
|
||||
$self->createSubscriptionGroup;
|
||||
WebGUI::Cache->new($self->session,"cspost_".$self->getId."_".$self->session->user->userId."_".$self->session->scratch->get("discussionLayout")."_".$self->session->form->process("pn"))->delete;
|
||||
$group->addUsers([$self->session->user->userId],[$self->get("subscriptionGroupId")]);
|
||||
my $group = WebGUI::Group->new($self->session,$self->get("subscriptionGroupId"));
|
||||
$group->addUsers([$self->session->user->userId]);
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
|
@ -607,7 +610,8 @@ Negates the subscribe method.
|
|||
sub unsubscribe {
|
||||
my $self = shift;
|
||||
WebGUI::Cache->new($self->session,"cspost_".$self->getId."_".$self->session->user->userId."_".$self->session->scratch->get("discussionLayout")."_".$self->session->form->process("pn"))->delete;
|
||||
$group->deleteUsers([$self->session->user->userId],[$self->get("subscriptionGroupId")]);
|
||||
my $group = WebGUI::Group->new($self->session,$self->get("subscriptionGroupId"));
|
||||
$group->deleteUsers([$self->session->user->userId]);
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -664,7 +668,7 @@ sub view {
|
|||
} else {
|
||||
$sql .= "asset.lineage";
|
||||
}
|
||||
my $currentPageUrl = $session{requestedUrl};
|
||||
my $currentPageUrl = $self->session->url->requestedUrl;
|
||||
$p->setDataByQuery($sql, undef, undef, undef, "url", $currentPageUrl);
|
||||
foreach my $dataSet (@{$p->getPageData()}) {
|
||||
next unless ($dataSet->{className} eq "WebGUI::Asset::Post" || $dataSet->{className} eq "WebGUI::Asset::Post::Thread"); #handle non posts!
|
||||
|
|
|
|||
|
|
@ -575,8 +575,8 @@ sub processPropertiesFromFormPost {
|
|||
});
|
||||
}
|
||||
if ($self->session->form->process("fid") eq "new") { # hack to get proceed to work.
|
||||
$session{whatNext} = $self->session->form->process("proceed");
|
||||
} else { $session{whatNext} = "nothing"; }
|
||||
$session->stow->set('whatNext',$self->session->form->process("proceed"));
|
||||
} else { $session->stow->set('whatNext','nothing'); }
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
|
@ -734,6 +734,7 @@ sub www_deleteTabConfirm {
|
|||
#-------------------------------------------------------------------
|
||||
sub www_editField {
|
||||
my $self = shift;
|
||||
my $fid = shift || $self->session->form->process("fid") || 'new';
|
||||
return $self->session->privilege->insufficient() unless $self->canEdit;
|
||||
my $i18n = WebGUI::International->new($self->session,"Asset_DataForm");
|
||||
my (%field, $f, %fieldStatus,$tab);
|
||||
|
|
@ -745,7 +746,6 @@ sub www_editField {
|
|||
"editable" => $i18n->get(6),
|
||||
"required" => $i18n->get(75)
|
||||
);
|
||||
$self->session->form->process("fid") = "new" if ($self->session->form->process("fid") eq "");
|
||||
unless ($self->session->form->process("fid") eq "new") {
|
||||
%field = $self->session->db->quickHash("select * from DataForm_field where DataForm_fieldId=".$self->session->db->quote($self->session->form->process("fid")));
|
||||
}
|
||||
|
|
@ -891,9 +891,8 @@ sub www_editFieldSave {
|
|||
" where DataForm_fieldId=".$self->session->db->quote($self->session->form->process("fid")));
|
||||
}
|
||||
$self->reorderCollateral("DataForm_field","DataForm_fieldId", _tonull("DataForm_tabId",$self->session->form->process("tid"))) if ($self->session->form->process("fid") ne "new");
|
||||
if ($session{whatNext} eq "editField" || $self->session->form->process("proceed") eq "editField") {
|
||||
$self->session->form->process("fid") = "new";
|
||||
return $self->www_editField;
|
||||
if ($self->session->stow->get('whatNext') eq "editField" || $self->session->form->process("proceed") eq "editField") {
|
||||
return $self->www_editField('new');
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -992,6 +992,7 @@ sub www_editQuestion {
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
sub www_editQuestionSave {
|
||||
my $self = shift;
|
||||
return $self->session->privilege->insufficient() unless ($_[0]->canEdit);
|
||||
|
||||
$self->session->form->process("qid") = $_[0]->setCollateral("Survey_question", "Survey_questionId", {
|
||||
|
|
|
|||
|
|
@ -619,6 +619,13 @@ sub new {
|
|||
my $self = {};
|
||||
my $class = shift;
|
||||
$self->{_session} = shift;
|
||||
my $output;
|
||||
my $i = 1;
|
||||
while (my @data = caller($i)) {
|
||||
$output .= "\t".join(",",@data)."\n";
|
||||
$i++;
|
||||
}
|
||||
print $output."\n\n";
|
||||
$self->{authMethod} = shift;
|
||||
my $userId = shift || $self->{_session}->user->userId;
|
||||
$self->{user} = $self->{_session}->user;
|
||||
|
|
|
|||
|
|
@ -59,13 +59,14 @@ sub _isValidPassword {
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 addUserForm ( )
|
||||
=head2 _logSecurityMessage ( )
|
||||
|
||||
Creates user form elements specific to this Auth Method.
|
||||
Logs the successful password change message.
|
||||
|
||||
=cut
|
||||
|
||||
sub _logSecurityMessage {
|
||||
my $self = shift;
|
||||
$self->session->errorHandler->security("change password. Password changed successfully");
|
||||
}
|
||||
|
||||
|
|
@ -551,7 +552,7 @@ sub recoverPasswordFinish {
|
|||
}
|
||||
$encryptedPassword = Digest::MD5::md5_base64($password);
|
||||
$self->saveParams($userId,"WebGUI",{identifier=>$encryptedPassword});
|
||||
_logSecurityMessage();
|
||||
$self->_logSecurityMessage();
|
||||
$self->session->errorHandler->security("recover a password. Password emailed to: ".$self->session->form->process("email"));
|
||||
$message = $self->session->setting->get("webguiRecoverPasswordEmail");
|
||||
$message .= "\n".$i18n->get(50).": ".$username."\n";
|
||||
|
|
@ -610,7 +611,7 @@ sub resetExpiredPasswordSave {
|
|||
$properties->{passwordLastUpdated} =$self->session->datetime->time();
|
||||
|
||||
$self->saveParams($u->userId,$self->authMethod,$properties);
|
||||
_logSecurityMessage();
|
||||
$self->_logSecurityMessage();
|
||||
|
||||
$msg = $self->login;
|
||||
if($msg eq ""){
|
||||
|
|
@ -684,7 +685,7 @@ sub updateAccount {
|
|||
my $userData = $self->getParams;
|
||||
unless ($password eq "password") {
|
||||
$properties->{identifier} = Digest::MD5::md5_base64($password);
|
||||
_logSecurityMessage();
|
||||
$self->_logSecurityMessage();
|
||||
if($userData->{identifier} ne $properties->{identifier}){
|
||||
$properties->{passwordLastUpdated} =$self->session->datetime->time();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -69,7 +69,7 @@ sub toHtml {
|
|||
my $self = shift;
|
||||
my $value = $self->fixQuotes($self->get("value"));
|
||||
my $i18n = WebGUI::International->new($self->session);
|
||||
$self->{_params}{extras}; ||= 'onclick="this.value=\''.$i18n->get(452).'\'"';
|
||||
$self->{_params}{extras} ||= 'onclick="this.value=\''.$i18n->get(452).'\'"';
|
||||
my $html = '<input type="submit" ';
|
||||
$html .= 'name="'.$self->get("name").'" ' if ($self->get("name"));
|
||||
$html .= 'id="'.$self->get('id').'" ' unless ($self->get('id') eq "_formId");
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ A template from the Macro/EditableToggle namespace to use for formatting the lin
|
|||
#-------------------------------------------------------------------
|
||||
sub process {
|
||||
my $session = shift;
|
||||
if (exists $session->asset && $session->asset->canEdit && $session->user->isInGroup(12)) {
|
||||
if ($session->asset && $session->asset->canEdit && $session->user->isInGroup(12)) {
|
||||
my %var;
|
||||
my @param = @_;
|
||||
my $i18n = WebGUI::International->new($session,'Macro_EditableToggle');
|
||||
|
|
|
|||
|
|
@ -45,6 +45,7 @@ The ID of a template for custom layout of the link and text.
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
sub process {
|
||||
my $session = shift;
|
||||
my @param = @_;
|
||||
my $i18n = WebGUI::International->new($session,'Macro_LoginToggle');
|
||||
my $login = $param[0] || $i18n->get(716);
|
||||
|
|
@ -60,9 +61,9 @@ sub process {
|
|||
$var{'toggle.text'} = $logout;
|
||||
}
|
||||
if ($param[2]) {
|
||||
return WebGUI::Asset::Template->newByUrl($param[2])->process(\%var);
|
||||
return WebGUI::Asset::Template->newByUrl($session,$param[2])->process(\%var);
|
||||
} else {
|
||||
return WebGUI::Asset::Template->new("PBtmpl0000000000000043")->process(\%var);
|
||||
return WebGUI::Asset::Template->new($session,"PBtmpl0000000000000043")->process(\%var);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ sub process {
|
|||
|
||||
return $i18n->get('cannot find product') unless ($productId);
|
||||
|
||||
$product = WebGUI::Product->new($self->session,$productId);
|
||||
$product = WebGUI::Product->new($session,$productId);
|
||||
|
||||
if ($variantId) {
|
||||
$variant = [ $product->getVariant($variantId) ];
|
||||
|
|
@ -75,7 +75,7 @@ sub process {
|
|||
$var{'variants.message'} = $i18n->get('available product configurations');
|
||||
$templateId = $_[1] || $product->get('templateId');
|
||||
|
||||
return WebGUI::Asset::Template->new($ssession,$templateId)->process(\%var);
|
||||
return WebGUI::Asset::Template->new($session,$templateId)->process(\%var);
|
||||
}
|
||||
|
||||
1;
|
||||
|
|
|
|||
|
|
@ -70,9 +70,7 @@ Whatever message you wish to insert into the log.
|
|||
sub audit {
|
||||
my $self = shift;
|
||||
my $message = shift;
|
||||
$Log::Log4perl::caller_depth++;
|
||||
$self->info($self->session->user->username." (".$self->session->user->userId.") ".$message);
|
||||
$Log::Log4perl::caller_depth--;
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -152,7 +150,7 @@ Deconstructor.
|
|||
|
||||
sub DESTROY {
|
||||
my $self = shift;
|
||||
$Log::Log4perl::caller_depth++;
|
||||
$Log::Log4perl::caller_depth--;
|
||||
undef $self;
|
||||
}
|
||||
|
||||
|
|
@ -342,10 +340,8 @@ The message you wish to add to the log.
|
|||
sub security {
|
||||
my $self = shift;
|
||||
my $message = shift;
|
||||
$Log::Log4perl::caller_depth++;
|
||||
$self->warn($self->session->user->username." (".$self->session->user->userId.") connecting from "
|
||||
.$self->session->env("REMOTE_ADDR")." attempted to ".$message);
|
||||
$log::Log4perl::caller_depth--;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue