forked from fluxapps/LiveVoting
-
Notifications
You must be signed in to change notification settings - Fork 6
/
pin.php
executable file
·46 lines (37 loc) · 1.24 KB
/
pin.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
37
38
39
40
41
42
43
44
45
46
<?php
/**
* @author Fabian Schmid <[email protected]>
*
* User starts here. Use a RewriteRule to access this page a bit simpler
*/
require_once __DIR__ . '/../../../../../../../libs/composer/vendor/autoload.php';
require_once __DIR__ . "/vendor/autoload.php";
require_once "dir.php";
use LiveVoting\Conf\xlvoConf;
use LiveVoting\Context\InitialisationManager;
use LiveVoting\Context\Param\ParamManager;
use LiveVoting\Context\xlvoContext;
use LiveVoting\Pin\xlvoPin;
use srag\DIC\LiveVoting\DICStatic;
try {
$pin = trim(filter_input(INPUT_GET, ParamManager::PARAM_PIN), "/");
InitialisationManager::startMinimal();
xlvoContext::setContext(xlvoContext::CONTEXT_PIN);
DICStatic::dic()->ctrl()->setTargetScript(xlvoConf::getFullApiURL());
if (!empty($pin)) {
if (xlvoPin::checkPinAndGetObjId($pin)) {
$param_manager = ParamManager::getInstance();
DICStatic::dic()->ctrl()->redirectByClass([
ilUIPluginRouterGUI::class,
xlvoVoter2GUI::class,
], xlvoVoter2GUI::CMD_START_VOTER_PLAYER);
}
} else {
DICStatic::dic()->ctrl()->redirectByClass([
ilUIPluginRouterGUI::class,
xlvoVoter2GUI::class,
], xlvoVoter2GUI::CMD_STANDARD);
}
} catch (Throwable $ex) {
echo $ex->getMessage() . "<br /><br /><a href='/'>back</a>";
}