template type was not checked enough

This commit is contained in:
Lucas Bartholemy 2006-06-06 16:50:17 +00:00
parent dd5c862246
commit 466abf8da9
2 changed files with 18 additions and 4 deletions

View file

@ -1,4 +1,5 @@
6.99.4 6.99.4
- fix: better checking of selected template type
- fix: SQLForm - added missing privilege check - fix: SQLForm - added missing privilege check
- fix: typo in spectre - fix: typo in spectre
- fixed a bug where a user could transfer a negative amount of karma to a - fixed a bug where a user could transfer a negative amount of karma to a

View file

@ -82,6 +82,7 @@ sub definition {
defaultValue=>1 defaultValue=>1
}, },
parser=>{ parser=>{
noFormPost=>1,
fieldType=>'selectList', fieldType=>'selectList',
defaultValue=>[$session->config->get("defaultTemplateParser")] defaultValue=>[$session->config->get("defaultTemplateParser")]
}, },
@ -98,6 +99,21 @@ sub definition {
return $class->SUPER::definition($session,$definition); return $class->SUPER::definition($session,$definition);
} }
#-------------------------------------------------------------------
sub processPropertiesFromFormPost {
my $self = shift;
$self->SUPER::processPropertiesFromFormPost;
if ($self->getValue("parser") ne $self->session->form->process("parser","className") && ($self->session->form->process("parser","className") ne "")) {
my %data;
if (isIn($self->session->form->process("parser","className"),@{$self->session->config->get("templateParsers")})) {
%data = ( parser => $self->session->form->process("parser","className") );
} else {
%data = ( parser => $self->session->config->get("defaultTemplateParser") );
}
$self->update(\%data);
}
}
#------------------------------------------------------------------- #-------------------------------------------------------------------
@ -173,9 +189,6 @@ sub getEditForm {
} }
#------------------------------------------------------------------- #-------------------------------------------------------------------
=head2 getList ( session, namespace ) =head2 getList ( session, namespace )