public function GET__0() { if (Auth::isAuthenticated()) { $this->redirect(); } $alerts = []; if (isset($_POST['password'], $_POST['login'])) { $login = $_POST['login']; $password = $_POST['password']; if (Auth::tryLogin($login, $password)) { $this->redirect(); } else { $alerts[] = 'Błędne dane'; } } $template = $this->includeTemplate('dashboard/login'); $template->alerts = $alerts; $template->render(); }
public function DELETE_logs_0() { if (!Auth::isAuthenticated()) { Json::unauthorized(); } $path = Config::getInstance()->getLogsPath(); if (file_exists($path)) { unlink($path); } Json::OK(['message' => 'Deleted']); }
echo $menuItem[1]; ?> </a></li> <?php } ?> </ul> </div><!--/.nav-collapse --> </div> </nav> <div class="container <?php echo isset($wideContainer) ? '' : 'container-narrow'; ?> " role="main"> <?php $authenticated = \pjanczyk\lo1olkusz\Auth::isAuthenticated(); function formatTimestamp($timestamp) { return date("Y-m-d H:i", $timestamp); } ?> <script>var authenticated = <?php echo $authenticated ? 'true' : 'false'; ?> ;</script>