auth.php 385 B

12345678910111213141516171819
  1. <?php
  2. namespace middleware;
  3. use Closure;
  4. use Qii\Base\Middleware\Request as Middleware;
  5. use \Qii\Base\Request;
  6. class auth implements Middleware
  7. {
  8. public function __construct()
  9. {
  10. }
  11. public function handle(Request $request, Closure $next) {
  12. if (!$_SESSION['admin']) {
  13. return "This need login <br />";
  14. }
  15. return $next($request);
  16. }
  17. }