Passed
Push — master ( e643a0...1f75e2 )
by Michael
03:19
created

thankyou.php (1 issue)

Labels
Severity
1
<?php
2
/*
3
 You may not change or alter any portion of this comment or credits
4
 of supporting developers from this source code or any supporting source code
5
 which is considered copyrighted (c) material of the original comment or credit authors.
6
7
 This program is distributed in the hope that it will be useful,
8
 but WITHOUT ANY WARRANTY; without even the implied warranty of
9
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
10
*/
11
12
/**
13
 * oledrion
14
 *
15
 * @copyright   {@link https://xoops.org/ XOOPS Project}
16
 * @license     {@link http://www.fsf.org/copyleft/gpl.html GNU public license}
17
 * @author      Hervé Thouzard (http://www.herve-thouzard.com/)
18
 */
19
20
/**
21
 * Page appelée par la passerelle après le paiement en ligne
22
 */
23
24
use XoopsModules\Oledrion;
25
26
require_once __DIR__ . '/header.php';
27
$GLOBALS['current_category'] = -1;
28
$success                     = true;
29
30
$GLOBALS['xoopsOption']['template_main'] = 'oledrion_thankyou.tpl';
31
require_once XOOPS_ROOT_PATH . '/header.php';
0 ignored issues
show
The constant XOOPS_ROOT_PATH was not found. Maybe you did not declare it correctly or list all dependencies?
Loading history...
32
$caddyHandler->emptyCart();
33
34
// On donne la possibilité à la passerelle de traiter la commande
35
$gateway = null;
36
$gateway = \XoopsModules\Oledrion\Gateways::getGatewayObject();
37
if (is_object($gateway) && method_exists($gateway, 'thankYou')) {
38
    if (!file_exists(OLEDRION_GATEWAY_LOG_PATH)) {
39
        file_put_contents(OLEDRION_GATEWAY_LOG_PATH, '<?php exit(); ?>', LOCK_EX);
40
    }
41
    $gateway->thankYou(OLEDRION_GATEWAY_LOG_PATH);
42
    unset($gateway);
43
}
44
$xoopsTpl->assign('success', $success);
45
$xoopsTpl->assign('global_advert', Oledrion\Utility::getModuleOption('advertisement'));
46
$xoopsTpl->assign('breadcrumb', Oledrion\Utility::breadcrumb([OLEDRION_URL . basename(__FILE__) => _OLEDRION_PURCHASE_FINSISHED]));
47
48
$title = _OLEDRION_PURCHASE_FINSISHED . ' - ' . Oledrion\Utility::getModuleName();
49
Oledrion\Utility::setMetas($title, $title);
50
Oledrion\Utility::setCSS();
51
Oledrion\Utility::setLocalCSS($xoopsConfig['language']);
52
require_once XOOPS_ROOT_PATH . '/footer.php';
53