more bug fixes

This commit is contained in:
JT Smith 2006-01-13 19:51:51 +00:00
parent a6e5450b64
commit 3feda4d3f3
4 changed files with 18 additions and 18 deletions

View file

@ -1420,7 +1420,7 @@ sub www_add {
$self->session->errorHandler->security("tried to call an invalid class ".$class); $self->session->errorHandler->security("tried to call an invalid class ".$class);
return ""; return "";
} }
if ($self->session->form->process("'prototype'")) { if ($self->session->form->process('prototype')) {
my $prototype = WebGUI::Asset->new($self->session->form->process("prototype"),$class); my $prototype = WebGUI::Asset->new($self->session->form->process("prototype"),$class);
foreach my $definition (@{$prototype->definition($self->session)}) { # cycle through rather than copying properties to avoid grabbing stuff we shouldn't grab foreach my $definition (@{$prototype->definition($self->session)}) { # cycle through rather than copying properties to avoid grabbing stuff we shouldn't grab
foreach my $property (keys %{$definition->{properties}}) { foreach my $property (keys %{$definition->{properties}}) {

View file

@ -658,7 +658,7 @@ sub processPropertiesFromFormPost {
); );
$data{url} = $self->fixUrl($self->getThread->get("url")."/1") if ($self->isReply); $data{url} = $self->fixUrl($self->getThread->get("url")."/1") if ($self->isReply);
if ($self->getThread->getParent->canModerate) { if ($self->getThread->getParent->canModerate) {
$self->getThread->lock if ($self->session->form->process("'lock'")); $self->getThread->lock if ($self->session->form->process('lock'));
$self->getThread->stick if ($self->session->form->process("stick")); $self->getThread->stick if ($self->session->form->process("stick"));
} }
} }
@ -1001,7 +1001,7 @@ sub www_edit {
}); });
$var{'lock.form'} = WebGUI::Form::yesNo({ $var{'lock.form'} = WebGUI::Form::yesNo({
name=>'lock', name=>'lock',
value=>$self->session->form->process("'lock'") value=>$self->session->form->process('lock')
}); });
} }
$var{'subscribe.form'} = WebGUI::Form::yesNo({ $var{'subscribe.form'} = WebGUI::Form::yesNo({
@ -1034,7 +1034,7 @@ sub www_edit {
($var{'preview.synopsis'}, $var{'preview.content'}) = $self->getSynopsisAndContentFromFormPost; ($var{'preview.synopsis'}, $var{'preview.content'}) = $self->getSynopsisAndContentFromFormPost;
$var{'preview.content'} = $self->formatContent($var{'preview.content'},$self->session->form->process("contentType")); $var{'preview.content'} = $self->formatContent($var{'preview.content'},$self->session->form->process("contentType"));
for my $i (1..5) { for my $i (1..5) {
$var{'preview.userDefined'.$i} = WebGUI::HTML::filter($self->session->form->process("'userDefined'.$i"),"macros"); $var{'preview.userDefined'.$i} = WebGUI::HTML::filter($self->session->form->process('userDefined'.$i),"macros");
} }
} }
$var{'form.footer'} = WebGUI::Form::formFooter($self->session,); $var{'form.footer'} = WebGUI::Form::formFooter($self->session,);

View file

@ -232,7 +232,7 @@ sub view {
foreach my $input_name (keys %{$session{form}}) { foreach my $input_name (keys %{$session{form}}) {
next if ($input_name !~ /^HttpProxy_/); # Skip non proxied form var's next if ($input_name !~ /^HttpProxy_/); # Skip non proxied form var's
$input_name =~ s/^HttpProxy_//; $input_name =~ s/^HttpProxy_//;
$proxiedUrl=$self->session->url->append($proxiedUrl,"$input_name=$self->session->form->process("'HttpProxy_'.$input_name")"); $proxiedUrl=$self->session->url->append($proxiedUrl,"$input_name=".$self->session->form->process('HttpProxy_'.$input_name));
} }
} }
$request = HTTP::Request->new(GET => $proxiedUrl, $header) || return "wrong url"; # Create GET request $request = HTTP::Request->new(GET => $proxiedUrl, $header) || return "wrong url"; # Create GET request
@ -245,13 +245,13 @@ sub view {
next if ($input_name !~ /^HttpProxy_/); # Skip non proxied form var's next if ($input_name !~ /^HttpProxy_/); # Skip non proxied form var's
$input_name =~ s/^HttpProxy_//; $input_name =~ s/^HttpProxy_//;
my $uploadFile = $self->session->request->tmpFileName($self->session->form->process("'HttpProxy_'.$input_name")); my $uploadFile = $self->session->request->tmpFileName($self->session->form->process('HttpProxy_'.$input_name));
if(-r $uploadFile) { # Found uploaded file if(-r $uploadFile) { # Found uploaded file
@formUpload=($uploadFile, qq/$self->session->form->process("'HttpProxy_'.$input_name")/); @formUpload=($uploadFile, qq/$self->session->form->process('HttpProxy_'.$input_name)/);
$formdata{$input_name}=\@formUpload; $formdata{$input_name}=\@formUpload;
$contentType = 'form-data'; # Different Content Type header for file upload $contentType = 'form-data'; # Different Content Type header for file upload
} else { } else {
$formdata{$input_name}=qq/$self->session->form->process("'HttpProxy_'.$input_name")/; $formdata{$input_name}=qq/$self->session->form->process('HttpProxy_'.$input_name)/;
} }
} }
# Create POST request # Create POST request

View file

@ -44,7 +44,7 @@ sub _isValidLDAPUser {
$auth = $ldap->bind; $auth = $ldap->bind;
} }
if ($auth) { if ($auth) {
$search = $ldap->search ( base=>$uri->dn, filter=>$connection->{ldapIdentity}."=".$self->session->form->process("'authLDAP_ldapId'")); $search = $ldap->search ( base=>$uri->dn, filter=>$connection->{ldapIdentity}."=".$self->session->form->process('authLDAP_ldapId'));
if (defined $search->entry(0)) { if (defined $search->entry(0)) {
if ($connection->{ldapUserRDN} eq 'dn') { if ($connection->{ldapUserRDN} eq 'dn') {
$connectDN = $search->entry(0)->dn; $connectDN = $search->entry(0)->dn;
@ -53,10 +53,10 @@ sub _isValidLDAPUser {
} }
$ldap->unbind; $ldap->unbind;
$ldap = Net::LDAP->new($uri->host, (port=>$uri->port)) or $error .= $i18n->get(2,'AuthLDAP'); $ldap = Net::LDAP->new($uri->host, (port=>$uri->port)) or $error .= $i18n->get(2,'AuthLDAP');
$auth = $ldap->bind(dn=>$connectDN, password=>$self->session->form->process("'authLDAP_identifier'")); $auth = $ldap->bind(dn=>$connectDN, password=>$self->session->form->process('authLDAP_identifier'));
if ($auth->code == 48 || $auth->code == 49) { if ($auth->code == 48 || $auth->code == 49) {
$error .= '<li>'.$i18n->get(68).'</li>'; $error .= '<li>'.$i18n->get(68).'</li>';
$self->session->errorHandler->warn("Invalid LDAP information for registration of LDAP ID: ".$self->session->form->process("'authLDAP_ldapId'")); $self->session->errorHandler->warn("Invalid LDAP information for registration of LDAP ID: ".$self->session->form->process('authLDAP_ldapId'));
} elsif ($auth->code > 0) { } elsif ($auth->code > 0) {
$error .= '<li>LDAP error "'.$self->ldapStatusCode($auth->code).'" occured. '.$i18n->get(69).'</li>'; $error .= '<li>LDAP error "'.$self->ldapStatusCode($auth->code).'" occured. '.$i18n->get(69).'</li>';
$self->session->errorHandler->error("LDAP error: ".$self->ldapStatusCode($auth->code)); $self->session->errorHandler->error("LDAP error: ".$self->ldapStatusCode($auth->code));
@ -64,7 +64,7 @@ sub _isValidLDAPUser {
$ldap->unbind; $ldap->unbind;
} else { } else {
$error .= '<li>'.$i18n->get(68).'</li>'; $error .= '<li>'.$i18n->get(68).'</li>';
$self->session->errorHandler->warn("Invalid LDAP information for registration of LDAP ID: ".$self->session->form->process("'authLDAP_ldapId'")); $self->session->errorHandler->warn("Invalid LDAP information for registration of LDAP ID: ".$self->session->form->process("authLDAP_ldapId"));
} }
} else { } else {
$error = $i18n->get(2,'AuthLDAP'); $error = $i18n->get(2,'AuthLDAP');
@ -89,9 +89,9 @@ sub addUserForm {
my $self = shift; my $self = shift;
my $userData = $self->getParams; my $userData = $self->getParams;
my $connection = $self->{_connection}; my $connection = $self->{_connection};
my $ldapUrl = $self->session->form->process("'authLDAP_ldapUrl'} || $userData->{ldapUrl} || $connection->{ldapURL"); my $ldapUrl = $self->session->form->process('authLDAP_ldapUrl') || $userData->{ldapUrl} || $connection->{ldapURL};
my $connectDN = $self->session->form->process("'authLDAP_connectDN'} || $userData->{connectDN"); my $connectDN = $self->session->form->process('authLDAP_connectDN') || $userData->{connectDN};
my $ldapConnection = $self->session->form->process("'authLDAP_ldapConnection'} || $userData->{ldapConnection"); my $ldapConnection = $self->session->form->process('authLDAP_ldapConnection') || $userData->{ldapConnection};
my $ldapLinks = $self->session->db->buildHashRef("select ldapLinkId,ldapUrl from ldapLink"); my $ldapLinks = $self->session->db->buildHashRef("select ldapLinkId,ldapUrl from ldapLink");
my $f = WebGUI::HTMLForm->new($self->session); my $f = WebGUI::HTMLForm->new($self->session);
my $jscript = ""; my $jscript = "";
@ -144,9 +144,9 @@ sub addUserForm {
sub addUserFormSave { sub addUserFormSave {
my $self = shift; my $self = shift;
my $properties; my $properties;
$properties->{connectDN} = $self->session->form->process("'authLDAP_connectDN'"); $properties->{connectDN} = $self->session->form->process('authLDAP_connectDN');
$properties->{ldapUrl} = $self->session->form->process("'authLDAP_ldapUrl'"); $properties->{ldapUrl} = $self->session->form->process('authLDAP_ldapUrl');
$properties->{ldapConnection} = $self->session->form->process("'authLDAP_ldapConnection'"); $properties->{ldapConnection} = $self->session->form->process('authLDAP_ldapConnection');
$self->SUPER::addUserFormSave($properties); $self->SUPER::addUserFormSave($properties);
} }