Example #1
0
 static function init()
 {
     self::$id = D()->log->insert(array('time' => time(), 'sess_id' => liveSess::$id, 'url' => URL($_SERVER['REQUEST_URI']), 'post' => count($_POST) ? serialize($_POST) : '', 'referer' => $_SERVER['HTTP_REFERER']));
 }
Example #2
0
namespace qg;

qg::on('action', function () {
    // use 'render' ? would be .5 miliseconds slower :(
    liveSess::$maxpause = G()->SET['qg']['session']['maxpause']->v;
    liveSess::init();
    G()->win = isset(G()->ASK['rTicket']) ? G()->ASK['rTicket'] : (isset($_GET['rTicket']) ? $_GET['rTicket'] : null);
    if (G()->win && !rTicket::check(G()->win)) {
        Answer(array('info' => 'rTicket nicht gültig'));
    }
    if (!G()->win) {
        G()->win = rTicket::get();
    }
    L::init();
    liveLog::init();
    // todo: country from ip?
    $l_country = 'ch';
    if (Usr()->is()) {
        $values = Usr()->getVs();
        if (isset($values['country']) && $values['country']) {
            $l_country = $values['country'];
        }
    }
    $winCountryTranslate = array('ch' => 's', 'at' => 'a', 'de' => 'u', 'it' => 'a', 'fr' => 'a', 'pl' => 'k');
    setLocale(LC_ALL, L() . '_' . strtoupper($l_country) . '.utf8', L() . $winCountryTranslate[strtolower($l_country)], L());
    if (strpos(appRequestUri, 'dbFile/') === 0) {
        $request = substr(appRequestUri, 7);
        dbFile::output($request);
    }
    File::uploadListener();