blessing-skin-server/app/Middlewares/CheckAdminMiddleware.php
2016-07-22 19:36:24 +08:00

19 lines
395 B
PHP

<?php
namespace App\Middlewares;
use Pecee\Http\Middleware\IMiddleware;
use Pecee\Http\Request;
class CheckAdminMiddleware implements IMiddleware
{
public function handle(Request $request)
{
$user = (new CheckLoggedInMiddleware)->handle($request);
if (!$user->is_admin) {
\Http::redirect('../user', '看起来你并不是管理员哦');
}
}
}