* Copyright (C) 2006-2013 Laurent Destailleur * Copyright (C) 2012 Regis Houssin * Copyright (C) 2021 Waël Almoman * Copyright (C) 2021 Dorian Vabre * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ /** * \file htdocs/public/eventorganization/subscriptionok.php * \ingroup core * \brief File to show page after a successful subscription. * This page is called by payment system with url provided to it completed with parameter TOKEN=xxx * This token can be used to get more information. */ if (!defined('NOLOGIN')) { define("NOLOGIN", 1); // This means this output page does not require to be logged. } if (!defined('NOCSRFCHECK')) { define("NOCSRFCHECK", 1); // We accept to go on this page from external web site. } if (!defined('NOIPCHECK')) { define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip } if (!defined('NOBROWSERNOTIF')) { define('NOBROWSERNOTIF', '1'); } // For MultiCompany module. // Do not use GETPOST here, function is not defined and define must be done before including main.inc.php // Because 2 entities can have the same ref. $entity = (!empty($_GET['e']) ? (int) $_GET['e'] : (!empty($_POST['e']) ? (int) $_POST['e'] : 1)); if (is_numeric($entity)) { define("DOLENTITY", $entity); } // Load Dolibarr environment require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php'; if (isModEnabled('paypal')) { require_once DOL_DOCUMENT_ROOT.'/paypal/lib/paypal.lib.php'; require_once DOL_DOCUMENT_ROOT.'/paypal/lib/paypalfunctions.lib.php'; } global $dolibarr_main_url_root, $mysoc; /** * @var Conf $conf * @var DoliDB $db * @var HookManager $hookmanager * @var Societe $mysoc * @var Translate $langs * @var User $user * * @var string $dolibarr_main_url_root */ $langs->loadLangs(array("main", "companies", "install", "other", "eventorganization")); $object = new stdClass(); // For triggers $error = 0; // Security check $id = GETPOSTINT("id"); $securekeyreceived = GETPOST("securekey"); $securekeytocompare = dol_hash(getDolGlobalString('EVENTORGANIZATION_SECUREKEY') . 'conferenceorbooth'.((int) $id), 'md5'); if ($securekeyreceived != $securekeytocompare) { print $langs->trans('MissingOrBadSecureKey'); exit; } // Module check if (empty($conf->eventorganization->enabled)) { httponly_accessforbidden('Module Event organization not enabled'); } /** * Show header for new member * * @param string $title Title * @param string $head Head array * @param int $disablejs More content into html header * @param int $disablehead More content into html header * @param string[]|string $arrayofjs Array of complementary js files * @param string[]|string $arrayofcss Array of complementary css files * @return void */ function llxHeaderVierge($title, $head = "", $disablejs = 0, $disablehead = 0, $arrayofjs = [], $arrayofcss = []) { global $user, $conf, $langs, $mysoc; top_htmlhead($head, $title, $disablejs, $disablehead, $arrayofjs, $arrayofcss); // Show html headers print ''; // Define urllogo $urllogo = DOL_URL_ROOT.'/theme/common/login_logo.png'; if (!empty($mysoc->logo_small) && is_readable($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_small)) { $urllogo = DOL_URL_ROOT.'/viewimage.php?cache=1&modulepart=mycompany&file='.urlencode('logos/thumbs/'.$mysoc->logo_small); } elseif (!empty($mysoc->logo) && is_readable($conf->mycompany->dir_output.'/logos/'.$mysoc->logo)) { $urllogo = DOL_URL_ROOT.'/viewimage.php?cache=1&modulepart=mycompany&file='.urlencode('logos/'.$mysoc->logo); } elseif (is_readable(DOL_DOCUMENT_ROOT.'/theme/dolibarr_logo.svg')) { $urllogo = DOL_URL_ROOT.'/theme/dolibarr_logo.svg'; } print '
'; // Output html code for logo if ($urllogo) { print '
'; print '
'; print ''; print '
'; if (!getDolGlobalString('MAIN_HIDE_POWERED_BY')) { print ''; } print '
'; } if (getDolGlobalString('EVENTORGANIZATION_IMAGE_PUBLIC_INTERFACE')) { print '
'; print ''; print '
'; } print '
'; print '
'; } /* * Actions */ /* * View */ $now = dol_now(); dol_syslog("Callback url when a payment was done. query_string=".(dol_escape_htmltag($_SERVER["QUERY_STRING"]) ? dol_escape_htmltag($_SERVER["QUERY_STRING"]) : '')." script_uri=".(dol_escape_htmltag($_SERVER["SCRIPT_URI"]) ? dol_escape_htmltag($_SERVER["SCRIPT_URI"]) : ''), LOG_DEBUG, 0, '_payment'); $tracepost = ""; foreach ($_POST as $k => $v) { $tracepost .= "$k - $v\n"; } dol_syslog("POST=".$tracepost, LOG_DEBUG, 0, '_payment'); $head = ''; if (getDolGlobalString('ONLINE_PAYMENT_CSS_URL')) { $head = ''."\n"; } $conf->dol_hide_topmenu = 1; $conf->dol_hide_leftmenu = 1; llxHeaderVierge($langs->trans("PaymentForm")); // Show message print ''."\n"; print '
'."\n"; // Show logo (search order: logo defined by PAYMENT_LOGO_suffix, then PAYMENT_LOGO, then small company logo, large company logo, theme logo, common logo) // Define logo and logosmall $logosmall = $mysoc->logo_small; $logo = $mysoc->logo; $paramlogo = 'ONLINE_PAYMENT_LOGO_'.$suffix; if (getDolGlobalString($paramlogo)) { $logosmall = getDolGlobalString($paramlogo); } elseif (getDolGlobalString('ONLINE_PAYMENT_LOGO')) { $logosmall = getDolGlobalString('ONLINE_PAYMENT_LOGO'); } //print ''."\n"; // Define urllogo $urllogo = ''; $urllogofull = ''; if (!empty($logosmall) && is_readable($conf->mycompany->dir_output.'/logos/thumbs/'.$logosmall)) { $urllogo = DOL_URL_ROOT.'/viewimage.php?modulepart=mycompany&entity='.$conf->entity.'&file='.urlencode('logos/thumbs/'.$logosmall); $urllogofull = $dolibarr_main_url_root.'/viewimage.php?modulepart=mycompany&entity='.$conf->entity.'&file='.urlencode('logos/thumbs/'.$logosmall); } elseif (!empty($logo) && is_readable($conf->mycompany->dir_output.'/logos/'.$logo)) { $urllogo = DOL_URL_ROOT.'/viewimage.php?modulepart=mycompany&entity='.$conf->entity.'&file='.urlencode('logos/'.$logo); $urllogofull = $dolibarr_main_url_root.'/viewimage.php?modulepart=mycompany&entity='.$conf->entity.'&file='.urlencode('logos/'.$logo); } // Output html code for logo if ($urllogo) { print '
'; print '
'; print ''; print '
'; if (!getDolGlobalString('MAIN_HIDE_POWERED_BY')) { print ''; } print '
'; } if (getDolGlobalString('EVENTORGANIZATION_IMAGE_PUBLIC_INTERFACE')) { print '
'; print ''; print '
'; } print '


'; print $langs->trans("SubscriptionOk"); print "\n
\n"; htmlPrintOnlineFooter($mysoc, $langs, 0, $suffix); // Clean session variables to avoid duplicate actions if post is resent unset($_SESSION["FinalPaymentAmt"]); unset($_SESSION["TRANSACTIONID"]); llxFooter('', 'public'); $db->close();