Пример #1
0
 static function get($num = null, $id = null)
 {
     // deparced ???
     $t = new rTicket();
     $id !== null && $t->setId($id);
     $num !== null && $t->setNum($num);
     return $t->hash;
 }
Пример #2
0
<?php

$wurl = sysURL . 'js.webshims/js-webshim/minified/';
html::addJsFile($wurl . 'polyfiller.js', 'core');
html::$js .= "\$.webshims.cfg.basePath = '" . $wurl . "shims/'; ";
html::$js .= "\$.webshims.polyfill('forms forms-ext'); ";
$url = $Cont->modUrl . 'pub/';
$Ticket = new rTicket();
$Ticket->setId($Cont->PFX);
$Ticket->setNum(1);
if (isset($sent) && $sent) {
    echo '<p>' . $Cont->text('thankyou') . '</p>';
    return;
}
?>
<form method=post>
	<?php 
echo $Ticket->hiddenField();
?>
	<table class="mailform c1-padding">
	<?php 
foreach ($Cont->SET['elements'] as $id => $element) {
    ?>
		<tr>
		<?php 
    if ($element['type']->v != 'description') {
        ?>
			<td style="width:<?php 
        echo $Cont->SET['namewidth'];
        ?>
px">
Пример #3
0
<?php

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);
    }
Пример #4
0
<?php

namespace qg;

$wurl = sysURL . 'js.webshims/js-webshim/minified/';
html::addJsFile($wurl . 'polyfiller.js', 'core');
html::$js .= "\$.webshims.cfg.basePath = '" . $wurl . "shims/'; ";
html::$js .= "\$.webshims.polyfill('forms forms-ext'); ";
$url = $Cont->modUrl . 'pub/';
$Ticket = new rTicket();
$Ticket->setId('cmspid_' . $Cont->id);
// todo pfx
$Ticket->setNum(1);
if (isset($sent) && $sent) {
    echo '<p>' . $Cont->text('thankyou') . '</p>';
    return;
}
?>
<form method=post>
	<?php 
echo $Ticket->hiddenField();
?>
	<table class=mailform>
	<?php 
foreach ($Cont->SET['elements'] as $id => $element) {
    ?>
		<tr>
		<?php 
    if ($element['type']->v != 'description') {
        ?>
			<td style="width:<?php 
Пример #5
0
<?php

if (rTicket::checkPost($Cont->PFX)) {
    // send email
    $M = D()->mail->Entry();
    $M->page_id = $Cont;
    if ($Cont->SET['sender']->v) {
        $M->sender = $Cont->SET['sender']->v;
    }
    $subject = (string) $Cont->text('mailSubject');
    $M->subject = $subject ? $subject : (string) Page()->title();
    foreach ($Cont->SET['elements'] as $id => $element) {
        if ($element['type']->v === 'description' || !isset($_POST[$id])) {
            continue;
        }
        $M->text .= (string) $Cont->text($id . '_name') . ': ' . $_POST[$id] . "\n";
    }
    $M->html = nl2br($M->text);
    $recipients = preg_split('/,|;|\\s/', $Cont->SET['form_email']->v);
    foreach ($recipients as $recipient) {
        if (strpos($recipient, '@')) {
            $M->addTo($recipient, $recipient);
        }
    }
    $M->send();
    // save to db
    if ($Cont->SET['toTable']->v) {
        $table = 'mailform_' . preg_replace('/[^0-9a-z_]/', '', $Cont->SET['toTable']->v);
        !D()->{$table} && D()->addTable($table);
        $T = D()->{$table};
        if (!$T->log_id) {
Пример #6
0
    imagedestroy($img);
    exit;
}
/* form sent */
// check captcha
if (isset($_POST['_qg_rTicket'])) {
    $ticket = $_POST['_qg_rTicket'];
    $sess = $_SESSION['qg']['rTicket'][$ticket];
    if (isset($sess['captcha'])) {
        $captcha = $_POST['_qg_captcha'];
        if ($sess['captcha'] !== $captcha) {
            return;
        }
    }
}
if (!rTicket::checkPost('cmspid_' . $Cont->id)) {
    return;
}
// send email
$M = D()->mail->Entry();
$M->page_id = $Cont;
if ($Cont->SET['sender']->v) {
    $M->sender = $Cont->SET['sender']->v;
}
$subject = (string) $Cont->text('mailSubject');
$M->subject = $subject ? $subject : (string) Page()->title();
foreach ($Cont->SET['elements'] as $id => $element) {
    if ($element['type']->v === 'description' || !isset($_POST[$id])) {
        continue;
    }
    $M->text .= (string) $Cont->text($id . '_name') . ': ' . $_POST[$id] . "\n";
Пример #7
0
    html::addJSFile(sysURL . 'core/js/c1.js', 'core');
    /* old ie */
    $matches = preg_match('/MSIE ([0-9.]+)/', $_SERVER['HTTP_USER_AGENT'], $match);
    if (isset($match[1]) && $match[1] < 9) {
        html::addJSFile(sysURL . 'core/js/jQuery1.js', 'core');
    } else {
        html::addJSFile(sysURL . 'core/js/jQuery.js', 'core');
    }
    $matches && header('X-UA-Compatible: IE=Edge,chrome=1');
    html::addJSFile(sysURL . 'core/js/qg/divers.js', 'core');
    html::addJSFile(sysURL . 'core/js/qg/remote.js', 'core');
});
qg::on('action', function () {
    // use 'render' ? would be .5 miliseconds slower :(
    if (strpos(appRequestUri, 'dbFile/') === 0) {
        $request = substr(appRequestUri, 7);
        dbFiles::output($request);
    }
    rTicket::captchaListener();
    Files::uploadListener();
    if (isset($_GET['qgha'])) {
        require_once sysPATH . 'core/lib/system/hashAction.php';
        $ok = hashAction::fire($_GET['qgha']);
    }
    if (isset(G()->ASK['serverInterface'])) {
        foreach (G()->ASK['serverInterface'] as $id => $vs) {
            $ret['serverInterface'][$id] = qgApi::call($vs['fn'], $vs['args']);
        }
        Answer($ret);
    }
});