public function reportBug() { if (!$this->isLogged()) { $this->addPopup('danger', 'Pro nahlášení chyby musíte být přihlášeni.'); redirectTo("/"); } if (!User::checkBugReportValidity()) { redirectTo("/nastaveni/nahlasit-chybu"); } $bug = new BugReport(); $bug->setIdUser($_SESSION["user"]->getId()); $bug->setLocation(strip_tags($_POST["location"])); $bug->setDescription(strip_tags($_POST["description"])); $bug->setSeverity(strip_tags($_POST["severity"])); if (isset($_POST["device"])) { $bug->setDevice($_POST["device"]); } if (isset($_POST["browser"])) { $bug->setBrowser($_POST["browser"]); } $bug->save(); $this->addPopup('success', 'Chyba byla úspěšně nahlášena. Děkujeme!'); redirectTo("/nastaveni"); }