1
0
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:
Chaoyi Zha 2016-03-02 16:57:14 -05:00
parent 69b8e7eb2d
commit 22bae931f7
2 changed files with 12 additions and 11 deletions

View File

@ -2,7 +2,6 @@
namespace App\Http\Controllers; namespace App\Http\Controllers;
use Laravel\Lumen\Routing\Controller as BaseController; use Laravel\Lumen\Routing\Controller as BaseController;
use Illuminate\Http\Request; use Illuminate\Http\Request;
use App\Http\Controllers\Controller; use App\Http\Controllers\Controller;
@ -29,14 +28,13 @@ class Controller extends BaseController {
} }
protected static function checkRequiredArgs($required_args=[]) { 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() { protected static function ensureAdmin() {

View File

@ -14,9 +14,12 @@
<input type="password" placeholder="password" name="password" class="form-control login-field" /> <input type="password" placeholder="password" name="password" class="form-control login-field" />
<input type="hidden" name='_token' value='{{csrf_token()}}' /> <input type="hidden" name='_token' value='{{csrf_token()}}' />
<input type="submit" value="Login" class="login-submit btn btn-success" /> <input type="submit" value="Login" class="login-submit btn btn-success" />
<p class='signup-prompt'>
<small>Don't have an account? <a href='{{route('signup')}}'>Register</a></small> @if (env('POLR_ALLOW_ACCT_CREATION') == true)
</p> <p class='signup-prompt'>
<small>Don't have an account? <a href='{{route('signup')}}'>Register</a></small>
</p>
@endif
</form> </form>
</div> </div>
<div class="col-md-3"></div> <div class="col-md-3"></div>