1 | <?php |
||
6 | class DroitAcces { |
||
7 | |||
8 | //pour la table identite |
||
9 | protected $id_identite; |
||
10 | private $super_admin; |
||
11 | |||
12 | //pour la table liste_droit_acces |
||
13 | protected $id_liste_droit_acces; |
||
14 | |||
15 | //pour des droits pour la gestion des contenus |
||
16 | private $modif_seo; |
||
17 | private $modif_contenu; |
||
18 | private $modif_navigation; |
||
19 | private $supprimer_page; |
||
20 | |||
21 | private $liste_droits_acces; |
||
22 | |||
23 | |||
24 | //-------------------------- CONSTRUCTEUR ----------------------------------------------------------------------------// |
||
25 | public function __construct() { |
||
26 | $dbc = \core\App::getDb(); |
||
27 | |||
28 | $this->id_identite = $_SESSION["idlogin".CLEF_SITE]; |
||
29 | |||
30 | //on test voir si super admin |
||
31 | $query = $dbc->select("super_admin")->select("liste_droit")->from("identite")->where("ID_identite", "=", $this->id_identite)->get(); |
||
32 | |||
33 | if ((is_array($query)) && (count($query) > 0)) { |
||
34 | foreach ($query as $obj) { |
||
35 | $this->super_admin = $obj->super_admin; |
||
36 | $this->id_liste_droit_acces = $obj->liste_droit; |
||
37 | } |
||
38 | $this->liste_droits_acces = $this->getListeDroitAcces(); |
||
39 | App::setValues(["super_admin" => $this->super_admin]); |
||
40 | } |
||
41 | } |
||
42 | //-------------------------- FIN CONSTRUCTEUR ----------------------------------------------------------------------------// |
||
43 | |||
44 | |||
45 | |||
46 | //-------------------------- GETTER ----------------------------------------------------------------------------// |
||
47 | public function getSuperAdmin() { |
||
50 | public function getModifSeo() { |
||
51 | return $this->modif_seo; |
||
52 | } |
||
53 | public function getModifContenu() { |
||
65 | |||
66 | /** |
||
67 | * @return array |
||
68 | */ |
||
69 | private function getListeDroitAcces() { |
||
87 | |||
88 | /** |
||
89 | * @param $id_page |
||
90 | * function that get if user can edit content SEO nav or contenu of the current page |
||
91 | */ |
||
92 | public function getListeDroitModificationContenu($id_page) { |
||
113 | //-------------------------- FIN GETTER ----------------------------------------------------------------------------// |
||
114 | |||
115 | |||
116 | |||
117 | //-------------------------- SETTER ----------------------------------------------------------------------------// |
||
118 | |||
119 | //-------------------------- FIN SETTER ----------------------------------------------------------------------------// |
||
120 | } |