mirror of
https://github.com/NNTmux/newznab-tmux.git
synced 2026-08-29 09:18:54 +00:00
Add config/captcha.php and use it in place of direct env file call
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
2018-11-05 DariusIII
|
||||
* Chg: Add config/captcha.php and use it in place of direct env file call
|
||||
* Chg: Update monolog/monolog to version 1.24.0
|
||||
* Chg: Update ProcessReleases class release tagging
|
||||
2018-11-04 DariusIII
|
||||
|
||||
@@ -48,7 +48,7 @@ class ForgotPasswordController extends Controller
|
||||
if (empty($email) && empty($rssToken)) {
|
||||
app('smarty.view')->assign('error', 'Missing parameter(email and/or apikey to send password reset');
|
||||
} else {
|
||||
if (env('NOCAPTCHA_ENABLED') === true && (! empty(env('NOCAPTCHA_SECRET')) && ! empty(env('NOCAPTCHA_SITEKEY')))) {
|
||||
if (config('captcha.enabled') === true && (! empty(config('captcha.secret')) && ! empty(config('captcha.sitekey')))) {
|
||||
$this->validate($request, [
|
||||
'g-recaptcha-response' => 'required|captcha',
|
||||
]);
|
||||
|
||||
@@ -66,7 +66,7 @@ class LoginController extends Controller
|
||||
}
|
||||
|
||||
if ($user !== null && ((env('FIREWALL_ENABLED') === true && \Firewall::isBlacklisted($user->host) === false) || env('FIREWALL_ENABLED') === false)) {
|
||||
if (env('NOCAPTCHA_ENABLED') === true && (! empty(env('NOCAPTCHA_SECRET')) && ! empty(env('NOCAPTCHA_SITEKEY')))) {
|
||||
if (config('captcha.enabled') === true && (! empty(config('captcha.secret')) && ! empty(config('captcha.sitekey')))) {
|
||||
$this->validate($request, [
|
||||
'g-recaptcha-response' => ['required', 'captcha'],
|
||||
]);
|
||||
|
||||
@@ -94,7 +94,7 @@ class RegisterController extends Controller
|
||||
'password' => ['required', 'string', 'min:8', 'confirmed', 'regex:/^(?=.*?[A-Z])(?=.*?[a-z])(?=.*?[0-9])(?=.*?[#?!@$%^&*-]).{8,}$/'],
|
||||
]);
|
||||
|
||||
if (env('NOCAPTCHA_ENABLED') === true && (! empty(env('NOCAPTCHA_SECRET')) && ! empty(env('NOCAPTCHA_SITEKEY')))) {
|
||||
if (config('captcha.enabled') === true && (! empty(config('captcha.secret')) && ! empty(config('captcha.sitekey')))) {
|
||||
$this->validate($request, [
|
||||
'g-recaptcha-response' => ['required', 'captcha'],
|
||||
]);
|
||||
|
||||
@@ -22,7 +22,7 @@ class ContactUsController extends BasePageController
|
||||
'username' => 'required',
|
||||
]);
|
||||
|
||||
if (env('NOCAPTCHA_ENABLED') === true && (! empty(env('NOCAPTCHA_SECRET')) && ! empty(env('NOCAPTCHA_SITEKEY')))) {
|
||||
if (config('captcha.enabled') === true && (! empty(config('captcha.secret')) && ! empty(config('captcha.sitekey')))) {
|
||||
$this->validate($request, [
|
||||
'g-recaptcha-response' => 'required|captcha',
|
||||
]);
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'secret' => env('NOCAPTCHA_SECRET', ''),
|
||||
'sitekey' => env('NOCAPTCHA_SITEKEY', ''),
|
||||
'enabled' => env('NOCAPTCHA_ENABLED', false),
|
||||
'options' => [
|
||||
'timeout' => 30,
|
||||
],
|
||||
];
|
||||
@@ -53,7 +53,7 @@
|
||||
<label for="comment" class="h6">Message</label>
|
||||
<textarea rows="7" name="comment" id="comment"
|
||||
class="form-control form-white"></textarea>
|
||||
{if {env('NOCAPTCHA_ENABLED')} == 1 && !empty({env('NOCAPTCHA_SITEKEY')}) && !empty({env('NOCAPTCHA_SECRET')})}
|
||||
{if {config('captcha.enabled')} == 1 && !empty({config('captcha.sitekey')}) && !empty({config('captcha.secret')})}
|
||||
{NoCaptcha::display()}{NoCaptcha::renderJs()}
|
||||
{/if}
|
||||
<button type="submit" class="btn btn-primary m-t-20">
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xs-6">
|
||||
{if {env('NOCAPTCHA_ENABLED')} == 1 && !empty({env('NOCAPTCHA_SITEKEY')}) && !empty({env('NOCAPTCHA_SECRET')})}
|
||||
{if {config('captcha.enabled')} == 1 && !empty({config('captcha.sitekey')}) && !empty({config('captcha.secret')})}
|
||||
{NoCaptcha::display()}{NoCaptcha::renderJs()}
|
||||
{/if}
|
||||
</div><!-- /.col -->
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
name="rememberme" type="checkbox"> Remember Me
|
||||
</label>
|
||||
<hr>
|
||||
{if {env('NOCAPTCHA_ENABLED')} == 1 && !empty({env('NOCAPTCHA_SITEKEY')}) && !empty({env('NOCAPTCHA_SECRET')})}
|
||||
{if {config('captcha.enabled')} == 1 && !empty({config('captcha.sitekey')}) && !empty({config('captcha.secret')})}
|
||||
{NoCaptcha::display()}{NoCaptcha::renderJs()}
|
||||
{/if}
|
||||
</div>
|
||||
|
||||
@@ -57,7 +57,7 @@
|
||||
</div><!-- /.col -->
|
||||
<hr>
|
||||
<div style="text-align: center;">
|
||||
{if {env('NOCAPTCHA_ENABLED')} == 1 && !empty({env('NOCAPTCHA_SITEKEY')}) && !empty({env('NOCAPTCHA_SECRET')})}
|
||||
{if {config('captcha.enabled')} == 1 && !empty({config('captcha.sitekey')}) && !empty({config('captcha.secret')})}
|
||||
{NoCaptcha::display()}{NoCaptcha::renderJs()}
|
||||
{/if}
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user