oodles of fixes.

This commit is contained in:
Matthew Wilson 2006-01-15 15:56:17 +00:00
parent 029dca1f2e
commit 65823b1f53
38 changed files with 87 additions and 84 deletions

View file

@ -142,6 +142,7 @@ sub processOperations {
# $session{form} = \%form;
# $output = processOperations($session,$opNumber);
# }
$session->http->getHeader;
return $output;
}
@ -150,6 +151,7 @@ sub processOperations {
sub setup {
my $session = shift;
require WebGUI::Operation::WebGUI;
$session->http->getHeader;
$session->request->print(WebGUI::Operation::WebGUI::www_setup($session));
}
@ -207,7 +209,8 @@ sub uploadsHandler {
#-------------------------------------------------------------------
sub upgrading {
my $session = shift;
$session->request->print($session->http->getHeader());
$session->http->getHeader;
$session->request->print($session->http->getHeader());
open(FILE,"<".$session->config->getWebguiRoot."/docs/maintenance.html");
while (<FILE>) {
$session->request->print($_);

View file

@ -73,7 +73,7 @@ sub _formatFunction {
'icon.small'=>$self->session->config->get("extrasURL")."/adminConsole/small/".$function->{icon},
url=>$url,
canUse=>$self->session->user->isInGroup($function->{group}),
isCurrentOpFunc=>($self->session->form->get("op") eq $function->{op} || $self->session->form->get("func") eq $function->{func})
isCurrentOpFunc=>($self->session->form->process("op") eq $function->{op} || $self->session->form->process("func") eq $function->{func})
};
}

View file

@ -52,12 +52,12 @@ sub grabReferral {
my $session = shift;
if ($session->user->userId ne "1" && $session->user->referringAffiliate) {
return "";
} elsif ($session->user->userId ne "1" && (($session->user->referringAffiliate eq "0" && $session->scratch->get("referringAffiliate")) || $session->form->get("affiliateId"))) {
} elsif ($session->user->userId ne "1" && (($session->user->referringAffiliate eq "0" && $session->scratch->process("referringAffiliate")) || $session->form->process("affiliateId"))) {
$session->user->referringAffiliate($session->scratch->get("referringAffiliate"));
} elsif ($session->user->userId ne "1") {
$session->user->referringAffiliate(1);
} elsif ($session->form->get("affiliateId") ne "") {
$session->scratch->set("referringAffiliate",$session->form->get("affiliateId"));
} elsif ($session->form->process("affiliateId") ne "") {
$session->scratch->set("referringAffiliate",$session->form->process("affiliateId"));
}
}

View file

@ -1399,7 +1399,7 @@ Returns "".
sub view {
my $self = shift;
WebGUI::HTTP::setRedirect($self->getDefault->getUrl) if ($self->getId eq "PBasset000000000000001");
$self->session->http->setRedirect($self->getDefault->getUrl) if ($self->getId eq "PBasset000000000000001");
return $self->getToolbar if ($self->session->var->get("adminOn"));
return undef;
}

View file

@ -297,7 +297,7 @@ sub www_view {
if ($self->session->var->get("adminOn")) {
return $self->getContainer->www_view;
}
WebGUI::HTTP::setRedirect($self->getFileUrl);
$self->session->http->setRedirect($self->getFileUrl);
return "";
}

View file

@ -292,7 +292,7 @@ sub www_view {
return $self->www_edit;
}
my $storage = $self->getStorageLocation;
WebGUI::HTTP::setRedirect($storage->getUrl($self->get("filename")));
$self->session->http->setRedirect($storage->getUrl($self->get("filename")));
return "";
}

View file

@ -303,10 +303,10 @@ Web facing method which is the default view page. This method does a
sub www_view {
my $self = shift;
return $self->session->privilege->noAccess() unless $self->canView;
if (WebGUI::Session::isAdminOn()) {
if ($self->session->var->isAdminOn) {
return $self->getContainer->www_view;
}
WebGUI::HTTP::setRedirect($self->getFileUrl($self->getValue("showPage")));
$self->session->http->setRedirect($self->getFileUrl($self->getValue("showPage")));
return "";
}

View file

@ -1136,7 +1136,7 @@ This is here to stop people from duplicating posts by hitting refresh in their b
sub www_redirectToParent {
my $self = shift;
WebGUI::HTTP::setRedirect($self->getParent->getUrl);
$self->session->http->setRedirect($self->getParent->getUrl);
}

View file

@ -213,7 +213,7 @@ sub definition {
#-------------------------------------------------------------------
sub discernUserId {
my $self = shift;
return ($self->canManage && WebGUI::Session::isAdminOn()) ? '1' : $self->session->user->profileField("userId");
return ($self->canManage && $self->session->var->isAdminOn) ? '1' : $self->session->user->profileField("userId");
}
#-------------------------------------------------------------------

View file

@ -175,7 +175,7 @@ A web accessible version of the view method.
sub www_view {
my $self = shift;
my $mimeType=$self->getValue('mimeType');
WebGUI::HTTP::setMimeType($mimeType || 'text/html');
$self->session->http->setMimeType($mimeType || 'text/html');
return $self->view(1);
}

View file

@ -324,7 +324,7 @@ sub processRaw {
#-------------------------------------------------------------------
sub view {
my $self = shift;
if (WebGUI::Session::isAdminOn()) {
if ($self->session->var->isAdminOn) {
return $self->getToolbar;
} else {
return "";
@ -345,7 +345,7 @@ sub www_edit {
#-------------------------------------------------------------------
sub www_goBackToPage {
my $self = shift;
WebGUI::HTTP::setRedirect($self->session->form->process("returnUrl")) if ($self->session->form->process("returnUrl"));
$self->session->http->setRedirect($self->session->form->process("returnUrl")) if ($self->session->form->process("returnUrl"));
return "";
}

View file

@ -577,18 +577,18 @@ sub www_view {
if ($self->get("state") eq "published") { # no privileges, make em log in
return $self->session->privilege->noAccess();
} elsif ($self->session->var->get("adminOn") && $self->get("state") =~ /^trash/) { # show em trash
WebGUI::HTTP::setRedirect($self->getUrl("func=manageTrash"));
$self->session->http->setRedirect($self->getUrl("func=manageTrash"));
return "";
} elsif ($self->session->var->get("adminOn") && $self->get("state") =~ /^clipboard/) { # show em clipboard
WebGUI::HTTP::setRedirect($self->getUrl("func=manageClipboard"));
$self->session->http->setRedirect($self->getUrl("func=manageClipboard"));
return "";
} else { # tell em it doesn't exist anymore
WebGUI::HTTP::setStatus("410");
$self->session->http->setStatus("410");
return WebGUI::Asset->getNotFound->www_view;
}
}
if ($self->get("encryptPage") && $self->session->env->get("HTTPS") ne "on") {
WebGUI::HTTP::setRedirect($self->getUrl);
$self->session->http->setRedirect($self->getUrl);
return "";
}
$self->logView();
@ -614,7 +614,7 @@ sub www_view {
} else {
$ttl = $self->get("cacheTimeout");
}
$cache->set($output, $ttl) if ($useCache && !WebGUI::HTTP::isRedirect());
$cache->set($output, $ttl) if ($useCache && !$self->session->http->isRedirect());
}
return $output;
}

View file

@ -1143,7 +1143,7 @@ sub www_viewRSS {
# Set some of the optional channel variables
$var{'generator'} = "WebGUI ".$WebGUI::VERSION;
$var{'lastBuildDate'} = _xml_encode(_get_rfc822_date($self->get("dateUpdated")));
$var{'webMaster'} = $WebGUI::Session::session{setting}{companyEmail};
$var{'webMaster'} = $self->session->setting->get("companyEmail");
$var{'docs'} = "http://blogs.law.harvard.edu/tech/rss";
my $sth = $self->session->db->read("select asset.assetId, asset.className, max(assetData.revisionDate)
@ -1186,7 +1186,7 @@ sub www_viewRSS {
last if ($i == $self->get("threadsPerPage"));
}
WebGUI::HTTP::setMimeType("text/xml");
$self->session->http->setMimeType("text/xml");
my $output = $self->processTemplate(\%var,$self->get("rssTemplateId"));
WebGUI::Macro::process($self->session,\$output);
return $output;

View file

@ -89,7 +89,7 @@ sub getContentPositions {
#-------------------------------------------------------------------
sub discernUserId {
my $self = shift;
return ($self->canManage && WebGUI::Session::isAdminOn()) ? '1' : $self->session->user->profileField("userId");
return ($self->canManage && $self->session->var->isAdminOn) ? '1' : $self->session->user->profileField("userId");
}
#-------------------------------------------------------------------
@ -153,7 +153,7 @@ sub initialize {
#-------------------------------------------------------------------
sub isManaging {
my $self = shift;
return 1 if ($self->canManage && WebGUI::Session::isAdminOn());
return 1 if ($self->canManage && $self->session->var->isAdminOn());
return 0;
}

View file

@ -966,7 +966,7 @@ sub www_editTabSave {
sub www_exportTab {
my $self = shift;
return $self->session->privilege->insufficient() unless $self->canEdit;
WebGUI::HTTP::setFilename($self->get("url").".tab","text/plain");
$self->session->http->setFilename($self->get("url").".tab","text/plain");
my %fields = $self->session->db->buildHash("select DataForm_fieldId,name from DataForm_field where
assetId=".$self->session->db->quote($self->getId)." order by sequenceNumber");
my @data;

View file

@ -333,7 +333,7 @@ sub view {
}
if($var{header} ne "text/html") {
WebGUI::HTTP::setMimeType($var{header});
$self->session->http->setMimeType($var{header});
return $var{content};
} else {
return $self->processTemplate(\%var,$self->get("templateId"));
@ -348,7 +348,7 @@ sub www_view {
my $output = $self->view;
return $self->session->privilege->noAccess() unless $self->canView;
# this is s a stop gap. we need to do something here that deals with the real www_view and caching, etc.
if (WebGUI::HTTP::getMimeType() ne "text/html") {
if ($self->session->http->getMimeType() ne "text/html") {
return $output;
} else {
return $self->processStyle($output);

View file

@ -436,7 +436,7 @@ The name of the index to open. Defaults to 'default'.
=head3 $dbh
Database handler to use. Defaults to $WebGUI::Session::session{dbh}.
Database handler to use. Defaults to $self->session->db.
=cut
@ -444,7 +444,7 @@ sub new {
my ($class, $indexName, $dbh) = @_;
$indexName = $indexName || 'default';
my $self = { _indexName => $indexName,
_dbh => $dbh || $WebGUI::Session::session{dbh},
_dbh => $dbh || $self->session->db,
_createOptions => {( backend => 'column',
word_length => 20,
filter => 'map { lc $_ if ($_ !~ /\^.*;/) }'

View file

@ -143,7 +143,7 @@ sub view {
my @positions = split(/\./,$self->get("contentPositions"));
my @hidden = split("\n",$self->get("assetsToHide"));
my $i = 1;
my $template= WebGUI::Asset->newByDynamicClass($self->get("templateId"))->get("template");
my $template= WebGUI::Asset->newByDynamicClass($self->session,$self->get("templateId"))->get("template");
my $numPositions = 1;
foreach my $j (2..15) {
$numPositions = $j if $template =~ m/position${j}\_loop/;

View file

@ -214,9 +214,9 @@ sub www_click {
incrementCounter($self->session->form->process("listingId"),"clicks");
my $listing = $self->session->db->getRow("Matrix_listing","listingId",$self->session->form->process("listingId"));
if ($self->session->form->process("m")) {
WebGUI::HTTP::setRedirect($listing->{manufacturerUrl});
$self->session->http->setRedirect($listing->{manufacturerUrl});
} else {
WebGUI::HTTP::setRedirect($listing->{productUrl});
$self->session->http->setRedirect($listing->{productUrl});
}
return "";
}

View file

@ -279,7 +279,7 @@ sub getToolbar {
my $self = shift;
if ($self->getToolbarState) {
my $returnUrl;
if (exists $self->session->asset) {
if ($self->session->asset) {
$returnUrl = ";proceed=goBackToPage;returnUrl=".$self->session->url->escape($self->session->asset->getUrl);
}
my $toolbar;
@ -305,16 +305,16 @@ sub view {
my $self = shift;
# we've got to determine what our start point is based upon user conditions
my $start;
$self->session->asset = WebGUI::Asset->newByUrl unless (exists $self->session->asset);
$self->session->asset = WebGUI::Asset->newByUrl($self->session) unless ($self->session->asset);
my $current = $self->session->asset;
if ($self->get("startType") eq "specificUrl") {
$start = WebGUI::Asset->newByUrl($self->get("startPoint"));
$start = WebGUI::Asset->newByUrl($self->session,$self->get("startPoint"));
} elsif ($self->get("startType") eq "relativeToRoot") {
unless (($self->get("startPoint")+1) >= $current->getLineageLength) {
$start = WebGUI::Asset->newByLineage(substr($current->get("lineage"),0, ($self->get("startPoint") + 1) * 6));
$start = WebGUI::Asset->newByLineage($self->session,substr($current->get("lineage"),0, ($self->get("startPoint") + 1) * 6));
}
} elsif ($self->get("startType") eq "relativeToCurrentUrl") {
$start = WebGUI::Asset->newByLineage(substr($current->get("lineage"),0, ($current->getLineageLength + $self->get("startPoint")) * 6));
$start = WebGUI::Asset->newByLineage($self->session,substr($current->get("lineage"),0, ($current->getLineageLength + $self->get("startPoint")) * 6));
}
$start = $current unless (defined $start); # if none of the above results in a start point, then the current page must be it
my @includedRelationships = split("\n",$self->get("assetsToInclude"));
@ -437,7 +437,7 @@ sub view {
#-------------------------------------------------------------------
sub www_goBackToPage {
my $self = shift;
WebGUI::HTTP::setRedirect($self->session->form->process("returnUrl")) if ($self->session->form->process("returnUrl"));
$self->session->http->setRedirect($self->session->form->process("returnUrl")) if ($self->session->form->process("returnUrl"));
return "";
}
@ -480,7 +480,7 @@ sub www_preview {
) . $nav->build . qq(</td></tr></table>);
# Because of the way the system is set up, the preview is cached. So let's remove it again...
WebGUI::Cache->new($self->session,$nav->{_identifier}."$session{page}{pageId}", "Navigation-".$self->session->config->getFilename)->delete;
WebGUI::Cache->new($self->session,$nav->{_identifier}.$self->session->asset->getId, "Navigation-".$self->session->config->getFilename)->delete;
return _submenu($output,"preview");
}

View file

@ -1091,14 +1091,14 @@ sub www_editSectionSave {
#-------------------------------------------------------------------
sub www_exportAnswers {
return "" unless ($self->session->user->isInGroup($_[0]->get("groupToViewReports")));
WebGUI::HTTP::setFilename($self->session->url->escape($_[0]->get("title")."_answers.tab"),"text/tab");
$self->session->http->setFilename($self->session->url->escape($_[0]->get("title")."_answers.tab"),"text/tab");
return $self->session->db->quickTab("select * from Survey_answer where Survey_id=".$self->session->db->quote($_[0]->get("Survey_id")));
}
#-------------------------------------------------------------------
sub www_exportComposite {
return "" unless ($self->session->user->isInGroup($_[0]->get("groupToViewReports")));
WebGUI::HTTP::setFilename($self->session->url->escape($_[0]->get("title")."_composite.tab"),"text/tab");
$self->session->http->setFilename($self->session->url->escape($_[0]->get("title")."_composite.tab"),"text/tab");
return $self->session->db->quickTab("select b.question, c.response, a.userId, a.username, a.ipAddress, c.comment, c.dateOfResponse from Survey_response a
left join Survey_questionResponse c on a.Survey_responseId=c.Survey_responseId
left join Survey_question b on c.Survey_questionId=b.Survey_questionId
@ -1108,14 +1108,14 @@ sub www_exportComposite {
#-------------------------------------------------------------------
sub www_exportQuestions {
return "" unless ($self->session->user->isInGroup($_[0]->get("groupToViewReports")));
WebGUI::HTTP::setFilename($self->session->url->escape($_[0]->get("title")."_questions.tab"),"text/tab");
$self->session->http->setFilename($self->session->url->escape($_[0]->get("title")."_questions.tab"),"text/tab");
return $self->session->db->quickTab("select * from Survey_question where Survey_id=".$self->session->db->quote($_[0]->get("Survey_id")));
}
#-------------------------------------------------------------------
sub www_exportResponses {
return "" unless ($self->session->user->isInGroup($_[0]->get("groupToViewReports")));
WebGUI::HTTP::setFilename($self->session->url->escape($_[0]->get("title")."_responses.tab"),"text/tab");
$self->session->http->setFilename($self->session->url->escape($_[0]->get("title")."_responses.tab"),"text/tab");
return $self->session->db->quickTab("select * from Survey_response where Survey_id=".$self->session->db->quote($_[0]->get("Survey_id")));
}

View file

@ -508,7 +508,7 @@ sub view {
if ($rssObject) {
$self->_constructRSS($rssObject,\%var);
my $rss=$rssObject->as_string;
WebGUI::HTTP::setMimeType('text/xml');
$self->session->http->setMimeType('text/xml');
#Looks like a kludge, but what this does is put in the proper
#XSLT stylesheet so the RSS doesn't look like total ass.

View file

@ -472,7 +472,7 @@ sub view {
if ($session{'config'}{'soapHttpHeaderOverride'} &&
$self->get("httpHeader")) {
WebGUI::HTTP::setMimeType($self->get("httpHeader"));
$self->session->http->setMimeType($self->get("httpHeader"));
$self->session->errorHandler->warn("changed mimetype: " . $session{'header'}{'mimetype'});
}
@ -481,7 +481,7 @@ sub view {
# to do it this way, but it certainly is the least obtrusive to default
# webgui flow. This feature currently requires a patched WebGUI.pm file.
if ($session{'form'}{'redirectURL'}) {
WebGUI::HTTP::setRedirect($session{'form'}{'redirectURL'});
$self->session->http->setRedirect($session{'form'}{'redirectURL'});
}
$var{'results'} = \@result;

View file

@ -360,7 +360,7 @@ sub getLineage {
if ($self->getId eq $id) { # possibly save ourselves a hit to the database
$asset = $self;
} else {
$asset = WebGUI::Asset->new($id, $class, $version);
$asset = WebGUI::Asset->new($self->session,$id, $class, $version);
}
} else {
$asset = $id;

View file

@ -387,7 +387,7 @@ sub displayLogin {
my $self = shift;
my $method = $_[0] || "login";
my $vars = $_[1];
unless ($self->session->form->get("op") eq "auth") {
unless ($self->session->form->process("op") eq "auth") {
$self->session->scratch->set("redirectAfterLogin",$self->session->url->page($self->session->env->get("QUERY_STRING")));
}
my $i18n = WebGUI::International->new($self->session);

View file

@ -234,8 +234,8 @@ sub createAccount {
#-------------------------------------------------------------------
sub createAccountSave {
my $self = shift;
my $username = $self->session->form->get('authLDAP_ldapId');
my $password = $self->session->form->get('authLDAP_identifier');
my $username = $self->session->form->process('authLDAP_ldapId');
my $password = $self->session->form->process('authLDAP_identifier');
my $error = "";
my $i18n = WebGUI::International->new($self->session);

View file

@ -125,11 +125,11 @@ sub addUserForm {
sub addUserFormSave {
my $self = shift;
my $properties;
unless ($self->session->form->get('authWebGUI.identifier') eq "password") {
$properties->{identifier} = Digest::MD5::md5_base64($self->session->form->get('authWebGUI.identifier'));
unless ($self->session->form->process('authWebGUI.identifier') eq "password") {
$properties->{identifier} = Digest::MD5::md5_base64($self->session->form->process('authWebGUI.identifier'));
}
$properties->{changeUsername} = $self->session->form->get('authWebGUI.changeUsername');
$properties->{changePassword} = $self->session->form->get('authWebGUI.changePassword');
$properties->{changeUsername} = $self->session->form->process('authWebGUI.changeUsername');
$properties->{changePassword} = $self->session->form->process('authWebGUI.changePassword');
$properties->{passwordTimeout} = $self->session->form->interval('authWebGUI.passwordTimeout');
$properties->{passwordLastUpdated} =$self->session->datetime->time();
if($self->session->setting->get("webguiExpirePasswordOnCreation")){
@ -196,15 +196,15 @@ sub createAccountSave {
return $self->displayAccount if ($self->session->user->profileField("userId") ne "1");
my $username = $self->session->form->get('authWebGUI.username');
my $password = $self->session->form->get('authWebGUI.identifier');
my $passConfirm = $self->session->form->get('authWebGUI.identifierConfirm');
my $username = $self->session->form->process('authWebGUI.username');
my $password = $self->session->form->process('authWebGUI.identifier');
my $passConfirm = $self->session->form->process('authWebGUI.identifierConfirm');
my $error;
my $i18n = WebGUI::International->new($self->session);
$error = $self->error unless($self->validUsername($username));
if ($self->session->setting->get("webguiUseCaptcha")) {
unless ($self->session->form->get('authWebGUI.captcha.validation') eq Digest::MD5::md5_base64(lc($self->session->form->get('authWebGUI.captcha')))) {
unless ($self->session->form->process('authWebGUI.captcha.validation') eq Digest::MD5::md5_base64(lc($self->session->form->process('authWebGUI.captcha')))) {
$error .= $i18n->get("captcha failure","AuthWebGUI");
}
}
@ -331,15 +331,15 @@ sub editUserFormSave {
my $self = shift;
my $properties;
my $userData = $self->getParams;
unless (!$self->session->form->get('authWebGUI.identifier') || $self->session->form->get('authWebGUI.identifier') eq "password") {
$properties->{identifier} = Digest::MD5::md5_base64($self->session->form->get('authWebGUI.identifier'));
unless (!$self->session->form->process('authWebGUI.identifier') || $self->session->form->process('authWebGUI.identifier') eq "password") {
$properties->{identifier} = Digest::MD5::md5_base64($self->session->form->process('authWebGUI.identifier'));
if($userData->{identifier} ne $properties->{identifier}){
$properties->{passwordLastUpdated} =$self->session->datetime->time();
}
}
$properties->{passwordTimeout} = $self->session->form->interval('authWebGUI.passwordTimeout');
$properties->{changeUsername} = $self->session->form->get('authWebGUI.changeUsername');
$properties->{changePassword} = $self->session->form->get('authWebGUI.changePassword');
$properties->{changeUsername} = $self->session->form->process('authWebGUI.changeUsername');
$properties->{changePassword} = $self->session->form->process('authWebGUI.changePassword');
$self->SUPER::editUserFormSave($properties);
}
@ -643,9 +643,9 @@ sub updateAccount {
my $self = shift;
my $i18n = WebGUI::International->new($self->session);
my $username = $self->session->form->get('authWebGUI.username');
my $password = $self->session->form->get('authWebGUI.identifier');
my $passConfirm = $self->session->form->get('authWebGUI.identifierConfirm');
my $username = $self->session->form->process('authWebGUI.username');
my $password = $self->session->form->process('authWebGUI.identifier');
my $passConfirm = $self->session->form->process('authWebGUI.identifierConfirm');
my $display = '<li>'.$i18n->get(81).'</li>';
my $error = "";

View file

@ -126,7 +126,7 @@ sub process {
next if ($searchString =~ /^\-$/); # don't process ^-;
if ($params ne "") {
$params =~ s/(^\(|\)$)//g; # remove parenthesis
&process(\$params); # recursive process params
&process($session,\$params); # recursive process params
}
my $macros = $session->config->get("macros");
if ($macros->{$searchString} ne "") {

View file

@ -36,7 +36,7 @@ The complete path to a file in the local filesystem.
#-------------------------------------------------------------------
sub process {
my $self = shift;
my $session = shift;
my (@param, $temp, $file);
@param = @_;
my $i18n = WebGUI::International->new($session,'Macro_Include');

View file

@ -17,7 +17,7 @@ use WebGUI::Asset::Template;
=head1 NAME
Package WebGUI::Macro::AOIHits
Package WebGUI::Macro::L_loginBox
=head1 DESCRIPTION
@ -61,7 +61,7 @@ The ID of a template for custom layout of the login box and text.
=cut
sub process {
my $self = shift;
my $session = shift;
my @param = @_;
my $templateId = $param[2] || "PBtmpl0000000000000044";
my %var;
@ -84,27 +84,27 @@ sub process {
$action =~ s/http:/https:/;
}
$var{'form.header'} = WebGUI::Form::formHeader($session,{action=>$action})
.WebGUI::Form::hidden({
.WebGUI::Form::hidden($session,{
name=>"op",
value=>"auth"
})
.WebGUI::Form::hidden({
.WebGUI::Form::hidden($session,{
name=>"method",
value=>"login"
});
$var{'username.label'} = $i18n->get(50, 'WebGUI');
$var{'username.form'} = WebGUI::Form::text({
$var{'username.form'} = WebGUI::Form::text($session,{
name=>"username",
size=>$boxSize,
extras=>'class="loginBoxField"'
});
$var{'password.label'} = $i18n->get(51, 'WebGUI');
$var{'password.form'} = WebGUI::Form::password({
$var{'password.form'} = WebGUI::Form::password($session,{
name=>"identifier",
size=>$boxSize,
extras=>'class="loginBoxField"'
});
$var{'form.login'} = WebGUI::Form::submit({
$var{'form.login'} = WebGUI::Form::submit($session,{
value=>$i18n->get(52, 'WebGUI'),
extras=>'class="loginBoxButton"'
});

View file

@ -30,7 +30,7 @@ no asset cached in the session variable, nothing is returned.
#-------------------------------------------------------------------
sub process {
my $self = shift;
my $session = shift;
if ($session->asset) {
if ($session->form->process("op") || $session->form->process("func")) {
return '<a href="'.$session->asset->getUrl.'">'.$session->asset->get("title").'</a>';

View file

@ -223,7 +223,7 @@ sub www_checkoutSubmit {
# Check if shoppingcart contains any items. If not the user probably clicked reload, so we redirect to the current page.
unless (@$normal || @$recurring) {
WebGUI::HTTP::setRedirect($session->url->page);
$session->http->setRedirect($session->url->page);
return '';
}

View file

@ -201,7 +201,7 @@ sub www_editLDAPLinkSave {
$properties->{ldapLoginTemplate} = $session->form->template("ldapLoginTemplate");
$session->db->setRow("ldapLink","ldapLinkId",$properties);
if($session->form->process("returnUrl")) {
WebGUI::HTTP::setRedirect($session->form->process("returnUrl"));
$session->http->setRedirect($session->form->process("returnUrl"));
}
return www_listLDAPLinks();
}

View file

@ -417,7 +417,7 @@ sub www_purchaseSubscription {
my $session = shift;
WebGUI::Commerce::ShoppingCart->new($session)->add($session->form->process("sid"), 'Subscription');
return WebGUI::HTTP::setRedirect($session->url->page('op=checkout'));
return $session->http->setRedirect($session->url->page('op=checkout'));
}
#-------------------------------------------------------------------

View file

@ -81,7 +81,6 @@ These methods are available from this package:
=cut
#-------------------------------------------------------------------
=head2 asset ( [ asset ] )

View file

@ -174,6 +174,7 @@ sub error {
my $self = shift;
my $message = shift;
$self->getLogger->error($message);
print("\n\n".$message.":\n".$self->getStackTrace());
$self->getLogger->debug("Stack trace for ERROR ".$message."\n".$self->getStackTrace());
$self->session->stow->set("debug_error", $self->session->stow->get("debug_error").$message."\n");
}

View file

@ -103,7 +103,7 @@ sub generateAdditionalHeadTags {
$tags .= ' />'."\n";
}
# append extraHeadTags
$tags .= $self->session->asset->getExtraHeadTags."\n" if ($self->session->asset);
# $tags .= $self->session->asset->getExtraHeadTags."\n" if ($self->session->asset);
delete $self->{_meta};
delete $self->{_raw};
delete $self->{_javascript};
@ -205,16 +205,16 @@ if ($self->session->user->isInGroup(2)) {
';
}
$var{'head.tags'} .= "\n<!-- macro head tags -->\n";
my $style = WebGUI::Asset::Template->new($templateId);
my $style = WebGUI::Asset::Template->new($self->session,$templateId);
my $output;
if (defined $style) {
$output = $style->process(\%var);
} else {
$output = "WebGUI was unable to instantiate your style template.".$var{'body.content'};
}
WebGUI::Macro::process(\$output);
WebGUI::Macro::process($self->session,\$output);
my $macroHeadTags = generateAdditionalHeadTags();
WebGUI::Macro::process(\$macroHeadTags);
WebGUI::Macro::process($self->session,\$macroHeadTags);
$output =~ s/\<\!-- macro head tags --\>/$macroHeadTags/;
if ($self->session->errorHandler->canShowDebug()) {
$output .= $self->session->errorHandler->showDebug();

View file

@ -194,7 +194,7 @@ sub addFileFromFormPost {
my $self = shift;
my $formVariableName = shift;
my $attachmentLimit = shift || 99999;
return "" if (WebGUI::HTTP::getStatus() =~ /^413/);
return "" if ($self->session->http->getStatus() =~ /^413/);
my $filename;
my $attachmentCount = 1;
foreach my $upload ($self->session->request->upload($formVariableName)) {