2015-11-03 05:13:32 +01:00
|
|
|
<?php
|
|
|
|
namespace App\Http\Controllers;
|
|
|
|
|
|
|
|
use Laravel\Lumen\Routing\Controller as BaseController;
|
|
|
|
|
2015-11-04 02:56:03 +01:00
|
|
|
use Illuminate\Http\Request;
|
|
|
|
use App\Http\Controllers\Controller;
|
|
|
|
|
|
|
|
|
|
|
|
class Controller extends BaseController {
|
2015-12-12 18:26:25 +01:00
|
|
|
protected function currIsAdmin() {
|
|
|
|
$role = session('role');
|
|
|
|
if ($role == 'admin') {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
protected function isLoggedIn() {
|
|
|
|
$username = session('username');
|
|
|
|
if (!isset($username)) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
2015-11-03 05:13:32 +01:00
|
|
|
}
|