public function render() { $isDev = Auth::getInstance('dev')->isProvidedDemandOnWrong(); ?> <html> <head> <title><?php echo $this->title; ?> </title> <link rel="stylesheet" type="text/css" href="/css/style.css" /> <script src="https://code.jquery.com/jquery-1.11.3.min.js"></script> <link href="//cdnjs.cloudflare.com/ajax/libs/select2/4.0.0/css/select2.min.css" rel="stylesheet" /> <script src="//cdnjs.cloudflare.com/ajax/libs/select2/4.0.0/js/select2.min.js"></script> <script src="/js/tag-filter.js"></script> </head> <body> <div class="list"> <?php echo $this->list; ?> </div> <div class="filters"> <?php echo $this->filters; ?> </div> <div class="main"> <?php echo $this->main; ?> </div> <?php if ($isDev) { ?> <div class="dev-debug"> <a href="/dev?logout">Logout debug mode</a> <?php $debugStorage = Storage::getInstance('debug_log'); $debugStorage->set('_SERVER', $_SERVER); CollapsiblePrintR::create($debugStorage->exportArray())->render(); ?> </div><?php } ?> </body> </html> <?php }
break; case 'startSession': $result = Api::startSession($json); break; } $result = array('result' => $result); header('Content-Type: application/json'); echo json_encode($result); exit; } else { switch (true) { case '/' === $path || Utils::starts($path, '/?'): Ui::index(); break; case Utils::starts($path, '/suite'): Ui::suite(); break; case Utils::starts($path, '/session'): Ui::session(); break; /** @noinspection PhpMissingBreakStatementInspection */ /** @noinspection PhpMissingBreakStatementInspection */ case Utils::starts($path, '/dev'): if (Dev::create('/dev')->setAuth(Auth::getInstance('dev'))->route($path)) { break; } default: Ui::notFound(); break; } }
public function auth() { Auth::getInstance('dev')->demand(isset($_GET['logout']), '/'); App::redirect('/'); }