Changes to include captcha image on post to verify humanity
This commit is contained in:
parent
6e4276bb68
commit
01ff22d70f
1 changed files with 37 additions and 1 deletions
|
|
@ -241,6 +241,7 @@ sub appendTemplateLabels {
|
||||||
$var->{"user.label"} = $i18n->get("user");
|
$var->{"user.label"} = $i18n->get("user");
|
||||||
$var->{"views.label"} = $i18n->get("views");
|
$var->{"views.label"} = $i18n->get("views");
|
||||||
$var->{'visitorName.label'} = $i18n->get("visitor");
|
$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"),
|
label=>$i18n->get("default karma scale"),
|
||||||
hoverHelp=>$i18n->get('default karma scale help'),
|
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 =>{
|
subscriptionGroupId =>{
|
||||||
fieldType=>"subscriptionGroup",
|
fieldType=>"subscriptionGroup",
|
||||||
tab=>'security',
|
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 ( )
|
=head2 www_search ( )
|
||||||
|
|
||||||
The web method to display and use the forum search interface.
|
The web method to display and use the forum search interface.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue