예제 #1
0
 /**
  * @method getLangCode
  * @desc Renvoi le code de langue du client
  */
 public static function getLangCode()
 {
     $q = httpQueryStr::singleton();
     if (!self::$langCode) {
         // Code de langue demandé valide
         if ($q->lang != NULL && self::acceptedLangCode($q->lang)) {
             $langCode = $q->lang;
         } else {
             if (isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {
                 $langCode = substr(strtolower($_SERVER['HTTP_ACCEPT_LANGUAGE']), 0, 2);
             } else {
                 $langCode = self::DEFAULT_LANGCODE;
             }
         }
         self::setLangCode($langCode);
     }
     return self::$langCode;
 }
예제 #2
0
파일: users.php 프로젝트: Aphax/markfalc
<div id="content">

    <?php 
if (isset($error)) {
    ?>
    <p class="error"><?php 
    echo $error;
    ?>
</p>
    <?php 
}
$queryAdd = new httpQueryStr(true, array('p' => $httpQuery->p, 'new' => NULL));
$queryDelete = new httpQueryStr(true, array('p' => $httpQuery->p));
$queryEdit = new httpQueryStr(true, array('p' => $httpQuery->p));
?>
	<a href="<?php 
echo '?' . $queryAdd;
?>
" class="activer" title="Ajouter un utilisateur"></a>
    <h2>Comptes utilisateurs</h2>
<p>&nbsp;</p>
<p><img src="/img/grey-square.gif" width="800" height="1" alt="line" /></p>
   	<ul class="documentList active">
    <?php 
// Affichage du formulaire de création
if ($httpQuery->has('new') && !isset($confirm) && !isset($error)) {
    echo "<p>&nbsp;</p><h3>Nouveau compte utilisateur</h3>";
    include_once 'adminAccountForm.php';
}
foreach ($allUsers as $user) {
    $queryDelete->add(array('delete' => $user['id']));
예제 #3
0
파일: index.php 프로젝트: Aphax/markfalc
    $_SESSION = array();
    header('Location: connexion.php');
    exit;
}
if (!isset($_SESSION['user']) || $_SESSION['user'] != USER_KEY) {
    header('Location: connexion.php');
    exit;
}
try {
    $db = new salerDb(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', 'indexSelection');
try {
    // Récupération des produits pour la construction de la navigation
    $allSoftwares = $db->getAllSoftwares();
    $allSoftwareCategories = $db->getAllSoftwareCategories();
    // Contrôleur
    if (file_exists('userCtrl/' . $httpQuery->p . '.php')) {
        require_once 'userCtrl/' . $httpQuery->p . '.php';
    }
} catch (PDOException $e) {
    $error = $e->getMessage() . "<br />Détail :<br />" . $e->getTraceAsString();
} catch (Exception $e) {
    $error = $e->getMessage() . "<br />Détail :<br />" . $e->getTraceAsString();
}
include_once 'userHtml/header.php';
예제 #4
0
</p><?php 
}
?>
    <?php 
if (isset($error)) {
    ?>
<p class="error"><?php 
    echo $error;
    ?>
</p><?php 
}
?>
    <table class="document-table">
    <?php 
$queryActivate = new httpQueryStr();
$queryActivateCategory = new httpQueryStr();
if (is_array($allArchives)) {
    foreach ($allArchives as $index => $archive) {
        if (!isset($id_archive)) {
            $id_archive = $index;
        }
        // Si le fichier n'est pas activé
        if (!in_array($archive, $allDbArchives)) {
            // Requête d'activation par catégorie
            $queryActivateCategory->add(array('indexForm' => $index, 'activeCat' => $archive));
            $queryActivateCategory->delete('active');
            // Requête d'activation sans catégorie
            $queryActivate->add(array('indexForm' => $index, 'active' => $archive));
            $queryActivate->delete('activeCat');
            ?>
    <tr>
예제 #5
0
파일: index.php 프로젝트: Aphax/markfalc
			LEFT JOIN documents d USING (id_doc)
			WHERE a.clef ='kHtE5D9r' AND (SELECT clef FROM serveur)='koKbghjdkI55'
			LIMIT 1
*/
require 'falcon.php';
require 'classes/db.class.php';
require 'classes/FirePHP.class.php';
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();
예제 #6
0
 public static function singleton()
 {
     if (self::$singleton === NULL) {
         self::$singleton = new self();
     }
     return self::$singleton;
 }
예제 #7
0
    ?>
</p><?php 
}
?>
    <?php 
if (isset($error)) {
    ?>
<p class="error"><?php 
    echo $error;
    ?>
</p><?php 
}
?>
    <ul class="documentList">
    <?php 
$queryActivate = new httpQueryStr();
if (is_array($allImages)) {
    foreach ($allImages as $index => $image) {
        if (!isset($image_id)) {
            $image_id = $index;
        }
        // On retire le chemin courant vers la racine FTP
        // Si le fichier n'est pas activé
        if (!in_array($image, $allDbImages)) {
            // Constitution de la requête http
            $queryActivate->add(array('indexForm' => $index, 'active' => $image));
            ?>
    <li id="<?php 
            echo $index;
            ?>
">
예제 #8
0
<p><img src="/img/grey-square.gif" width="800" height="1" alt="line" /></p>
<div id="content">
<?php 
if (isset($globalError)) {
    ?>
	<p class='error'><strong><?php 
    echo $globalError;
    ?>
</strong></p>
	<?php 
}
?>
    <ul class="documentList active">
	<?php 
$queryDesactivate = new httpQueryStr();
$queryEdit = new httpQueryStr();
$total = $allMediasAccess->count();
$i = 1;
foreach ($allMediasAccess as $mediaAccess) {
    $queryDesactivate->add(array('desactive' => $mediaAccess->getMediaId()));
    $queryEdit->add(array('edit' => $mediaAccess->getMediaId()));
    $queryEdit->add(array('nocache' => time()));
    $active_media = $httpQuery->edit === (string) $mediaAccess->getMediaId();
    ?>
        <li id="<?php 
    echo $mediaAccess->getMediaId();
    ?>
" class="<?php 
    if ($active_media && isset($confirm)) {
        echo 'confirm';
    }
예제 #9
0
파일: index.php 프로젝트: Aphax/markfalc
    $_SESSION = array();
    header('Location: connexion.php');
    exit;
}
if (!isset($_SESSION['user']) || $_SESSION['user'] != USER_KEY) {
    header('Location: connexion.php');
    exit;
}
try {
    $db = new salerDb(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', 'archives');
$httpQuery->setIndexDefVal('productID', '0');
try {
    // Récupération des produits pour la construction de la navigation
    $allProducts = $db->getAllProducts();
    // Contrôleur
    if (file_exists('userCtrl/' . $httpQuery->p . '.php')) {
        require_once 'userCtrl/' . $httpQuery->p . '.php';
    }
} catch (PDOException $e) {
    $error = $e->getMessage() . "<br />Détail :<br />" . $e->getTraceAsString();
} catch (Exception $e) {
    $error = $e->getMessage() . "<br />Détail :<br />" . $e->getTraceAsString();
}
include_once 'userHtml/header.php';
예제 #10
0
?>
<p><img src="/img/grey-square.gif" width="800" height="1" alt="line"/></p>
<div id="content">
    <?php 
if (isset($globalError)) {
    ?>
        <p class='error'><strong><?php 
    echo $globalError;
    ?>
</strong></p>
    <?php 
}
?>
    <?php 
$queryDesactivate = new httpQueryStr();
$queryEdit = new httpQueryStr();
$total = $allArchiveAccess->count();
$current_type = 'new';
$first = true;
$current_cat = 'new';
$i = 1;
foreach ($allArchiveAccess as $archiveAcces) {
    $new_type = $archiveAcces->getTypeId() != $current_type;
    $new_cat = $archiveAcces->getCatId() != $current_cat;
    $last = $total == $i;
    $queryDesactivate->add(array('desactive' => $archiveAcces->getArchiveId()));
    $queryEdit->add(array('edit' => $archiveAcces->getArchiveId()));
    $queryEdit->add(array('nocache' => time()));
    $active_archive = $httpQuery->edit === (string) $archiveAcces->getArchiveId();
    ?>
예제 #11
0
    ?>
</p><?php 
}
?>
    <?php 
if (isset($error)) {
    ?>
<p class="error"><?php 
    echo $error;
    ?>
</p><?php 
}
?>
    <ul class="documentList">
    <?php 
$queryActivate = new httpQueryStr();
if (is_array($allMedias)) {
    foreach ($allMedias as $index => $media) {
        if (!isset($media_id)) {
            $media_id = $index;
        }
        // On retire le chemin courant vers la racine FTP
        $media = str_replace(getFtpMediasRoot(), '', $media);
        // Si le fichier n'est pas activé
        if (!in_array($media, $allDbMedias)) {
            // Constitution de la requête http
            $queryActivate->add(array('indexForm' => $index, 'active' => $media));
            ?>
    <li id="<?php 
            echo $index;
            ?>
예제 #12
0
파일: index.php 프로젝트: Aphax/markfalc
require 'classes/AdminMediaAccess.class.php';
require 'classes/AdminImageAccessList.class.php';
require 'classes/AdminImageAccess.class.php';
require 'classes/AdminArchiveAccessList.class.php';
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();
예제 #13
0
파일: db.class.php 프로젝트: Aphax/markfalc
 public function checkArchiveAccessInfos()
 {
     $q = httpQueryStr::singleton();
     if ($q->userArchiveK === NULL && $q->servK === NULL) {
         throw new accessException(true);
     }
     if ($q->userArchiveK === NULL || $q->servK === NULL) {
         throw new accessException(false);
     }
     $stmt = $this->query("\n \t\t\tSELECT m.*, a.description, t.id_type, t.nom as type, avion.rep avionRep\n \t\t\tFROM archives_acces a\n\t\t\tJOIN archives m USING (id_archive)\n\t\t\tLEFT JOIN archives_acces_avions aaa USING(id_archive)\n\t\t\tLEFT JOIN produits avion ON aaa.id_avion = avion.id_avion\n\t\t\tLEFT JOIN types t USING (id_type)\n\t\t\tLEFT JOIN categories c USING (id_categorie)\n\t\t\tWHERE a.clef =" . $this->quote($q->userArchiveK) . " AND (SELECT clef FROM serveur)=" . $this->quote($q->servK) . "\n\t\t\tLIMIT 1");
     $resObj = $stmt->fetchObject('AdminArchiveAccess', array($q->servK, $this));
     if ($resObj === false) {
         throw new accessException(false);
     }
     return $resObj;
 }
예제 #14
0
" />&nbsp;
            Menu : <input type="text" name="menu" value="<?php 
    echo $menu;
    ?>
" />&nbsp;
            <input type="submit" name="insert_software" value="Ajouter" />
        </form>
    <?php 
}
?>

    <ul class="documentList">
        <?php 
/** @var array $allSoftwares */
foreach ($allSoftwares as $software) {
    $queryEditSoft = new httpQueryStr(true, 'p=' . $httpQuery->p);
    $queryDeleteSoftware = new httpQueryStr(true, 'p=' . $httpQuery->p);
    $queryEditSoft->add(['t' => time()]);
    $queryEditSoft->editSoftware = $software->id_software;
    $queryDeleteSoftware->deleteSoftware = $software->id_software;
    $activeEntry = $httpQuery->editSoftware == $software->id_software;
    ?>
            <li <?php 
    if ($activeEntry && isset($software_confirm)) {
        echo 'class="confirm"';
    }
    ?>
>
                <!-- Supprimer -->
                <a href="<?php 
    echo '?' . $queryDeleteSoftware;
예제 #15
0
</strong></p>
    <?php 
}
?>
    <p><img src="/img/grey-square.gif" width="700" height="1" alt="line"/></p>
    <p><?php 
echo $allDocumentAccess->count();
?>
 brochure(s) activ&eacute;e(s) pour
        <strong><?php 
echo $avion_focus;
?>
</strong></p>
    <?php 
$queryDesactivate = new httpQueryStr();
$queryEdit = new httpQueryStr();
$current_type = 'new';
$first = true;
$current_cat = 'new';
$total = $allDocumentAccess->count();
$i = 1;
foreach ($allDocumentAccess as $docAccess) {
    $new_type = $docAccess->getTypeId() != $current_type;
    $new_cat = $docAccess->getCatId() != $current_cat;
    $last = $total == $i;
    $queryDesactivate->add(array('desactive' => $docAccess->getDocumentId()));
    $queryEdit->add(array('edit' => $docAccess->getDocumentId()));
    $queryEdit->add(array('nocache' => time()));
    $active_document = $httpQuery->edit === (string) $docAccess->getDocumentId();
    ?>
예제 #16
0
<p class="error"><?php 
    echo $error;
    ?>
</p><?php 
}
?>
    <a href="#" class="brochure-upload-submit">Upload de documents</a>
    <form class="brochure-upload-form" action="<?php 
echo $_SERVER['REQUEST_URI'];
?>
" method="post" enctype="multipart/form-data">
        <input type="file" name="brochures[]" value="" multiple/>
    </form>
    <ul class="documentList">
        <?php 
$queryActivate = new httpQueryStr();
if (is_array($allDocuments)) {
    foreach ($allDocuments as $index => $document) {
        // On retire le chemin courant vers la racine FTP
        $document = str_replace(getFtpRoot(), '', $document);
        // Si le fichier n'est pas activé
        if (!in_array($document, $allDbDocs)) {
            // Constitution de la requête http
            $queryActivate->add(array('indexForm' => $index, 'active' => $document));
            ?>
        <li id="<?php 
            echo $index;
            ?>
">
        	<!-- Activer -->
            <a href="<?php