From 22bae931f7ba5a3706b678b63dccee8b289fd58c Mon Sep 17 00:00:00 2001 From: Chaoyi Zha Date: Wed, 2 Mar 2016 16:57:14 -0500 Subject: [PATCH] Fix args check func, don't show register link if disabled under login --- app/Http/Controllers/Controller.php | 14 ++++++-------- resources/views/login.blade.php | 9 ++++++--- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/app/Http/Controllers/Controller.php b/app/Http/Controllers/Controller.php index 05f2b6e..8065876 100644 --- a/app/Http/Controllers/Controller.php +++ b/app/Http/Controllers/Controller.php @@ -2,7 +2,6 @@ namespace App\Http\Controllers; use Laravel\Lumen\Routing\Controller as BaseController; - use Illuminate\Http\Request; use App\Http\Controllers\Controller; @@ -29,14 +28,13 @@ class Controller extends BaseController { } protected static function checkRequiredArgs($required_args=[]) { - array_push($required_args, NULL); + foreach($required_args as $arg) { + if ($arg == NULL) { + return false; + } + } + return true; - if (count(array_unique($required_args)) < count($required_args)) { - return false; - } - else { - return true; - } } protected static function ensureAdmin() { diff --git a/resources/views/login.blade.php b/resources/views/login.blade.php index 0646259..e469b4e 100644 --- a/resources/views/login.blade.php +++ b/resources/views/login.blade.php @@ -14,9 +14,12 @@ -

- Don't have an account? Register -

+ + @if (env('POLR_ALLOW_ACCT_CREATION') == true) +

+ Don't have an account? Register +

+ @endif