コード例 #1
0
ファイル: mediaController.php プロジェクト: doorgets/cms
 public function __construct(&$doorGets)
 {
     $doorGets->Table = '_dg_files';
     $params = $doorGets->Params();
     if (empty($doorGets->user)) {
         header('Location:./?controller=authentification&error-login=true&back=' . urlencode($_SERVER['REQUEST_URI']));
         exit;
     }
     if (!in_array('media', $doorGets->user['liste_module_interne']) || in_array('media', $doorGets->user['liste_module_interne']) && SAAS_ENV && !SAAS_MEDIA) {
         FlashInfo::set($this->doorGets->__("Vous n'avez pas les droits pour afficher ce module"), "error");
         header('Location:./');
         exit;
     }
     // get Content for edit / delete
     if (array_key_exists('id', $params['GET'])) {
         $id = $params['GET']['id'];
         $isContent = $doorGets->dbQS($id, $doorGets->Table);
         if (!is_numeric($id)) {
             $id = '-!-';
         }
         if (empty($isContent)) {
             FlashInfo::set($doorGets->__("Le contenu n'existe pas"), "error");
             header('Location:./?controller=media');
             exit;
         }
     }
     parent::__construct($doorGets);
 }
コード例 #2
0
ファイル: promotionController.php プロジェクト: doorgets/cms
 public function __construct(&$doorGets)
 {
     $this->doorGets = $doorGets;
     parent::__construct($doorGets);
     if (empty($doorGets->user)) {
         header('Location:./?controller=authentification&error-login=true&back=' . urlencode($_SERVER['REQUEST_URI']));
         exit;
     }
     if (!in_array('promotion', $doorGets->user['liste_module_interne']) || in_array('promotion', $doorGets->user['liste_module_interne']) && SAAS_ENV && !SAAS_ADDRESS) {
         FlashInfo::set($this->doorGets->__("Vous n'avez pas les droits pour afficher ce module"), "error");
         header('Location:./');
         exit;
     }
     $me = $doorGets->user;
     $params = $doorGets->Params();
     $redirectUrl = './?controller=promotion';
     // get Content for edit / delete
     if (array_key_exists('id', $params['GET'])) {
         $id = $params['GET']['id'];
         $isContent = $doorGets->dbQS($id, '_promotion');
         if (!is_numeric($id)) {
             $id = '-!-';
         }
         if (empty($isContent)) {
             //var_dump($isContent);
             //exit();
             FlashInfo::set($doorGets->l("Le contenu n'existe pas"), "error");
             header('Location:' . $redirectUrl);
             exit;
         }
     }
 }
コード例 #3
0
ファイル: supportController.php プロジェクト: doorgets/cms
 public function __construct(&$doorGets)
 {
     parent::__construct($doorGets);
     $User = $doorGets->user;
     if (empty($doorGets->user)) {
         header('Location:./?controller=authentification&error-login=true&back=' . urlencode($_SERVER['REQUEST_URI']));
         exit;
     }
     if (!in_array('support', $doorGets->user['liste_module_interne']) && !in_array('support_client', $doorGets->user['liste_module_interne']) || (in_array('support', $doorGets->user['liste_module_interne']) || in_array('support_client', $doorGets->user['liste_module_interne'])) && SAAS_ENV && !SAAS_SUPPORT) {
         FlashInfo::set($this->doorGets->__("Vous n'avez pas les droits pour afficher ce module"), "error");
         header('Location:./');
         exit;
     }
     // get Content for edit / delete
     $params = $this->doorGets->Params();
     if (array_key_exists('id', $params['GET'])) {
         $id = $params['GET']['id'];
         $isContent = $this->doorGets->dbQS($id, '_support');
         if (empty($isContent)) {
             FlashInfo::set($this->doorGets->__("Le contenu n'existe pas"), "error");
             header('Location:./?controller=support');
             exit;
             $this->isContent = $isContent;
         }
         if (!in_array('support', $doorGets->user['liste_module_interne']) && $User['id'] !== $isContent['id_user']) {
             FlashInfo::set($this->doorGets->__("Vous n'avez pas les droits pour afficher ce ticket"), "error");
             header('Location:./?controller=support');
             exit;
         }
     }
 }
コード例 #4
0
 public function __construct(&$doorGets)
 {
     parent::__construct($doorGets);
     if (empty($doorGets->user)) {
         header('Location:./?controller=authentification&error-login=true&back=' . urlencode($_SERVER['REQUEST_URI']));
         exit;
     }
 }
コード例 #5
0
 public function __construct(&$doorGets)
 {
     parent::__construct($doorGets);
     $User = $doorGets->user;
     $params = $doorGets->Params();
     $lgActuel = $doorGets->getLangueTradution();
     $redirectUrlModule = './?controller=modules&lg=' . $lgActuel;
     $moduleInfos = $doorGets->moduleInfos($doorGets->Uri, $lgActuel);
     $redirectUrl = './?controller=module' . $moduleInfos['type'] . '&uri=' . $doorGets->Uri . '&lg=' . $lgActuel;
     if (empty($doorGets->user)) {
         header('Location:./?controller=authentification&error-login=true&back=' . urlencode($_SERVER['REQUEST_URI']));
         exit;
     }
     // If isn't valid uri do rediction to modules controller
     if (!array_key_exists('uri', $params['GET']) || empty($params['GET']['uri']) || empty($doorGets->Uri)) {
         FlashInfo::set($doorGets->l("L'URI n'existe pas"), "error");
         header('Location:' . $redirectUrlModule . '###');
         exit;
     }
     if ('module' . $moduleInfos['type'] !== $doorGets->controllerNameNow()) {
         FlashInfo::set($doorGets->l("Erreur"), "error");
         header('Location:' . $redirectUrl . '#' . $moduleInfos['type'] . '-' . $doorGets->controllerNameNow());
         exit;
     }
     if (!in_array($moduleInfos['id'], $this->doorGets->user['liste_module']) && !in_array($moduleInfos['id'], $this->doorGets->user['liste_widget'])) {
         FlashInfo::set($doorGets->l("Vous n'avez pas les droits pour afficher ce module"), "error");
         header('Location:./');
         exit;
     }
     // check for category id
     if (array_key_exists('categorie', $params['GET'])) {
         $idCategorie = $params['GET']['categorie'];
         $doorGets->loadCategories($doorGets->Uri);
         $allCategories = $doorGets->categorieSimple;
         unset($allCategories[0]);
         if (!is_numeric($idCategorie)) {
             $idCategorie = '-!-';
         }
         if (!is_numeric($idCategorie) || !array_key_exists($idCategorie, $allCategories)) {
             FlashInfo::set($doorGets->l("La catégorie '{$idCategorie}' n'existe pas"), "error");
             header('Location:' . $redirectUrl);
             exit;
         }
     }
     // get Content for edit / delete
     if (array_key_exists('id', $params['GET'])) {
         $id = $params['GET']['id'];
         $isContent = $doorGets->dbQS($id, $doorGets->Table);
         if (!is_numeric($id)) {
             $id = '-!-';
         }
         if (empty($isContent)) {
             FlashInfo::set($doorGets->l("Le contenu n'existe pas"), "error");
             header('Location:' . $redirectUrl);
             exit;
         }
     }
 }
コード例 #6
0
ファイル: emailingController.php プロジェクト: doorgets/cms
 public function __construct(&$doorGets)
 {
     parent::__construct($doorGets);
     if (empty($doorGets->user)) {
         header('Location:./?controller=authentification&error-login=true&back=' . urlencode($_SERVER['REQUEST_URI']));
         exit;
     }
     if (!in_array('campagne_email', $doorGets->user['liste_module_interne']) || in_array('campagne_email', $doorGets->user['liste_module_interne']) && SAAS_ENV && !SAAS_NEWSLETTER) {
         FlashInfo::set($this->doorGets->__("Vous n'avez pas les droits pour afficher ce module"), "error");
         header('Location:./');
         exit;
     }
 }
コード例 #7
0
 public function __construct(&$doorGets)
 {
     $doorGets->Table = '_order_status';
     parent::__construct($doorGets);
     if (empty($doorGets->user)) {
         header('Location:./?controller=authentification&error-login=true&back=' . urlencode($_SERVER['REQUEST_URI']));
         exit;
     }
     if (!in_array('order', $doorGets->user['liste_module_interne'])) {
         FlashInfo::set($this->doorGets->__("Vous n'avez pas les droits pour afficher ce module"), "error");
         header('Location:./');
         exit;
     }
 }
コード例 #8
0
 public function __construct(&$doorGets)
 {
     if (empty($doorGets->user)) {
         header('Location:./?controller=authentification&error-login=true&back=' . urlencode($_SERVER['REQUEST_URI']));
         exit;
     }
     // Test if $uri module is valid
     $isUri = array();
     $User = $doorGets->user;
     $params = $doorGets->Params();
     $lgActuel = $doorGets->getLangueTradution();
     $moduleInfos = $doorGets->moduleInfos($doorGets->Uri, $lgActuel);
     if (array_key_exists('uri', $params['GET'])) {
         $uri = $params['GET']['uri'];
         $isUri = $doorGets->dbQS($uri, '_modules', 'uri');
     }
     $moduleInfos = $doorGets->moduleInfos($doorGets->Uri, $lgActuel);
     parent::__construct($doorGets);
     $this->table = '_categories';
     $lgActuel = $doorGets->getLangueTradution();
     $redirectUrl = './?controller=' . $doorGets->controllerNameNow() . '&uri=' . $this->doorGets->Uri . '&lg=' . $lgActuel;
     $redirectUrlModule = './?controller=modules&lg=' . $lgActuel;
     // If isn't valid uri do rediction to modules controller
     if (!array_key_exists('uri', $params['GET']) || empty($params['GET']['uri']) || empty($this->doorGets->Uri)) {
         FlashInfo::set($doorGets->__("Le module n'existe pas"), "error");
         header('Location:' . $redirectUrlModule);
         exit;
     }
     // get Content for edit / delete
     if (array_key_exists('id', $params['GET'])) {
         $id = $params['GET']['id'];
         $isContent = $doorGets->dbQS($id, $this->table);
         if (!is_numeric($id)) {
             $id = '-!-';
         }
         if (empty($isContent)) {
             FlashInfo::set($doorGets->__("Le contenu n'existe pas"), "error");
             header('Location:' . $redirectUrl);
             exit;
         }
     }
     if (!in_array($moduleInfos['id'], $this->doorGets->user['liste_module_admin'])) {
         FlashInfo::set($doorGets->l("Vous n'avez pas les droits pour gérer les catégories"), "error");
         header('Location:./');
         exit;
     }
 }
コード例 #9
0
ファイル: myinboxController.php プロジェクト: doorgets/cms
 public function __construct(&$doorGets)
 {
     $doorGets->Table = '_users_inbox';
     parent::__construct($doorGets);
     $User = $doorGets->user;
     $params = $doorGets->Params();
     $redirectUrl = './?controller=myinbox';
     if (empty($User)) {
         header('Location:./?controller=authentification&error-login=true&back=' . urlencode($_SERVER['REQUEST_URI']));
         exit;
     }
     if (!in_array('myinbox', $User['liste_module_interne']) || in_array('myinbox', $doorGets->user['liste_module_interne']) && SAAS_ENV && !SAAS_MYINBOX) {
         FlashInfo::set($this->doorGets->__("Vous n'avez pas les droits pour afficher ce module"), "error");
         header('Location:./');
         exit;
     }
     // get Content for edit / delete
     if (array_key_exists('id', $params['GET'])) {
         $id = $params['GET']['id'];
         $isContent = $doorGets->dbQS($id, $doorGets->Table);
         if (!is_numeric($id)) {
             $id = '-!-';
         }
         if (empty($isContent)) {
             FlashInfo::set($doorGets->l("Le contenu n'existe pas"), "error");
             header('Location:' . $redirectUrl);
             exit;
         } elseif (!empty($isContent) && $isContent['id_user'] !== $User['id'] && $isContent['id_user_sent'] !== $User['id']) {
             FlashInfo::set($doorGets->l("Vous ne pouvez pas afficher cette page"), "error");
             header('Location:' . $redirectUrl);
             exit;
         } elseif (!empty($isContent) && $isContent['id_user'] == $User['id'] && $isContent['user_delete'] != 0) {
             FlashInfo::set($doorGets->l("Le contenu n'existe pas"), "error");
             header('Location:' . $redirectUrl);
             exit;
         } elseif (!empty($isContent) && $isContent['id_user_sent'] == $User['id'] && $isContent['user_sent_delete'] != 0) {
             FlashInfo::set($doorGets->l("Le contenu n'existe pas"), "error");
             header('Location:' . $redirectUrl);
             exit;
         }
     }
 }
コード例 #10
0
 public function __construct(&$doorGets)
 {
     $this->doorGets = $doorGets;
     parent::__construct($doorGets);
 }
コード例 #11
0
 public function __construct(&$doorGets)
 {
     parent::__construct($doorGets);
 }