<?php require_once dirname(__FILE__) . '/../../../sources/Afup/Bootstrap/Http.php'; require_once dirname(__FILE__) . '/../../../sources/Afup/AFUP_Base_De_Donnees.php'; require_once dirname(__FILE__) . '/../../../sources/Afup/AFUP_Cotisations.php'; require_once dirname(__FILE__) . '/../../../sources/Afup/AFUP_Logs.php'; AFUP_Logs::initialiser($bdd, 0); $cotisations = new AFUP_Cotisations($bdd); $cotisations->validerReglementEnLigne($_GET['cmd'], round($_GET['total'] / 100, 2), $_GET['autorisation'], $_GET['transaction']); $cotisations->notifierRegelementEnLigneAuTresorier($_GET['cmd'], round($_GET['total'] / 100, 2), $_GET['autorisation'], $_GET['transaction']); AFUP_Logs::log("Ajout de la cotisation " . $_GET['cmd'] . " via Paybox."); $message = "<p>Votre paiement a été enregistré. Merci et à bientôt.</p>"; $message .= "<p>Une questions ? N'hésitez pas à contacter <a href=\"mailto:tresorier@afup.org\">le trésorier</a>.</p>"; $message .= "<p><strong></srong><a href=\"index.php\">retour à votre compte</a></strong></p>"; $smarty->assign('paybox', $message); $smarty->display('paybox.html');
$droits->seDeconnecter(); $droits->seConnecterEnAutomatique($_GET['hash']); } if (!$droits->estConnecte() and $_GET['page'] != 'connexion' and $_GET['page'] != 'mot_de_passe_perdu' and $_GET['page'] != 'message' and $_GET['page'] != 'inscription') { header('Location: index.php?page=connexion&echec=' . $droits->verifierEchecConnexion() . '&page_demandee=' . urlencode($_SERVER['REQUEST_URI'])); exit; } // On vérifie que l'utilisateur a le droit d'accéder à la page require_once dirname(__FILE__) . '/../../../configs/application/pages.php'; $droits->chargerToutesLesPages($pages); if (!$droits->verifierDroitSurLaPage($_GET['page'])) { afficherMessage("Vous n'avez pas le droit d'accéder à cette page", 'index.php?page=accueil', true); } // Initialisation de AFUP_Log require_once dirname(__FILE__) . '/../../../sources/Afup/AFUP_Logs.php'; AFUP_Logs::initialiser($bdd, $droits->obtenirIdentifiant()); // On inclut le fichier PHP de la page $smarty->assign('ctx_login', isset($_GET['ctx_login']) ? $_GET['ctx_login'] : ""); $smarty->assign('id_page', $_GET['page']); $smarty->assign('titre_page', obtenirTitre($pages, $_GET['page'])); $smarty->assign('web_path', $conf->obtenir('web|path')); $smarty->assign('pages', $droits->dechargerToutesLesPages()); if ($_GET['page'] == 'index' or !file_exists(dirname(__FILE__) . '/' . $_GET['page'] . '.php')) { $_GET['page'] = 'accueil'; } require_once dirname(__FILE__) . '/' . $_GET['page'] . '.php'; // On gère des infos popups if (isset($_SESSION['flash'])) { $smarty->assign('flash_message', $_SESSION['flash']['message']); $smarty->assign('flash_erreur', $_SESSION['flash']['erreur']); unset($_SESSION['flash']);
function test_extraireOeuvresDepuisLogs() { $oeuvres = new AFUP_Oeuvres($this->bdd); $this->assertTrue($oeuvres->extraireOeuvresDepuisLogs()); $log = new AFUP_Logs($this->bdd); $log->initialiser($this->bdd, 1); $log->log("Test " . uniqid()); $premier_du_mois = mktime(0, 0, 0, date("m"), 1, date("Y")); $this->assertTrue($oeuvres->extraireOeuvresDepuisLogs()); $this->assertTrue(isset($oeuvres->details['logs'][1][$premier_du_mois])); $this->assertTrue($oeuvres->details['logs'][1][$premier_du_mois], 1); $log->log("Test " . uniqid()); $log->log("Test " . uniqid()); $this->assertTrue($oeuvres->extraireOeuvresDepuisLogs()); $this->assertTrue($oeuvres->details['logs'][1][$premier_du_mois], 3); }