Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
8 changed files
with
89 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
src/MicroweberPackages/Utils/Captcha/Listeners/NewCommentListener.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?php | ||
|
||
namespace MicroweberPackages\Utils\Captcha\Listeners; | ||
|
||
|
||
use Illuminate\Contracts\Queue\ShouldQueue; | ||
use Illuminate\Queue\InteractsWithQueue; | ||
|
||
class NewCommentListener | ||
{ | ||
|
||
/** | ||
* Handle the event. | ||
* | ||
* @param object $event | ||
* @return void | ||
*/ | ||
public function handle($event) | ||
{ | ||
// reset the captcha | ||
app()->captcha_manager->reset(); | ||
} | ||
} |
28 changes: 28 additions & 0 deletions
28
src/MicroweberPackages/Utils/Captcha/Providers/CaptchaEventServiceProvider.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?php | ||
/* | ||
* This file is part of the Microweber framework. | ||
* | ||
* (c) Microweber CMS LTD | ||
* | ||
* For full license information see | ||
* https://github.com/microweber/microweber/blob/master/LICENSE | ||
* | ||
*/ | ||
|
||
namespace MicroweberPackages\Utils\Captcha\Providers; | ||
|
||
|
||
use MicroweberPackages\App\Providers\EventServiceProvider; | ||
use MicroweberPackages\Comment\Events\NewComment; | ||
use MicroweberPackages\Utils\Captcha\Listeners\NewCommentListener; | ||
|
||
class CaptchaEventServiceProvider extends EventServiceProvider | ||
{ | ||
|
||
protected $listen = [ | ||
NewComment::class => [ | ||
NewCommentListener::class | ||
], | ||
]; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters