verifyToken(strval(filter_input(INPUT_COOKIE, 'msz_auth'))); if($mszUserId > 0) User::byId($mszUserId)->setActive(); } if(!User::hasActive() || User::active()->getId() !== 1) { http_response_code(403); header('Content-Type: text/html; charset=utf-8'); echo << Access Denied

Access Denied

Access Denied

HTML; exit; } } if($reqPath === '/flash') { mszDieIfNotAuth(); header('Content-Type: text/html; charset=utf-8'); echo << EEPROM Flash

EEPROM Flash

HTML; return true; } if($reqPath === '/flash/stats.json') { mszDieIfNotAuth(); header('Content-Type: application/json; charset=utf-8'); $getStats = DB::prepare(' SELECT ( SELECT COUNT(`app_id`) FROM `prm_applications` ) AS `applications`, ( SELECT COUNT(`upload_id`) FROM `prm_uploads` ) AS `uploads`, ( SELECT COUNT(`user_id`) FROM `prm_users` ) AS `users` '); $getStats->execute(); echo json_encode($getStats->fetchObject()); return true; } if($reqPath === '/flash/users.json') { mszDieIfNotAuth(); header('Content-Type: application/json; charset=utf-8'); echo json_encode(User::all(10, intval(filter_input(INPUT_GET, 'after', FILTER_SANITIZE_NUMBER_INT)))); return true; } if($reqPath === '/flash/uploads.json') { mszDieIfNotAuth(); header('Content-Type: application/json; charset=utf-8'); echo json_encode(Upload::all(20, strval(filter_input(INPUT_GET, 'after')))); return true; } if($reqPath === '/flash/applications.json') { mszDieIfNotAuth(); header('Content-Type: application/json; charset=utf-8'); echo json_encode(Application::all(10, intval(filter_input(INPUT_GET, 'after', FILTER_SANITIZE_NUMBER_INT)))); return true; } if($reqPath === '/flash/style.css') { mszDieIfNotAuth(); header('Content-Type: text/css; charset=utf-8'); echo <<