No Registration if there are leagues present

This commit is contained in:
Torsten 2017-11-21 10:03:17 +01:00
parent 3e6099a15e
commit faf00dc0cb
2 changed files with 14 additions and 4 deletions

View file

@ -5,12 +5,20 @@ namespace App\Http\Controllers;
use Illuminate\Http\Request;
use App\User;
use App\Season;
use Log;
class RegistrationController extends Controller
{
public function create() {
$season=Season::getCurrent();
if ($season) {
if ( Season::hasStandardLeague() || Season::hasQualifications() ) {
// Redirect to the home page
return redirect()->home();
}
}
return view('registration.create');
}

View file

@ -27,12 +27,14 @@
@if (!Auth::check())
<div>
<a href="/login" class="btn btn-primary">Anmelden</a>
</div>
</div>
<p>&nbsp;</p>
<div>
<a href="/register" class="btn btn-primary">Registrieren</a>
</div>
@if (!App\Season::hasQualifications() && !App\Season::hasStandardLeague())
<div>
<a href="/register" class="btn btn-primary">Registrieren</a>
</div>
@endif
@endif
</span>
</section>