-
Notifications
You must be signed in to change notification settings - Fork 1
/
login.php
36 lines (27 loc) · 1.03 KB
/
login.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<?php
include_once dirname(__FILE__) . "/config.php";
include_once dirname(__FILE__) . "/helpers.php";
$db = dbconnect();
$activeBadgeId = fSession::get("badgeid");
if ($activeBadgeId) {
$ticket = getTicket($activeBadgeId);
if (isset($ticket) && isTicketOnline($ticket{'ticketpass'})) {
fURL::redirect("info.php");
} else {
// trigger_error("active badgeid: "$activeBadgeId." ")
fURL::redirect("ticket.php");
}
}
$savedBadgeId = fCookie::get("badgeid");
$requestBadgeId = filter_var(fRequest::get("badgeid"), FILTER_SANITIZE_STRING, array('options' => FILTER_FLAG_STRIP_BACKTICK, FILTER_FLAG_STRIP_LOW, FILTER_FLAG_STRIP_HIGH));
$badgeId = $savedBadgeId ? $savedBadgeId : $requestBadgeId;
$fail = fRequest::check("wrong");
$onlineCount = getActiveTicketsCount();
$limit = ($onlineCount > ONLINE_LIMIT);
$page->assign('count', $onlineCount);
$page->assign('limit', $limit);
$page->assign('maxcount',ONLINE_LIMIT);
$page->assign('fail', $fail);
$page->assign('badgeId', $badgeId);
$page->display("login.tpl");
?>