Completed
Push — master ( 9d3fbd...af269e )
by Michael
09:48
created

thankyou.php (1 issue)

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

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
require_once __DIR__ . '/header.php';
24
$GLOBALS['current_category'] = -1;
25
$success                     = true;
26
27
$GLOBALS['xoopsOption']['template_main'] = 'oledrion_thankyou.tpl';
28
require_once XOOPS_ROOT_PATH . '/header.php';
29
$h_oledrion_caddy->emptyCart();
30
31
// On donne la possibilité à la passerelle de traiter la commande
32
$gateway = null;
33
$gateway = Oledrion_gateways::getGatewayObject();
34 View Code Duplication
if (is_object($gateway) && method_exists($gateway, 'thankYou')) {
0 ignored issues
show
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
35
    if (!file_exists(OLEDRION_GATEWAY_LOG_PATH)) {
36
        file_put_contents(OLEDRION_GATEWAY_LOG_PATH, '<?php exit(); ?>');
37
    }
38
    $gateway->thankYou(OLEDRION_GATEWAY_LOG_PATH);
39
    unset($gateway);
40
}
41
$xoopsTpl->assign('success', $success);
42
$xoopsTpl->assign('global_advert', OledrionUtility::getModuleOption('advertisement'));
43
$xoopsTpl->assign('breadcrumb', OledrionUtility::breadcrumb(array(OLEDRION_URL . basename(__FILE__) => _OLEDRION_PURCHASE_FINSISHED)));
44
45
$title = _OLEDRION_PURCHASE_FINSISHED . ' - ' . OledrionUtility::getModuleName();
46
OledrionUtility::setMetas($title, $title);
47
OledrionUtility::setCSS();
48
OledrionUtility::setLocalCSS($xoopsConfig['language']);
49
require_once XOOPS_ROOT_PATH . '/footer.php';
50