Changes to include captcha image on post to verify humanity

This commit is contained in:
Frank Dillon 2007-07-20 20:19:55 +00:00
parent 6e4276bb68
commit 01ff22d70f

View file

@ -241,6 +241,7 @@ sub appendTemplateLabels {
$var->{"user.label"} = $i18n->get("user");
$var->{"views.label"} = $i18n->get("views");
$var->{'visitorName.label'} = $i18n->get("visitor");
$var->{"captcha_label"} = $i18n->get("captcha label");
}
#-------------------------------------------------------------------
@ -716,7 +717,13 @@ sub definition {
label=>$i18n->get("default karma scale"),
hoverHelp=>$i18n->get('default karma scale help'),
},
useCaptcha => {
fieldType=>"yesNo",
defaultValue=>'0',
tab=>'security',
label=>$i18n->get('use captcha label'),
hoverHelp=>$i18n->get('use captcha hover help'),
},
subscriptionGroupId =>{
fieldType=>"subscriptionGroup",
tab=>'security',
@ -1272,6 +1279,35 @@ sub view {
#-------------------------------------------------------------------
=head2 www_editSave ( )
We're extending www_editSave() here to deal with editing a post that has been denied by the approval process. Our change will reassign the old working tag of this post to the user so that they can edit it.
=cut
sub www_editSave {
my $self = shift;
my $session = $self->session;
my $className = $session->form->param("class");
#my $assetId = $self->session->form->param("assetId");
if($className eq "WebGUI::Asset::Post::Thread") {
my $assetId = $session->form->param("assetId");
if($assetId eq "new" && $self->getValue("useCaptcha")) {
my $captcha = $self->session->form->process("captcha","Captcha");
unless ($captcha) {
return $self->www_add;
}
}
}
return $self->SUPER::www_editSave();
}
#-------------------------------------------------------------------
=head2 www_search ( )
The web method to display and use the forum search interface.