Esempio n. 1
0
require 'classes/FB.class.php';
require 'classes/httpQueryStr.class.php';
require 'classes/locale.class.php';
require 'classes/access.class.php';
require 'classes/AdminMediaAccess.class.php';
require 'classes/AdminImageAccess.class.php';
require 'classes/AdminArchiveAccess.class.php';
Locale::set();
$httpQS = new httpQueryStr();
session_start();
try {
    $db = new db(DSN, USER, PASSW);
    $db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
    $db->setAttribute(PDO::MYSQL_ATTR_USE_BUFFERED_QUERY, true);
    $user_id = isset($_SESSION) && isset($_SESSION['user_id']) ? $_SESSION['user_id'] : null;
    if ($httpQS->has('userK')) {
        $acces_key = $httpQS->userK;
        $access = $db->checkAccessInfos();
        // Enregistrer la statistique de consultation du document (preview seulement)
        $db->registerUserAccess('document', 'preview', $access->id, $user_id);
    } else {
        if ($httpQS->has('userMediaK')) {
            $acces_key = $httpQS->userMediaK;
            $mediaAccess = $db->checkMediaAccessInfos();
        } else {
            if ($httpQS->has('userImageK')) {
                $acces_key = $httpQS->userImageK;
                $mediaAccess = $db->checkImageAccessInfos();
            } else {
                if ($httpQS->has('userArchiveK')) {
                    $acces_key = $httpQS->userArchiveK;
Esempio n. 2
0
require 'classes/AdminArchiveAccess.class.php';
require 'classes/image.class.php';
require 'classes/httpQueryStr.class.php';
require 'classes/locale.class.php';
try {
    $db = new adminDb(DSN, USER, PASSW);
    $db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
    $db->setAttribute(PDO::MYSQL_ATTR_USE_BUFFERED_QUERY, true);
} catch (PDOException $e) {
    die("Erreur PDO : <br />" . $e->getMessage() . "<br />Trace : " . $e->getTraceAsString());
}
$httpQuery = new httpQueryStr();
$httpQuery->setIndexDefVal('p', 'inactiveDocs');
//$httpQuery->setIndexDefVal('productID', $db->query('SELECT id_avion FROM produits ORDER BY menu LIMIT 1')->fetchColumn());
try {
    // Contrôleur
    require_once 'adminCtrl/' . $httpQuery->p . '.php';
    if (!$httpQuery->has('productID')) {
        $httpQuery->productID = $db->query('SELECT id_avion FROM produits ORDER BY menu LIMIT 1')->fetchColumn();
    }
} catch (PDOException $e) {
    $db->rollback();
    die($e->getMessage() . "<br />Détail :<br />" . $e->getTraceAsString());
    $error = $e->getMessage() . "<br />Détail :<br />" . $e->getTraceAsString();
} catch (Exception $e) {
    die($e->getMessage() . "<br />Détail :<br />" . $e->getTraceAsString());
    $error = $e->getMessage() . "<br />Détail :<br />" . $e->getTraceAsString();
}
include_once 'adminHtml/header.php';
include_once 'adminHtml/' . $httpQuery->p . '.php';
include_once 'adminHtml/footer.htm';