Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /*
- *
- * © 2016 shorttag - https://breadfish.de/index.php?user/16770-shorttag/
- * Alle Rechte liegen bei shorttag.
- * Nutzungsrechte eingeräumt bis: 15.07.2016 23:59 Uhr
- *
- */
- ini_set('display_errors', 0);
- session_start();
- require '../vendor/autoload.php';
- require 'captcha.php';
- require 'libraries/TeamSpeak3/TeamSpeak3.php';
- $app = new \Slim\Slim();
- $app->view = new \Slim\Views\Twig();
- $app->view->setTemplatesDirectory("../Mini/view");
- $twig = $app->view()->getEnvironment();
- $twig->addExtension(new Twig_Extensions_Extension_Text());
- $csrfs = "6YN0kH65nTUb71vxTk0WUsUfBMORdyxana1xHXtVHdWF5h2OsTBdbljDYXk1mH2AITXgHh1elOJgWCVemminyrQme1erz7R7RFeoM6tXK24wvPBH2JVr0BD5tImSG4QnzUBbQUZqNTN9yeGrNrIET";
- $session = "m4CGpnkcIk1TUBUrUFLtkiFS06u7GQBTL4p0hz2PKUzumjM7PnqZwWHmS2kpJM8kGnaNN3tnNSIZ2kWIydyU066JYhYyTWIpaJ3NCn1f6z5YJSw8WUSMQPlFXa3GXCWXbQBD3sJZSFOsnbq9W9MDP";
- $faillogins = "oFrc537KHTfMdzijer7CYYlS7xsYm5ABBSDwMA6jjcWnC4wGmt8aijTfGc4S7ukycNVOeSYoULBmGYSShRTp0CvwEqfBKp0N3Ls7thleSNrpBa7JRQZHjl4NBaecp5PjG8g0fs5Y6mdxma73RXB08";
- $usession = $_SESSION[$session];
- if (!isset($_SESSION[$faillogins])) {
- $_SESSION[$faillogins] = 0;
- }
- /* * ***************************************** THE CONFIGS ****************************************************** */
- // Configs for mode "development" (Slim's default), see the GitHub readme for details on setting the environment
- $app->configureMode('development', function () use ($app) {
- $app->config(array(
- 'debug' => true,
- 'database' => array(
- 'db_host' => 'localhost',
- 'db_port' => '',
- 'db_name' => 'dayofinfection',
- 'db_user' => 'dayofinfection',
- 'db_pass' => 'ENTFERNT'
- )
- ));
- });
- // Configs for mode "production"
- $app->configureMode('production', function () use ($app) {
- $app->config(array(
- 'debug' => false,
- 'database' => array(
- 'db_host' => 'localhost',
- 'db_port' => '',
- 'db_name' => 'dayofinfection',
- 'db_user' => 'dayofinfection',
- 'db_pass' => 'ENTFERNT'
- )
- ));
- });
- /* * ****************************************** THE MODEL ******************************************************* */
- $model = new \Mini\Model\Model($app->config('database'));
- if (isset($_SESSION[$session])) {
- if (!$model->existUserID($usession)) {
- session_destroy();
- session_unset();
- }
- }
- if (isset($_SESSION[$session])) {
- global $model, $usession;
- $model->updateUserActivity($usession);
- $user = array(
- "loggedin" => true,
- "name" => $model->getAccountDetail("name", $usession),
- "admin" => $model->getAccountDetail("adminlevel", $usession),
- "lastactivity" => $model->getAccountDetail("last_cp_activity", $usession),
- "id" => $model->getAccountDetail("id", $usession),
- "pns" => $model->getUnreadedPNS($usession),
- "notifications" => $model->countUserNotifications($usession),
- "skin" => $model->getAccountDetail("skin", $usession),
- "ts3uid" => $model->getAccountDetail("ts3uid", $usession),
- "beta" => $model->getAccountDetail("beta", $usession)
- );
- } else {
- global $model;
- $user = array(
- "loggedin" => false
- );
- }
- $function = new \Twig_SimpleFunction("getAccountDetail", function ($id, $detail) {
- global $model;
- return $model->getAccountDetail($id, $detail);
- });
- $twig->addFunction($function);
- $function = new \Twig_SimpleFunction("parseText", function ($text) {
- $text = strip_tags($text);
- $basic_bbcode = array(
- '[b]', '[/b]',
- '[i]', '[/i]',
- '[u]', '[/u]',
- ' ',
- );
- $basic_html = array(
- '<strong>', '</strong>',
- '<i>', '</i>',
- '<u>', '</u>',
- '<br/>',
- );
- $tmp = str_replace('<div class="embed-responsive embed-responsive-16by9"> </div>', "", $text);
- $tmp = str_replace($basic_bbcode, $basic_html, $text);
- return $tmp;
- });
- $twig->addFunction($function);
- $function = new \Twig_SimpleFunction("renderPN", function ($text) {
- $text = strip_tags($text);
- $basic_bbcode = array(
- '[b]', '[/b]',
- '[i]', '[/i]',
- '[u]', '[/u]',
- '[img]', '[/img]',
- );
- $basic_html = array(
- '<strong>', '</strong>',
- '<i>', '</i>',
- '<u>', '</u>',
- '<img src="', '" class="img-responsive" />'
- );
- $tmp = str_replace($basic_bbcode, $basic_html, $text);
- $tmp = str_replace('<div class="embed-responsive embed-responsive-16by9"> </div>', "", $tmp);
- return nl2br($tmp);
- });
- $twig->addFunction($function);
- $function = new \Twig_SimpleFunction("ReadMore", function ($string) {
- global $model;
- $count = strpos($string, '[ more ]');
- if ($count === false) {
- return str_replace("http://i.imgur.com", "https://i.imgur.com", $model->showBBcodes($string));
- } else {
- $text = substr($string, 0, $count);
- $string = $model->showBBcodes($text) . '<hr/><strong>Um mehr zu erfahren, klicke auf "Mehr lesen".</strong>';
- return str_replace("http://i.imgur.com", "https://i.imgur.com", $string);
- }
- });
- $twig->addFunction($function);
- $function = new \Twig_SimpleFunction("replaceMore", function ($string) {
- global $model;
- $string = str_replace("[ more ]", "", $model->showBBcodes($string));
- return str_replace("http://i.imgur.com", "https://i.imgur.com", $string);
- });
- $twig->addFunction($function);
- $function = new \Twig_SimpleFunction("renderKommentar", function ($text) {
- $text = strip_tags($text);
- $basic_bbcode = array(
- '[b]', '[/b]',
- '[i]', '[/i]',
- '[u]', '[/u]',
- );
- $basic_html = array(
- '<strong>', '</strong>',
- '<i>', '</i>',
- '<u>', '</u>',
- );
- $tmp = str_replace($basic_bbcode, $basic_html, $text);
- $tmp = str_replace('<div class="embed-responsive embed-responsive-16by9"> </div>', "", $tmp);
- $tmp = str_replace('http://', "https://", $tmp);
- return nl2br($tmp);
- });
- $twig->addFunction($function);
- $function = new \Twig_SimpleFunction("commentCount", function ($string) {
- global $model;
- return $model->getNewsCommentAmount($string);
- });
- $twig->addFunction($function);
- $function = new \Twig_SimpleFunction("getTimestampUserOnline", function () {
- return time() - 900;
- });
- $twig->addFunction($function);
- $function = new \Twig_SimpleFunction("hasCriticalAlert", function ($userid) {
- global $model;
- return $model->hasCriticalAlert($userid);
- });
- $twig->addFunction($function);
- $function = new \Twig_SimpleFunction("getTimestamp", function () {
- return time();
- });
- $twig->addFunction($function);
- $function = new \Twig_SimpleFunction("countBeta", function () {
- global $model;
- return $model->countBeta();
- });
- $twig->addFunction($function);
- $function = new \Twig_SimpleFunction("getBetaStatus", function ($id) {
- global $model;
- if ($model->getStatusFromBeta($id) == "0") {
- return "Bewerbung ausstehend";
- }
- if ($model->getStatusFromBeta($id) == "1") {
- return "Angenommen - Wir kontaktieren dich";
- }
- if ($model->getStatusFromBeta($id) == "2") {
- return "Abgelehnt - Tut uns leid";
- }
- });
- $twig->addFunction($function);
- $function = new \Twig_SimpleFunction("countOpenTickets", function () {
- global $model;
- return $model->countOpenTickets();
- });
- $twig->addFunction($function);
- $function = new \Twig_SimpleFunction("getTicketCategoryName", function ($id) {
- global $model;
- return $model->getTicketCategoryName($id);
- });
- $twig->addFunction($function);
- $function = new \Twig_SimpleFunction("getTicketAnswersCount", function ($id) {
- global $model;
- return $model->getTicketAnswersCount($id);
- });
- $twig->addFunction($function);
- $function = new \Twig_SimpleFunction("getPlayerReports", function () {
- global $model;
- return $model->getPlayerReports();
- });
- $twig->addFunction($function);
- $function = new \Twig_SimpleFunction("RenderBBCode", function ($text) {
- global $model;
- return $model->showBBcodes($text);
- });
- $twig->addFunction($function);
- $function = new \Twig_SimpleFunction("isSecure", function () {
- global $model;
- return $model->isSecure();
- });
- $twig->addFunction($function);
- $function = new \Twig_SimpleFunction("getURL", function () {
- global $model;
- return $model->getURL();
- });
- $twig->addFunction($function);
- $function = new \Twig_SimpleFunction("getBrowserName", function ($user_agent) {
- global $model;
- return $model->get_browser_name($user_agent);
- });
- $twig->addFunction($function);
- $function = new \Twig_SimpleFunction("getUserAgent", function () {
- return $_SERVER['HTTP_USER_AGENT'];
- });
- $twig->addFunction($function);
- $function = new \Twig_SimpleFunction("sizeof", function ($array) {
- return sizeof($array);
- });
- $twig->addFunction($function);
- $function = new \Twig_SimpleFunction("getAllUsers", function () {
- global $model;
- return $model->getAllUsersOrderByTimestamp();
- });
- $twig->addFunction($function);
- $function = new \Twig_SimpleFunction("getNewestMember", function () {
- global $model;
- return $model->getNewestMember();
- });
- $twig->addFunction($function);
- $function = new \Twig_SimpleFunction("isUserBeta", function ($id) {
- global $model;
- return $model->isUserBeta($id);
- });
- $twig->addFunction($function);
- /* * ********************************** THE ROUTES / CONTROLLERS ************************************************ */
- // GET request on homepage, simply show the view template index.twig
- $app->get('/', function () use ($app) {
- getChecks();
- global $user, $model;
- $app->render('index.twig', array(
- "title" => "Startseite",
- "page" => "index",
- "user" => $user,
- "news" => $model->getAllNews()
- ));
- });
- $app->get('/nutzungsbedingungen', function () use ($app) {
- getChecks();
- global $user, $model;
- $app->render('nutzung.twig', array(
- "title" => "Nutzungsbedingungen",
- "page" => "nutzungsbedingungen",
- "user" => $user
- ));
- });
- $app->get('/launcher', function () use ($app) {
- getChecks();
- global $user;
- $app->render('launcher.twig', array(
- "title" => "Launcher",
- "page" => "launcher",
- "user" => $user
- ));
- });
- $app->get('/launcher/whitelist', function () use ($app) {
- getChecks();
- global $user, $model;
- $app->render('mod_whitelist.twig', array(
- "title" => "Erlaubte Modifikationen",
- "page" => "launcher",
- "user" => $user,
- "mods" => $model->getMods()
- ));
- });
- $app->get('/team', function () use ($app) {
- getChecks();
- global $user, $model;
- $app->render('team.twig', array(
- "title" => "Teammitglieder",
- "page" => "team",
- "team" => $model->getTeam(),
- "user" => $user,
- "counts" => $model->countTeamMembers()
- ));
- });
- $app->get('/mitglieder/:seite', function ($seite) use ($app) {
- getChecks();
- global $user, $model;
- if ($seite > $model->getMemberPages()) {
- $app->redirect("/mitglieder/1");
- exit;
- }
- $app->render('mitglieder.twig', array(
- "title" => "Mitglieder",
- "page" => "team",
- "team" => $model->getMitgliederPage($seite),
- "user" => $user,
- "pages" => $model->getMemberPages(),
- "page" => $seite,
- "countmember" => $model->countMembers()
- ));
- });
- $app->get('/betaliste', function () use ($app) {
- getChecks();
- global $user, $model;
- $app->render('betaliste.twig', array(
- "title" => "Closed Beta Teilnehmer",
- "page" => "team",
- "team" => $model->getBetaUser(),
- "user" => $user
- ));
- });
- $app->get('/stats', function () use ($app) {
- getChecks();
- global $user, $model;
- $app->render('stats.twig', array(
- "title" => "Statistiken",
- "page" => "stats",
- "user" => $user,
- "online" => $model->getIGOnlineUser(),
- "count" => $model->countIGUsers()
- ));
- });
- $app->get('/imprint', function () use ($app) {
- getChecks();
- global $user;
- $app->render('imprint.twig', array(
- "title" => "Impressum",
- "page" => "imprint",
- "user" => $user
- ));
- });
- $app->get('/privacy', function () use ($app) {
- getChecks();
- global $user;
- $app->render('privacy.twig', array(
- "title" => "Datenschutz",
- "page" => "privacy",
- "user" => $user
- ));
- });
- $app->get('/beta', function () use ($app) {
- getChecks();
- global $user;
- if ($user["loggedin"]) {
- $app->render('beta.twig', array(
- "title" => "Beta Anmeldung",
- "page" => "beta",
- "user" => $user
- ));
- } else {
- $app->redirect("/");
- }
- });
- $app->get('/profil/:id', function ($name) use ($app) {
- getChecks();
- global $user, $model;
- if ($model->existUser($name)) {
- $usertmp = $model->getUserDataByName($name);
- $app->render('user.twig', array(
- "title" => "Profil von " . $usertmp->name,
- "page" => "privacy",
- "user" => $user,
- "mitglied" => $usertmp
- ));
- } else {
- $app->redirect("/");
- }
- });
- $app->group('/support', function() use ($app, $model) {
- $app->get('/list', function () use ($app) {
- getChecks();
- global $user, $model;
- if ($user["loggedin"] == true) {
- $app->render('support/list.twig', array(
- "title" => "Meine Tickets",
- "page" => "support",
- "user" => $user,
- "tickets" => $model->getUserTickets($user["id"])
- ));
- } else {
- $app->redirect("/");
- }
- });
- $app->get('/read/:id', function ($id) use ($app) {
- getChecks();
- global $user, $model, $csrfs;
- if ($user["loggedin"] == true) {
- if ($model->existTicket($id)) {
- $ticket = $model->getUserTicket($id);
- if ($ticket["0"]->userid == $user["id"] || $user["admin"] > 0) {
- $csrf = $_SESSION[$csrfs] = $model->generateRandomString(64) . rand() . $model->generateRandomString();
- $app->render('support/read.twig', array(
- "title" => "Ticket #" . $ticket["0"]->id,
- "page" => "support",
- "user" => $user,
- "ticket" => $ticket["0"],
- "antworten" => $model->getTicketAnswers($id),
- "csrf" => $csrf
- ));
- } else {
- $app->redirect("/");
- }
- } else {
- $app->redirect("/");
- }
- } else {
- $app->redirect("/");
- }
- });
- $app->get('/close/:id', function ($id) use ($app) {
- getChecks();
- global $user, $model, $csrfs;
- if ($user["loggedin"] == true) {
- if ($model->existTicket($id)) {
- $ticket = $model->getUserTicket($id);
- if ($ticket["0"]->userid == $user["id"] || $user["admin"] > 0) {
- $model->closeTicket($id);
- $app->redirect("/support/read/$id");
- } else {
- $app->redirect("/");
- }
- } else {
- $app->redirect("/");
- }
- } else {
- $app->redirect("/");
- }
- });
- $app->get('/new', function () use ($app) {
- getChecks();
- global $user, $model, $csrfs;
- if ($user["loggedin"] == true) {
- $csrf = $_SESSION[$csrfs] = $model->generateRandomString(64) . rand() . $model->generateRandomString();
- $app->render('support/new.twig', array(
- "title" => "Neues Ticket erstellen",
- "page" => "support",
- "user" => $user,
- "csrf" => $csrf,
- "kategorien" => $model->getKategorien()
- ));
- } else {
- $app->redirect("/");
- }
- });
- $app->post('/addAnswer', function () use ($app) {
- global $user, $app, $model, $usession, $csrfs;
- if (!$user["loggedin"])
- die("Bitte logge dich ein.");
- $id = $_POST["id"];
- $csrf = $_POST["csrf"];
- $content = $_POST['content'];
- $error = "";
- if ($_SESSION[$csrfs] != $csrf) {
- $error = $error . '<br/>• Dein CSRF-Token ist ungültig - Bitte lade die Seite neu';
- }
- if (!$model->existTicket($id)) {
- $error = $error . '<br/>• Dieses Ticket gibt es nicht';
- } else {
- $ticket = $model->getUserTicket($id);
- if ($ticket["0"]->userid != $user["id"] && $user["admin"] == "0") {
- $error = $error . '<br/>• Dieses Ticket hast du nicht erstellt';
- }
- }
- if (strlen($content) < 12) {
- $error = $error . '<br/>• Bitte schreibe einen längeren Text';
- }
- if (strlen($content) > 65530) {
- $error = $error . '<br/>• Bitte schreibe deinen Text etwas kürzer';
- }
- if ($error == "") {
- if ($user["id"] != $ticket["0"]->userid) {
- $model->addNotification($ticket["0"]->userid, 1, 'Du hast eine neue Antwort zu deinem Ticket <a href="/support/read/' . $ticket["0"]->id . '" class="profil">(Ticket öffnen)</a>.');
- }
- $model->ticketAnswer($user["id"], $ticket["0"]->id, $content);
- echo '<div class="alert alert-success">Deine Antwort wurde gespeichert!</div>';
- echo '<meta http-equiv="refresh" content="1; URL=/support/read/' . $ticket["0"]->id . '">';
- echo '<script>$("#submit").hide();</script>';
- } else {
- echo '<div class="alert alert-danger"><strong>Folgende Fehler sind aufgetreten:</strong>' . $error . '</div>';
- }
- });
- $app->post('/addTicket', function () use ($app) {
- global $user, $app, $model, $usession, $csrfs;
- if (!$user["loggedin"])
- die("Bitte logge dich ein.");
- $csrf = $_POST["csrf"];
- $content = $_POST['content'];
- $category = $_POST['category'];
- $cname = $_POST['cname'];
- $error = "";
- $cid = -1;
- if ($_SESSION[$csrfs] != $csrf) {
- $error = $error . '<br/>• Dein CSRF-Token ist ungültig - Bitte lade die Seite neu';
- }
- if (strlen($content) < 12) {
- $error = $error . '<br/>• Bitte schreibe einen längeren Text';
- }
- if (strlen($content) > 65530) {
- $error = $error . '<br/>• Bitte schreibe deinen Text etwas kürzer';
- }
- if (!$model->existTicketCategory($category)) {
- $error = $error . '<br/>• Diese Kategorie gibt es nicht';
- }
- if ($category == "6") {
- if (!$model->existUser($cname)) {
- $error = $error . '<br/>• Der vermutete Cheater ist hier nicht registriert';
- } else {
- $cid = $model->getIDByName($cname);
- }
- }
- if ($error == "") {
- $model->addTicket($user["id"], $category, $content, $cid);
- echo '<div class="alert alert-success">Dein Ticket wurde erstellt!</div>';
- echo '<script>$("#submit").hide();</script>';
- echo '<script>window.setTimeout(function() { window.location.href = "/support/list"; }, 1000);</script>';
- } else {
- echo '<div class="alert alert-danger"><strong>Folgende Fehler sind aufgetreten:</strong>' . $error . '</div>';
- }
- });
- });
- $app->group('/admincenter', function () use ($app, $model) {
- $app->get('/beta', function () use ($app) {
- getChecks();
- global $user, $model;
- if ($user["loggedin"] == true) {
- if ($user["admin"] > 0) {
- $app->render('admincenter/beta.twig', array(
- "title" => "Beta Anmeldungen",
- "page" => "admincenter",
- "user" => $user,
- "anmeldungen" => $model->getBeta(),
- ));
- } else {
- $app->redirect("/");
- }
- } else {
- $app->redirect("/");
- }
- });
- $app->get('/tickets', function () use ($app) {
- getChecks();
- global $user, $model;
- if ($user["loggedin"] == true) {
- if ($user["admin"] > 0) {
- $app->render('admincenter/ticket_list.twig', array(
- "title" => "Offene Tickets",
- "page" => "admincenter",
- "user" => $user,
- "tickets" => $model->getOpenTickets(),
- ));
- } else {
- $app->redirect("/");
- }
- } else {
- $app->redirect("/");
- }
- });
- $app->post('/registerBeta', function () use ($app) {
- global $user, $app, $model;
- if (!$user["loggedin"])
- die("Bitte logge dich ein.");
- if (!$model->isUserBeta($user["id"])) {
- echo '<div class="alert alert-success">Du hast dich erfolgreich für die Closed Beta eingeschrieben!</div>';
- echo '<script>$("#anmeldung").hide();</script>';
- $model->addBeta($user["id"]);
- }
- });
- });
- $app->group('/notifications', function () use ($app, $model) {
- $app->get('/list', function () use ($app) {
- getChecks();
- global $user, $model;
- if ($user["loggedin"] == true) {
- $app->render('notifications/list.twig', array(
- "title" => "Übersicht",
- "page" => "notifications",
- "user" => $user,
- "list" => $model->getUserNotifications($user["id"]),
- ));
- } else {
- $app->redirect("/");
- }
- });
- $app->get('/delete/:code', function ($id) use ($app) {
- getChecks();
- global $user, $model;
- if ($user["loggedin"] == true) {
- if ($model->existNotification($id)) {
- if ($model->notificationOwner($id) == $user["id"]) {
- $model->deleteNotification($id);
- $app->redirect("/notifications/list");
- } else {
- $app->redirect("/");
- }
- } else {
- $app->redirect("/");
- }
- } else {
- $app->redirect("/");
- }
- });
- });
- $app->group('/pn', function () use ($app, $model) {
- $app->get('/list', function () use ($app) {
- getChecks();
- global $user, $model, $csrfs;
- if ($user["loggedin"] == true) {
- $csrf = $_SESSION[$csrfs] = $model->generateRandomString(64) . rand() . $model->generateRandomString();
- $app->render('pn/list.twig', array(
- "title" => "Übersicht",
- "page" => "pn",
- "user" => $user,
- "csrf" => $csrf,
- "empfangen" => $model->getUserPNS($user["id"]),
- "gesendet" => $model->getUserSendetPNS($user["id"]),
- "to" => "",
- "pnsused" => $model->countUsedPNS($user["id"]),
- "maxpns" => $model->userMaxPNS($user["id"])
- ));
- } else {
- $app->redirect("/");
- }
- });
- $app->get('/list/:to', function ($to) use ($app) {
- getChecks();
- global $user, $model, $csrfs;
- if ($user["loggedin"] == true) {
- $csrf = $_SESSION[$csrfs] = $model->generateRandomString(64) . rand() . $model->generateRandomString();
- $app->render('pn/list.twig', array(
- "title" => "Übersicht",
- "page" => "pn",
- "user" => $user,
- "csrf" => $csrf,
- "empfangen" => $model->getUserPNS($user["id"]),
- "gesendet" => $model->getUserSendetPNS($user["id"]),
- "to" => $to,
- "pnsused" => $model->countUsedPNS($user["id"]),
- "maxpns" => $model->userMaxPNS($user["id"])
- ));
- } else {
- $app->redirect("/");
- }
- });
- $app->get('/read/:code', function ($id) use ($app) {
- getChecks();
- global $user, $model, $csrfs;
- if ($user["loggedin"] == true) {
- if (!$model->existPN($id)) {
- $app->redirect("/");
- }
- $message = $model->getUserPN($id);
- if ($message["0"]->toid != $user["id"] && $message["0"]->fromid != $user["id"]) {
- $app->redirect("/");
- }
- if ($message["0"]->toid == $user["id"]) {
- $model->markPNasReaded($message["0"]->id);
- }
- if ($model->amountUserPNAnswer($id) > 0) {
- $answer = $model->getUserPNAnswer($id);
- } else {
- $answer = array();
- }
- $app->render('pn/read.twig', array(
- "title" => $message["0"]->subject,
- "page" => "pn",
- "user" => $user,
- "empfangen" => $message,
- "antworten" => $answer
- ));
- } else {
- $app->redirect("/");
- }
- });
- $app->get('/close/:code', function ($id) use ($app) {
- getChecks();
- global $user, $model, $csrfs;
- if ($user["loggedin"] == true) {
- if (!$model->existPN($id)) {
- $app->redirect("/");
- }
- $message = $model->getUserPN($id);
- if ($message["0"]->toid != $user["id"] && $message["0"]->fromid != $user["id"]) {
- $app->redirect("/");
- } else {
- $model->closePN($id);
- $app->redirect("/pn/read/$id");
- }
- } else {
- $app->redirect("/");
- }
- });
- /* $app->get('/delete/:code', function ($id) use ($app) {
- global $user, $model, $csrfs;
- if ($user["loggedin"] == true) {
- if (!$model->existPN($id)) {
- $app->redirect("/");
- }
- $message = $model->getUserPN($id);
- if ($message["0"]->toid != $user["id"] && $message["0"]->fromid != $user["id"]) {
- $app->redirect("/");
- } else {
- $model->deletePN($id);
- $app->redirect("/pn/read/$id");
- }
- } else {
- $app->redirect("/");
- }
- }); */
- $app->post('/newPN', function () use ($app) {
- global $user, $app, $model, $csrfs;
- if (!$user["loggedin"])
- die("Bitte logge dich ein.");
- $error = "";
- $to = strip_tags($_POST["to"]);
- $subj = strip_tags($_POST["subj"]);
- $text = strip_tags($_POST["content"]);
- $hinw = strip_tags($_POST["hinw"]);
- $toid = -1;
- if ($_SESSION[$csrfs] != $_POST["csrf"]) {
- $error = $error . '<br/>• Dein CSRF-Token ist ungültig - Bitte lade die Seite neu';
- }
- if (!$model->existUser($to)) {
- $error = $error . '<br/>• Der Benutzer "' . $to . '" ist hier nicht registriert';
- } else {
- $toid = intval($model->getIDByName($to));
- }
- if (!isset($subj) || str_replace(" ", "", $subj) == "") {
- $error = $error . '<br/>• Du musst einen Betreff angeben';
- }
- if (strlen($subj) > 32) {
- $error = $error . '<br/>• Der Betreff darf nur max. 32 Zeichen lang sein';
- }
- if (!isset($text) || str_replace(" ", "", $text) == "" || strlen($text) < 16) {
- $error = $error . '<br/>• Du musst einen längeren Text schreiben';
- }
- if (strlen($text) > 65530) {
- $error = $error . '<br/>• Dein Text ist zu lang (' . strlen($text) . ' Zeichen von maximal 65530 Zeichen)';
- }
- if ($hinw != "true") {
- $error = $error . '<br/>• Du musst bestätigen, dass diese PN keine Support-Anfrage ist';
- }
- if ($toid != -1) {
- if (!$model->canUserGetPNS($toid)) {
- $error = $error . '<br/>• ' . $to . ' möchte keine privaten Nachrichten erhalten';
- }
- }
- if ($user["id"] == $toid) {
- $error = $error . '<br/>• Du kannst dir nicht selbst eine Nachricht schreiben';
- }
- if ($error == "") {
- $model->newPN($user["id"], $to, $subj, $text);
- echo '<div class="alert alert-success">Deine Nachricht wurde erfolgreich an ' . $to . ' gesendet!</div>';
- echo '<script>$("#pnform").get(0).reset();</script>';
- } else {
- echo '<div class="alert alert-danger"><strong>Folgende Fehler sind aufgetreten:</strong>' . $error . '</div>';
- }
- });
- $app->post('/reply', function () use ($app) {
- global $user, $app, $model, $csrfs;
- if (!$user["loggedin"])
- die("Bitte logge dich ein.");
- $error = "";
- $content = strip_tags($_POST["content"]);
- $pnid = strip_tags($_POST["id"]);
- $pn = $model->getUserPN($pnid);
- if ($pn["0"]->closed == 1) {
- $error = $error . '<br/>• Diese Nachricht wurde geschlossen';
- }
- if ($pn["0"]->toid != $user["id"] && $pn["0"]->fromid != $user["id"]) {
- $error = $error . '<br/>• Die PN ist nicht von dir oder war nicht an dich gerichtet';
- }
- if (!isset($content) || str_replace(" ", "", $content) == "" || strlen($content) < 4) {
- $error = $error . '<br/>• Du musst einen längeren Text schreiben';
- }
- if ($user["id"] == $pn["0"]->toid) {
- if (!$model->canUserGetPNS($pn["0"]->fromid)) {
- $error = $error . '<br/>• ' . $model->getAccountDetail("name", $pn["0"]->fromid) . ' möchte keine privaten Nachrichten erhalten';
- }
- } else {
- if (!$model->canUserGetPNS($pn["0"]->toid)) {
- $error = $error . '<br/>• ' . $model->getAccountDetail("name", $pn["0"]->toid) . ' möchte keine privaten Nachrichten erhalten';
- }
- }
- if ($error == "") {
- if ($user["id"] == $pn["0"]->toid) {
- $model->answerPN($pnid, $content, $user["id"], $pn["0"]->fromid);
- echo '<div class="alert alert-success">Deine Antwort wurde an ' . $model->getAccountDetail("name", $pn["0"]->fromid) . ' gesendet!</div>';
- $model->addNotification($pn["0"]->fromid, 1, 'Du hast eine neue Antwort von ' . $model->getAccountDetail("name", $user["id"]) . ' zu der PN <a href="/pn/read/' . $pn["0"]->id . '" class="profil">"' . $pn["0"]->subject . '"</a>');
- } else {
- $model->answerPN($pnid, $content, $pn["0"]->fromid, $pn["0"]->toid);
- echo '<div class="alert alert-success">Deine Antwort wurde an ' . $model->getAccountDetail("name", $pn["0"]->toid) . ' gesendet!</div>';
- $model->addNotification($pn["0"]->toid, 1, 'Du hast eine neue Antwort von ' . $model->getAccountDetail("name", $pn["0"]->fromid) . ' zu der PN <a href="/pn/read/' . $pn["0"]->id . '" class="profil">"' . $pn["0"]->subject . '"</a>');
- }
- echo '<meta http-equiv="refresh" content="1; URL=/pn/read/' . $pn["0"]->id . '">';
- echo '<script>$("#submit").hide();</script>';
- } else {
- echo '<div class="alert alert-danger"><strong>Folgende Fehler sind aufgetreten:</strong>' . $error . '</div>';
- }
- });
- });
- $app->group('/api', function () use ($app, $model) {
- $app->get('/servername', function () use ($app) {
- echo "Unbekannt";
- });
- $app->get('/players', function () use ($app) {
- echo "Unbekannt / Unbekannt";
- });
- $app->get('/online', function () use ($app) {
- echo "offline";
- });
- });
- $app->group('/news', function () use ($app, $model) {
- $app->get('/create', function () use ($app) {
- getChecks();
- global $user;
- if (!$user["loggedin"])
- die("Bitte logge dich ein.");
- if ($user["admin"] == "4" || $user["admin"] == "3") {
- $app->render('news/create.twig', array(
- "title" => "News erstellen",
- "page" => "news_create",
- "user" => $user
- ));
- } else {
- $app->redirect("/");
- }
- });
- $app->get('/edit/:id', function ($id) use ($app) {
- getChecks();
- global $user, $model;
- if (!$user["loggedin"])
- die("Bitte logge dich ein.");
- if ($user["admin"] == "4" || $user["admin"] == "3") {
- if ($model->existNews($id)) {
- $app->render('news/edit.twig', array(
- "title" => "News bearbeiten",
- "page" => "news_edit",
- "user" => $user,
- "article" => $model->getNews($id)
- ));
- } else {
- $app->redirect("/");
- }
- } else {
- $app->redirect("/");
- }
- });
- $app->get('/delete/:id', function ($id) use ($app) {
- getChecks();
- global $user, $model;
- if (!$user["loggedin"])
- die("Bitte logge dich ein.");
- if ($user["admin"] == "4" || $user["admin"] == "3") {
- if ($model->existNews($id)) {
- $model->deleteNews($id);
- $app->redirect("/");
- } else {
- $app->redirect("/");
- }
- } else {
- $app->redirect("/");
- }
- });
- $app->get('/comment/delete/:id', function ($id) use ($app) {
- getChecks();
- global $user, $model;
- if (!$user["loggedin"])
- die("Bitte logge dich ein.");
- if ($user["admin"] > 0) {
- if ($model->existComment($id)) {
- $comment = $model->getCommentByID($id); #
- $model->deleteComment($id);
- $app->redirect("/news/read/" . $comment["0"]->news_id);
- } else {
- $app->redirect("/");
- }
- } else {
- $app->redirect("/");
- }
- });
- $app->get('/read/:id', function ($id) use ($app) {
- getChecks();
- global $user, $model, $csrfs;
- $csrf = $_SESSION[$csrfs] = $model->generateRandomString(64) . rand() . $model->generateRandomString();
- if ($model->existNews($id)) {
- $news = $model->getNews($id);
- $app->render('news/read.twig', array(
- "title" => $news["0"]->head,
- "page" => "news_read",
- "user" => $user,
- "article" => $news,
- "commentcount" => $model->getNewsCommentAmount($id),
- "csrf" => $csrf,
- "comments" => $model->getNewsComments($id)
- ));
- } else {
- $app->redirect("/");
- }
- });
- $app->post('/checkNews', function () use ($app) {
- global $user, $app, $model, $usession;
- if (!$user["loggedin"])
- die("Bitte logge dich ein.");
- if ($user["admin"] == "4" || $user["admin"] == "3") {
- echo '<div class="alert alert-success">News veröffentlicht!</div>';
- echo "<script>$('#submit').hide();</script>";
- $model->addNews($usession, $_POST["title"], strip_tags($_POST["content"]), time());
- }
- });
- $app->post('/previewNews', function () use ($app) {
- global $user, $app, $model, $usession;
- if (!$user["loggedin"])
- die("Bitte logge dich ein.");
- if ($user["admin"] == "4" || $user["admin"] == "3") {
- echo $model->showBBcodes($_POST["content"]) . "<hr>";
- }
- });
- $app->post('/updateNews', function () use ($app) {
- global $user, $app, $model, $usession;
- if (!$user["loggedin"])
- die("Bitte logge dich ein.");
- if ($user["admin"] == "4" || $user["admin"] == "3") {
- if ($model->existNews($_POST["id"])) {
- echo '<div class="alert alert-success">News veröffentlicht!</div>';
- $model->updateNews($_POST["title"], strip_tags($_POST["content"]), $_POST["id"]);
- } else {
- echo '<div class="alert alert-success">Nichts manipulieren...</div>';
- }
- }
- });
- $app->post('/addComment', function () use ($app) {
- global $user, $app, $model, $usession, $csrfs;
- if (!$user["loggedin"])
- die("Bitte logge dich ein.");
- if ($model->existNews(strip_tags($_POST["id"]))) {
- if ($_SESSION[$csrfs] != $_POST["csrf"]) {
- echo '<div class="alert alert-danger">Dein CSRF-Token ist ungültig! Bitte lade die Seite neu.</div>';
- } else {
- if ($model->getUserLastCommentTime($user["id"]) > 5) {
- if (strlen(strip_tags($_POST["content"])) < 16 || strlen(strip_tags($_POST["content"])) > 2048) {
- echo '<div class="alert alert-danger">Dein Kommentar muss mind. 16 Zeichen enthalten, darf aber nicht länger als 2048 Zeichen sein. Du verwendest ' . strlen(strip_tags($_POST["content"])) . ' Zeichen.</div>';
- } else {
- echo '<script>location.reload();</script>';
- $model->addComment($usession, strip_tags($_POST["content"]), time(), strip_tags($_POST["id"]));
- echo '<meta http-equiv="refresh" content="0; URL=/news/read/' . strip_tags($_POST["id"]) . '">';
- }
- } else {
- echo '<div class="alert alert-danger">Du kannst nur alle 5 Minuten ein Kommentar schreiben.</div>';
- }
- }
- } else {
- echo '<div class="alert alert-danger">Nichts manipulieren...</div>';
- }
- });
- });
- $app->group('/account', function () use ($app, $model) {
- $app->get('/settings', function () use ($app) {
- getChecks();
- global $user, $app, $session, $model, $csrfs;
- if (!$user["loggedin"])
- $app->redirect("/");
- $csrf = $_SESSION[$csrfs] = $model->generateRandomString(64) . rand() . $model->generateRandomString();
- $app->render('account/settings.twig', array(
- "title" => "Einstellungen",
- "page" => "settings",
- "user" => $user,
- "csrf" => $csrf
- ));
- });
- $app->get('/login', function () use ($app) {
- getChecks();
- global $user, $app;
- if ($user["loggedin"])
- $app->redirect("/");
- $app->render('account/login.twig', array(
- "title" => "Login",
- "page" => "login",
- "user" => $user
- ));
- });
- $app->get('/register', function () use ($app) {
- getChecks();
- global $user, $app;
- if ($user["loggedin"])
- $app->redirect("/");
- $kc_o = new KeyCAPTCHA_CLASS();
- $app->render('account/register.twig', array(
- "title" => "Registrierung",
- "page" => "register",
- "user" => $user,
- "captcha" => $kc_o->render_js()
- ));
- });
- $app->get('/logout', function () use ($app) {
- getChecks();
- global $user, $app;
- if (!$user["loggedin"])
- $app->redirect("/");
- session_unset();
- session_destroy();
- $app->redirect("/");
- });
- $app->post('/checkLogin', function () use ($app) {
- global $user, $app, $model, $session, $faillogins;
- if ($user["loggedin"])
- die("Bereits eingeloggt. Bitte unterlasse manuelle Post-Requests.");
- if ($model->isIPCPBanned($model->getClientIP())) {
- echo '<div class="alert alert-danger">Du wurdest 15 Minuten wegen fehlerhaften Login-Versuchen gesperrt.</div>';
- } else {
- if ($model->existUser($_POST["username"])) {
- $array = $model->getUserDataByName($_POST["username"]);
- if ($model->getAccountDetail("cpban", $array->id) == 1 || $model->getAccountDetail("cpban", $array->id) > time()) {
- $app->render('baninfo_clean.twig', array(
- "title" => "Account gesperrt",
- "page" => "pn",
- "user" => $user,
- "bangrund" => $model->getAccountDetail("cpban_grund", $array->id),
- "dauer" => $model->getAccountDetail("cpban", $array->id),
- "name" => $array->name
- ));
- echo '<script>$("#login").hide();</script>';
- exit;
- }
- $salt = $array->salt;
- $pass = $array->password;
- $id = $array->id;
- $tmppass = strtoupper(md5($salt . $_POST["passwort"])); //salt+klartextpw md5'en
- if (strlen($_POST["passwort"]) <= 4 || str_replace(" ", "", $_POST["passwort"]) == "") {
- echo '<div class="alert alert-danger">Du hast das Passwort vergessen oder es ist zu kurz.</div>';
- exit;
- }
- if (strlen($_POST["passwort"]) > 23) {
- echo '<div class="alert alert-danger">Das Passwort ist zu lang.</div>';
- exit;
- }
- if ($tmppass == $pass) {
- $_SESSION[$faillogins] = 0;
- echo '<script>location.reload();</script>';
- echo '<div class="alert alert-success">Du hast dich erfolgreich eingeloggt, ' . $array->name . '.</div>';
- echo "<script>$('#submit').hide();</script>";
- $_SESSION[$session] = $id;
- } else {
- $_SESSION[$faillogins] = $_SESSION[$faillogins] + 1;
- if ($_SESSION[$faillogins] >= 3) {
- $model->addCPBan($model->getClientIP(), 900);
- }
- $ip = $model->getClientIP();
- $teile = explode(".", $ip);
- $ip = $teile[0] . "." . $teile[1] . "." . $teile[2] . ".*";
- $model->addNotification($id, 2, 'Ein User mit der IP <code>' . $ip . '</code> wollte sich in deinen Account einloggen.');
- echo '<div class="alert alert-danger">Benutzername und/oder Passwort falsch.</div>';
- }
- } else {
- echo '<div class="alert alert-danger">Benutzername und/oder Passwort falsch.</div>';
- }
- }
- });
- $app->post('/setTeamspeak', function () use ($app) {
- global $user, $app, $model;
- $ts = TeamSpeak3::factory("serverquery://serveradmin:o8tmbXfht11fN5lLeitJ0lpxg@127.0.0.1:10011/?server_port=9987&nickname=Day-of-Infection");
- $method = $_POST["method"];
- if ($method == "add") {
- $props = array(
- "client_description" => "Name: " . $user["name"]
- );
- $uid = strip_tags($_POST["uid"]);
- if ($model->isTSUIDInUsage($uid) > 0) {
- echo '<br/><div class="alert alert-danger">Diese Eindeutige ID ist schon registriert.</div>';
- exit;
- }
- Try {
- $client = $ts->clientFindDb($uid, true);
- } catch (Exception $exx) {
- echo '<br/><div class="alert alert-danger">Du musst auf dem TeamSpeak Server online sein.</div>';
- exit;
- }
- if ($user["admin"] == "4") {
- $ts->serverGroupClientAdd(15, $client[0]);
- }
- if ($user["admin"] == "3") {
- $ts->serverGroupClientAdd(16, $client[0]);
- }
- if ($user["admin"] == "2") {
- $ts->serverGroupClientAdd(12, $client[0]);
- }
- if ($user["admin"] == "1") {
- $ts->serverGroupClientAdd(13, $client[0]);
- }
- if ($user["admin"] == "0") {
- $ts->serverGroupClientAdd(7, $client[0]);
- }
- $ts->clientmodifydb($client, $props);
- $model->updateTeamspeak($uid, $user["id"]);
- echo '<br/><div class="alert alert-success">Du hast deinen Account erfolgreich mit dem TeamSpeak Server verknüpft.</div>';
- }
- if ($method == "remove") {
- $fehler = false;
- Try {
- $props = array(
- "client_description" => ""
- );
- $client = $ts->clientFindDb($user["ts3uid"], true);
- foreach ($ts->serverGroupGetById(7)->clientList() as $clients) {
- if ($clients["client_unique_identifier"] == $user["ts3uid"]) {
- $ts->serverGroupClientDel(7, $client[0]);
- }
- }
- foreach ($ts->serverGroupGetById(13)->clientList() as $clients) {
- if ($clients["client_unique_identifier"] == $user["ts3uid"]) {
- $ts->serverGroupClientDel(13, $client[0]);
- }
- }
- foreach ($ts->serverGroupGetById(12)->clientList() as $clients) {
- if ($clients["client_unique_identifier"] == $user["ts3uid"]) {
- $ts->serverGroupClientDel(12, $client[0]);
- }
- }
- foreach ($ts->serverGroupGetById(16)->clientList() as $clients) {
- if ($clients["client_unique_identifier"] == $user["ts3uid"]) {
- $ts->serverGroupClientDel(16, $client[0]);
- }
- }
- foreach ($ts->serverGroupGetById(15)->clientList() as $clients) {
- if ($clients["client_unique_identifier"] == $user["ts3uid"]) {
- $ts->serverGroupClientDel(15, $client[0]);
- }
- }
- } catch (Exception $ex) {
- echo '<br/><div class="alert alert-danger">Folgender Fehler ist aufgetreten: ' . $ex->getMessage() . '</div>';
- exit;
- }
- if ($fehler == false) {
- $ts->clientmodifydb($client[0], $props);
- $model->updateTeamspeak("", $user["id"]);
- echo '<br/><div class="alert alert-success">Die Rechte von der UID ' . $user["ts3uid"] . ' wurden entfernt.</div>';
- }
- }
- });
- $app->post('/saveSettings', function () use ($app) {
- global $user, $app, $model, $session, $csrfs, $usession;
- if (!$user["loggedin"])
- die('<div class="alert alert-danger">Du bist nicht (mehr) eingeloggt.</div>');
- $error = "";
- $profil_visible = strip_tags($_POST["visible"]);
- $getpns = strip_tags($_POST["pns"]);
- $newpw = strip_tags($_POST["newpw"]);
- $newpwwdh = strip_tags($_POST["newpwwdh"]);
- if ($_SESSION[$csrfs] != $_POST["csrf"]) {
- $error = $error . "<br/>• Dein CSRF-Token ist ungültig! Bitte lade die Seite neu.";
- }
- if ($profil_visible > 1 || $profil_visible < 0) {
- $error = $error . "<br/>• Ungültige Value";
- }
- if ($getpns > 1 || $getpns < 0) {
- $error = $error . "<br/>• Ungültige Value";
- }
- if (isset($newpw) && strlen($newpw) >= 1) {
- if ($newpw != $newpwwdh) {
- $error = $error . "<br/>• Die angegebenen Passwörter sind nicht gleich";
- }
- if (strlen($newpw) < 4 || strlen($newpwwdh) > 16) {
- $error = $error . "<br/>• Das Passwort muss mind. 4 Zeichen und max. 16 Zeichen enthalten";
- }
- }
- if ($error == "") {
- $model->saveSettings($usession, $profil_visible, $getpns);
- echo '<div class="alert alert-success" id="sefa">Deine Einstellungen wurden gespeichert!</div>';
- echo '<script>$("#sefa").fadeOut(2500);</script>';
- if (isset($newpw) && strlen($newpw) >= 1) {
- $model->setNewPW($user["id"], $newpw);
- echo '<div class="alert alert-success">Dein neues Passwort lautet: <code>' . $newpw . '</code><br/>Du wurdest automatisch ausgeloggt.</div>';
- session_unset();
- session_destroy();
- }
- } else {
- echo '<div class="alert alert-danger"><strong>Folgende Fehler sind aufgetreten:</strong>' . $error . '</div>';
- }
- });
- $app->post('/checkRegister', function () use ($app) {
- global $user, $app, $model, $session;
- if ($user["loggedin"])
- die("Bereits eingeloggt. Bitte unterlasse manuelle Post-Requests.");
- $regfail = "";
- $username = strip_tags($_POST["username"]);
- $username = str_replace(" ", "", $username);
- $email = strip_tags($_POST["mail"]);
- $pass = strip_tags($_POST["passwort"]);
- if ($model->existUser($username)) {
- $regfail = $regfail . "<br/>• Diesen Benutzer gibt es bereits";
- }
- if (!filter_var($email, FILTER_VALIDATE_EMAIL) === true) {
- $regfail = $regfail . "<br/>• Die angegebene E-Mail ist ungültig";
- } else {
- if ($model->existMail($email)) {
- $regfail = $regfail . "<br/>• Die angegebene E-Mail wird schon verwendet";
- }
- $domain = explode("@", $email);
- $ch = curl_init();
- curl_setopt($ch, CURLOPT_URL, 'http://www.mogelmail.de/q/' . $domain[1]);
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
- curl_setopt($ch, CURLOPT_TIMEOUT, '3');
- $content = trim(curl_exec($ch));
- curl_close($ch);
- if ($content == "1") {
- $regfail = $regfail . "<br/>• Bitte verwende keine Trash-Mail";
- }
- }
- if (isset($username)) {
- if (strlen($username) < 4) {
- $regfail = $regfail . "<br/>• Dein Name muss mindestens 4 Zeichen enthalten";
- }
- if (strlen($username) > 23) {
- $regfail = $regfail . "<br/>• Bitte halte deinen Namen etwas kürzer";
- }
- } else {
- $regfail = $regfail . "<br/>• Du musst einen Usernamen eingeben";
- }
- if (isset($pass)) {
- if (strlen($pass) < 6) {
- $regfail = $regfail . "<br/>• Dein Passwort muss mind. 6 Zeichen enthalten";
- }
- if (strlen($pass) > 23) {
- $regfail = $regfail . "<br/>• Bitte Passwort darf maximal 23 Zeichen enthalten";
- }
- } else {
- $regfail = $regfail . "<br/>• Du musst ein Passwort eingeben";
- }
- $kc_o = new KeyCAPTCHA_CLASS();
- if (!$kc_o->check_result($_POST['capcode'])) {
- $regfail = $regfail . "<br/>• Das angegebene Captcha ist falsch";
- }
- if ($regfail == "") {
- //die('<div class="alert alert-warning">Die Registrierung ist erst ab dem 10.06.16 ab 15 Uhr freigeschaltet.</div>');
- $model->addUser($username, $email, $pass);
- echo '<div class="alert alert-success"><i class="fa fa-check-circle-o" aria-hidden="true"></i> Willkommen auf Day of Infection, ' . $username . '.</div>';
- echo "<script>$('#submit').hide();</script>;";
- } else {
- echo '<div class="alert alert-danger">';
- echo '<strong>Folgende Fehler sind aufgetreten:</strong>' . $regfail;
- echo '</div>';
- }
- });
- });
- /* * ***************************************** RUN THE APP ****************************************************** */
- function getChecks() {
- global $session, $model, $usession, $app, $user;
- if (isset($_SESSION[$session])) {
- if ($model->getAccountDetail("cpban", $usession) == 1 || $model->getAccountDetail("cpban", $usession) > time()) {
- $app->render('baninfo.twig', array(
- "title" => "Account gesperrt",
- "page" => "pn",
- "user" => $user,
- "bangrund" => $model->getAccountDetail("cpban_grund", $usession),
- "dauer" => $model->getAccountDetail("cpban", $usession)
- ));
- session_unset();
- session_destroy();
- exit;
- }
- }
- }
- $app->notFound(function () {
- global $app;
- $app->redirect("/");
- });
- $app->run();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement