220 lines
7.8 KiB
PHP
220 lines
7.8 KiB
PHP
<?php
|
|
/*************
|
|
*
|
|
* Constantes *
|
|
*
|
|
**************/
|
|
define('_VERSION_CODE', '4.00.6');
|
|
define('_DATE_CODE', '2024-11-29');
|
|
|
|
|
|
/**********************
|
|
*
|
|
* a faire remettre avec le nom de domaine final
|
|
* Variables globales *
|
|
*
|
|
**********************/
|
|
$strHost = (!empty($_SERVER['HTTP_HOST'])) ? trim($_SERVER['HTTP_HOST']) : '';
|
|
$currentFile = (!empty($_SERVER["PHP_SELF"])) ? trim($_SERVER["PHP_SELF"]) : '';
|
|
$parts = Explode('/', $currentFile);
|
|
$vPage = $parts[count($parts) - 1];
|
|
$vEmail = 'confirmation@ms1timing.com';
|
|
$vClient = 'ms1inscription';
|
|
$vNumero = '514-360-1610';
|
|
$vNumeroSF = '1-855-584-6464';
|
|
$vNumeroSFL = '1-855-5-TIMING';
|
|
date_default_timezone_set('America/Montreal');
|
|
$blnShowErrors = true;
|
|
$strConAdmin = '';
|
|
if (isset($_SESSION['usa_id'])) {
|
|
$strConAdmin = ' - Connecté en <span class="text-uppercase">admin</span> (' . $_SESSION['usa_info']['com_login'] . ')';
|
|
}
|
|
/**************************************
|
|
*
|
|
* Variables selon les environnements *
|
|
*
|
|
**************************************/
|
|
|
|
switch ($strHost) {
|
|
|
|
/****************************
|
|
* Environnement PRODUCTION *
|
|
****************************/
|
|
case "ms1inscription.com":
|
|
case "www.ms1inscription.com":
|
|
case "preprod.ms1inscription.com":
|
|
case "www.preprod.ms1inscription.com":
|
|
|
|
//case "www.ms1inscription.interne.ca":
|
|
// case "preprod.ms1inscription.interne.ca":
|
|
// variables
|
|
$vGoogleAnalytics = "";
|
|
$vblnEnvironementDev = false;
|
|
$blnShowErrors = false;
|
|
// a faire remettre avec le nom de domaine final
|
|
$vDomaine = $vDomaine2 = $vDomaineTiming = 'https://www.preprod.ms1inscription.com';
|
|
|
|
// $vDomaine = $vDomaine2 = $vDomaineTiming = 'https://preprod.ms1inscription.interne.ca';
|
|
|
|
|
|
$vRepertoireFichiers = '/preprod';
|
|
$vEnvNotice = '
|
|
<div class="alert-warning py-2 text-center sticky-top">
|
|
<strong>Environnement Client <span class="text-uppercase">PRÉ-PROD</span>' . $strConAdmin . '</strong>
|
|
</div>
|
|
';
|
|
// bdd
|
|
$strDatabaseHost = '158.69.235.153';
|
|
$strDatabaseUser = 'ms1inscription';
|
|
$strDatabasePass = 'Airstream911';
|
|
$strDatabaseMain = 'ms1inscription_preprod';
|
|
$strDatabaseProd = 'ms1inscription_prod';
|
|
|
|
// ftp
|
|
$arrConFTP = array(
|
|
'host' => '127.0.0.1',
|
|
'user' => 'ms1inscription',
|
|
'pass' => 'Airstream911',
|
|
'path_prod' => '/home/ms1inscription/domains/ms1inscriptionprod.interne.ca/public_html',
|
|
'path_preprod' => '/home/ms1inscription/domains/ms1inscriptionprod.interne.ca/public_html/preprod'
|
|
);
|
|
|
|
if (strpos($strHost, 'preprod.') === false /*&& strpos($currentFile, 'superadm') === false*/) { // SI PAS PRÉ-PROD => variables spécifiques à PROD
|
|
// paypal environement client
|
|
$vPaypaladv = true;
|
|
$vPaypaladv_SANDBOX = false;
|
|
//define('_Paypaladv_SANDBOX',"-SANDBOX 2024 v2");
|
|
define('_Paypaladv_SANDBOX', " v2");
|
|
|
|
$vblnEnvironementDev = false;
|
|
$blnShowErrors = false;
|
|
$strDatabaseMain = $strDatabaseProd;
|
|
$vDomaine = $vDomaine2 = $vDomaineTiming = 'https://www.ms1inscription.com';
|
|
$vRepertoireFichiers = '';
|
|
|
|
if (isset($_SESSION['usa_id'])) {
|
|
$vEnvNotice = '
|
|
<div class="alert-warning py-2 text-center sticky-top">
|
|
<strong>Environnement Client <span class="text-uppercase">PROD</span>' . $strConAdmin . '</strong>
|
|
</div>
|
|
';
|
|
} else {
|
|
$vEnvNotice = '';
|
|
}
|
|
|
|
$vGoogleAnalytics = "
|
|
<!-- Google tag (gtag.js) -->
|
|
<script async src=\"https://www.googletagmanager.com/gtag/js?id=G-9KF526LB6D\"></script>
|
|
<script>
|
|
window.dataLayer = window.dataLayer || [];
|
|
function gtag(){dataLayer.push(arguments);}
|
|
gtag('js', new Date());
|
|
gtag('config', 'G-8LEDDLNB94');
|
|
</script>
|
|
";
|
|
} else {
|
|
// paypal environement preprod
|
|
$vblnEnvironementDev = true;
|
|
$vPaypaladv = true;
|
|
$vPaypaladv_SANDBOX = true;
|
|
define('_Paypaladv_SANDBOX', "-SANDBOX 2024 v2");
|
|
//define('_Paypaladv_SANDBOX', " v2");
|
|
|
|
}
|
|
break;
|
|
|
|
/*************************
|
|
* Environnement INTERNE *
|
|
*************************/
|
|
case "ms1inscriptiondev.interne.ca":
|
|
case "preprod.ms1inscriptiondev.interne.ca":
|
|
// variables
|
|
$vGoogleAnalytics = "";
|
|
$vblnEnvironementDev = true;
|
|
$blnShowErrors = true;
|
|
$vDomaine = $vDomaine2 = $vDomaineTiming = 'https://preprod.ms1inscriptiondev.interne.ca';
|
|
$vRepertoireFichiers = '/preprod';
|
|
$vEnvNotice = '
|
|
<div class="alert-warning py-2 text-center sticky-top">
|
|
<strong>Environnement de Dévelopement <span class="text-uppercase">pré-prod</span>' . $strConAdmin . '</strong>
|
|
</div>
|
|
';
|
|
// bdd
|
|
//$strDatabaseHost = '158.69.235.152';
|
|
// vpn
|
|
$strDatabaseHost = '158.69.235.152';
|
|
$strDatabaseUser = 'ms1inscription';
|
|
$strDatabasePass = 'ms1911';
|
|
$strDatabaseMain = 'dev_ms1inscription_preprod';
|
|
$strDatabaseProd = 'dev_ms1inscription_prod';
|
|
|
|
|
|
// ftp
|
|
$arrConFTP = array(
|
|
'host' => '127.0.0.1',
|
|
'user' => 'ms1inscription',
|
|
'pass' => 'ms1911',
|
|
'path_prod' => '/home/ms1inscription/domains/ms1inscriptiondev.interne.ca/public_html',
|
|
'path_preprod' => '/home/ms1inscription/domains/ms1inscriptiondev.interne.ca/public_html/preprod'
|
|
);
|
|
|
|
// valide si preprod
|
|
if (strpos($strHost, 'preprod.') === false /*&& strpos($currentFile, 'superadm') === false*/) { // SI PAS PRÉ-PROD => variables spécifiques à PROD
|
|
// paypal environement client
|
|
$vPaypaladv = true;
|
|
$vPaypaladv_SANDBOX = true;
|
|
define('_Paypaladv_SANDBOX', "-SANDBOX 2024 v2");
|
|
//define('_Paypaladv_SANDBOX', " v2");
|
|
|
|
|
|
$strDatabaseMain = 'dev_ms1inscription_prod';
|
|
$vblnEnvironementDev = false;
|
|
$vDomaine = $vDomaine2 = $vDomaineTiming = 'https://ms1inscriptiondev.interne.ca';
|
|
$vRepertoireFichiers = '';
|
|
$vEnvNotice = '
|
|
<div class="alert-danger py-2 text-center sticky-top">
|
|
<strong>Environnement de Dévelopement <span class="text-uppercase">prod</span>' . $strConAdmin . '</strong>
|
|
</div>
|
|
';
|
|
} else {
|
|
// paypal environement preprod
|
|
$vPaypaladv = true;
|
|
$vPaypaladv_SANDBOX = true;
|
|
define('_Paypaladv_SANDBOX', "-SANDBOX 2024 v2");
|
|
//define('_Paypaladv_SANDBOX', " v2");
|
|
}
|
|
break;
|
|
}
|
|
/*****************************
|
|
*
|
|
* Connexion base de données *
|
|
*
|
|
*****************************/
|
|
$arrConDatabaseMain = array(
|
|
'host' => $strDatabaseHost,
|
|
'user' => $strDatabaseUser,
|
|
'pass' => $strDatabasePass,
|
|
'db' => $strDatabaseMain
|
|
);
|
|
$arrConDatabaseProd = array(
|
|
'host' => $strDatabaseHost,
|
|
'user' => $strDatabaseUser,
|
|
'pass' => $strDatabasePass,
|
|
'db' => $strDatabaseProd
|
|
);
|
|
/************************************
|
|
*
|
|
* Affichage des messages d'erreurs *
|
|
*
|
|
************************************/
|
|
if ($blnShowErrors) { // afficher les erreurs
|
|
// activer les erreurs
|
|
error_reporting(E_ALL);
|
|
ini_set('display_errors', TRUE);
|
|
|
|
ini_set('display_startup_errors', TRUE);
|
|
define('EOL', (PHP_SAPI == 'cli') ? PHP_EOL : '<br>');
|
|
}
|
|
// MSIN-3855
|
|
// info paypal
|
|
require_once $_SERVER['DOCUMENT_ROOT'] . "/paypal_advanced/config.php"; |