예제 #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
 public static function singleton()
 {
     if (self::$singleton === NULL) {
         self::$singleton = new self();
     }
     return self::$singleton;
 }
예제 #3
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;
 }