Beispiel #1
0
 } elseif ($_GET['i'] == 3) {
     $linkTo = "../article/createarticle.php";
     $type = "createArticle";
 } elseif ($_GET['i'] == 4 && isset($_GET['a'])) {
     $articleID = trim(htmlentities($_GET['a'], ENT_QUOTES, "UTF-8"));
     $_SESSION['articleID'] = $articleID;
     $linkTo = "../order/orderarticle.php";
     $type = "order";
 } else {
     header("Location: ../../404.php");
     exit;
 }
 $deleteOldToken = $GLOBALS['DB']->query("DELETE FROM securitytoken WHERE userID = '" . $_SESSION['userID'] . "' ");
 $log = new System\Login(1);
 $security = new System\Security();
 $access = $security->askPassword($_SESSION['userID']);
 if ($access[0]) {
     $_SESSION['securityToken'] = System\Helper::generateRandomToken();
     $userID = $_SESSION['userID'];
     $securityToken = $_SESSION['securityToken'];
     $time = time();
     $writeToken = $GLOBALS['DB']->query("INSERT INTO securitytoken (userID, securityToken, type, time) VALUES ('{$userID}', '{$securityToken}', '{$type}', '{$time}') ");
     if ($writeToken == true) {
         header("Location: {$linkTo}");
         exit;
     }
 } else {
     $info = $access[1];
 }
 System\HTML::printHead();
 System\HTML::printHeader();