mirror of
https://github.com/cydrobolt/polr.git
synced 2024-11-09 19:52:28 +01:00
Fix args check func, don't show register link if disabled under login
This commit is contained in:
parent
69b8e7eb2d
commit
22bae931f7
@ -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);
|
||||
|
||||
if (count(array_unique($required_args)) < count($required_args)) {
|
||||
foreach($required_args as $arg) {
|
||||
if ($arg == NULL) {
|
||||
return false;
|
||||
}
|
||||
else {
|
||||
return true;
|
||||
}
|
||||
return true;
|
||||
|
||||
}
|
||||
|
||||
protected static function ensureAdmin() {
|
||||
|
@ -14,9 +14,12 @@
|
||||
<input type="password" placeholder="password" name="password" class="form-control login-field" />
|
||||
<input type="hidden" name='_token' value='{{csrf_token()}}' />
|
||||
<input type="submit" value="Login" class="login-submit btn btn-success" />
|
||||
|
||||
@if (env('POLR_ALLOW_ACCT_CREATION') == true)
|
||||
<p class='signup-prompt'>
|
||||
<small>Don't have an account? <a href='{{route('signup')}}'>Register</a></small>
|
||||
</p>
|
||||
@endif
|
||||
</form>
|
||||
</div>
|
||||
<div class="col-md-3"></div>
|
||||
|
Loading…
Reference in New Issue
Block a user