Skip to content
Snippets Groups Projects
Commit 89b649e1 authored by Demian Katz's avatar Demian Katz
Browse files

Rolled back non-working feature (problems due to library limitations).

Revert "Add UserComments as an option for Captcha protection. Closes VUFIND-526."

This reverts commit dae50b11.
parent ff892e66
Branches
Tags
No related merge requests found
...@@ -1003,7 +1003,7 @@ era = true ; allow browsing of era subdivisions ...@@ -1003,7 +1003,7 @@ era = true ; allow browsing of era subdivisions
; <result_limit> most popular entries -- it only affects display order. ; <result_limit> most popular entries -- it only affects display order.
;alphabetical_order = true ;alphabetical_order = true
; This section controls the availability of export methods. ; This section controls the availability of export methods.
; ;
; Each entry may be a comma-separated list of contexts in which the export ; Each entry may be a comma-separated list of contexts in which the export
; option will be presented. Valid options: ; option will be presented. Valid options:
...@@ -1259,8 +1259,7 @@ treeSearchLimit = 100 ...@@ -1259,8 +1259,7 @@ treeSearchLimit = 100
;secretKey = "https://www.google.com/recaptcha/admin/create" ;secretKey = "https://www.google.com/recaptcha/admin/create"
; Valid theme values: dark, light ; Valid theme values: dark, light
;theme = light ;theme = light
; Valid forms values: changePassword, email, newAccount, ; Valid forms values: changePassword, email, newAccount, passwordRecovery, sms
; passwordRecovery, sms, UserComments
; Use * for all supported forms ; Use * for all supported forms
;forms = changePassword, email, newAccount, passwordRecovery, sms ;forms = changePassword, email, newAccount, passwordRecovery, sms
......
...@@ -113,12 +113,6 @@ class AbstractRecord extends AbstractBase ...@@ -113,12 +113,6 @@ class AbstractRecord extends AbstractBase
); );
} }
$captcha = $this->recaptcha()->active('UserComments');
if (!$this->formWasSubmitted('comment', $captcha)) {
$this->flashMessenger()->addMessage('recaptcha_not_passed', 'error');
return $this->redirectToRecord('', 'UserComments');
}
// Obtain the current record object: // Obtain the current record object:
$driver = $this->loadRecord(); $driver = $this->loadRecord();
......
...@@ -969,13 +969,6 @@ class AjaxController extends AbstractBase ...@@ -969,13 +969,6 @@ class AjaxController extends AbstractBase
$id = $this->params()->fromPost('id'); $id = $this->params()->fromPost('id');
$comment = $this->params()->fromPost('comment'); $comment = $this->params()->fromPost('comment');
$captcha = $this->recaptcha()->active('UserComments');
if (!$this->formWasSubmitted('comment', $captcha)) {
return $this->output(
$this->translate('recaptcha_not_passed'), self::STATUS_ERROR
);
}
if (empty($id) || empty($comment)) { if (empty($id) || empty($comment)) {
return $this->output( return $this->output(
$this->translate('An error has occurred'), self::STATUS_ERROR $this->translate('An error has occurred'), self::STATUS_ERROR
......
...@@ -17,15 +17,9 @@ ...@@ -17,15 +17,9 @@
<? $user = $this->auth()->isLoggedIn() ?> <? $user = $this->auth()->isLoggedIn() ?>
<? if($user): ?> <? if($user): ?>
<textarea id="comment" name="comment" class="form-control" rows="3" required></textarea><br/> <textarea id="comment" name="comment" class="form-control" rows="3" required></textarea><br/>
<? if ($this->recaptcha()->active('UserComments')): ?>
<?=$this->recaptcha()->html(true) ?><br/>
<? endif; ?>
<input class="btn btn-primary" data-loading-text="<?=$this->transEsc('Submitting') ?>..." type="submit" value="<?=$this->transEsc("Add your comment")?>"/> <input class="btn btn-primary" data-loading-text="<?=$this->transEsc('Submitting') ?>..." type="submit" value="<?=$this->transEsc("Add your comment")?>"/>
<? else: ?> <? else: ?>
<textarea id="comment" name="comment" class="form-control" rows="3" disabled></textarea><br/> <textarea id="comment" name="comment" class="form-control" rows="3" disabled></textarea><br/>
<? if ($this->recaptcha()->active('UserComments')): ?>
<?=$this->recaptcha()->html(true) ?><br/>
<? endif; ?>
<input onClick="Lightbox.get('MyResearch', 'UserLogin'); return false;" class="btn btn-primary" type="submit" value="<?=$this->transEsc("You must be logged in first")?>"/> <input onClick="Lightbox.get('MyResearch', 'UserLogin'); return false;" class="btn btn-primary" type="submit" value="<?=$this->transEsc("You must be logged in first")?>"/>
<? endif; ?> <? endif; ?>
</div> </div>
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment