@@ -20,8 +20,12 @@ discard block |
||
20 | 20 | //-------------------------- CONSTRUCTEUR ----------------------------------------------------------------------------// |
21 | 21 | public function __construct() { |
22 | 22 | //On test si dossier temporaire + modules a la racines existes bien sinon on les crées |
23 | - if (!file_exists(ROOT."temp")) mkdir(ROOT."temp"); |
|
24 | - if (!file_exists(ROOT."modules")) mkdir(ROOT."modules"); |
|
23 | + if (!file_exists(ROOT."temp")) { |
|
24 | + mkdir(ROOT."temp"); |
|
25 | + } |
|
26 | + if (!file_exists(ROOT."modules")) { |
|
27 | + mkdir(ROOT."modules"); |
|
28 | + } |
|
25 | 29 | } |
26 | 30 | //-------------------------- FIN CONSTRUCTEUR ----------------------------------------------------------------------------// |
27 | 31 | |
@@ -83,8 +87,7 @@ discard block |
||
83 | 87 | } |
84 | 88 | |
85 | 89 | FlashMessage::setFlash("Votre module a bien été ajouté au site.", "success"); |
86 | - } |
|
87 | - else { |
|
90 | + } else { |
|
88 | 91 | |
89 | 92 | FlashMessage::setFlash("Le module n'a pas pu être correctement téléchargé et installé, veuillez réesseyer dans un instant"); |
90 | 93 | } |
@@ -124,8 +127,7 @@ discard block |
||
124 | 127 | |
125 | 128 | FlashMessage::setFlash("Votre module a bien été mis à jour", "success"); |
126 | 129 | } |
127 | - } |
|
128 | - else { |
|
130 | + } else { |
|
129 | 131 | FlashMessage::setFlash("Impossible de télécharger la mise à jour, veuillez réesseyer dans un instant"); |
130 | 132 | } |
131 | 133 | } |
@@ -137,8 +139,7 @@ discard block |
||
137 | 139 | private function setSupprimerArchiveTemp() { |
138 | 140 | if (unlink(TEMPROOT.$this->nom_fichier) == true) { |
139 | 141 | return true; |
140 | - } |
|
141 | - else { |
|
142 | + } else { |
|
142 | 143 | return false; |
143 | 144 | } |
144 | 145 | } |
@@ -169,8 +170,7 @@ discard block |
||
169 | 170 | ); |
170 | 171 | |
171 | 172 | $dbc->prepare("UPDATE module SET activer=:activer, installer=:installer WHERE ID_module=:id_module", $value); |
172 | - } |
|
173 | - else { |
|
173 | + } else { |
|
174 | 174 | $value = array( |
175 | 175 | "id_module" => $id_module, |
176 | 176 | ); |
@@ -213,7 +213,11 @@ discard block |
||
213 | 213 | $objects = scandir($url); |
214 | 214 | foreach ($objects as $object) { |
215 | 215 | if ($object != "." && $object != "..") { |
216 | - if (filetype($url."/".$object) == "dir") $this->supprimerDossier($url."/".$object); else unlink($url."/".$object); |
|
216 | + if (filetype($url."/".$object) == "dir") { |
|
217 | + $this->supprimerDossier($url."/".$object); |
|
218 | + } else { |
|
219 | + unlink($url."/".$object); |
|
220 | + } |
|
217 | 221 | } |
218 | 222 | } |
219 | 223 | reset($objects); |
@@ -41,25 +41,25 @@ discard block |
||
41 | 41 | |
42 | 42 | |
43 | 43 | //-------------------------- GETTER ----------------------------------------------------------------------------// |
44 | - public function getLogged(){ |
|
44 | + public function getLogged() { |
|
45 | 45 | return $this->logged; |
46 | 46 | } |
47 | - public function getSuperAdmin(){ |
|
47 | + public function getSuperAdmin() { |
|
48 | 48 | return $this->super_admin; |
49 | 49 | } |
50 | - public function getIdListeDroitAcces(){ |
|
50 | + public function getIdListeDroitAcces() { |
|
51 | 51 | return $this->id_liste_droit_acces; |
52 | 52 | } |
53 | - public function getModifSeo(){ |
|
53 | + public function getModifSeo() { |
|
54 | 54 | return $this->modif_seo; |
55 | 55 | } |
56 | - public function getModifContenu(){ |
|
56 | + public function getModifContenu() { |
|
57 | 57 | return $this->modif_contenu; |
58 | 58 | } |
59 | - public function getModifNavigation(){ |
|
59 | + public function getModifNavigation() { |
|
60 | 60 | return $this->modif_navigation; |
61 | 61 | } |
62 | - public function getSupprimerPage(){ |
|
62 | + public function getSupprimerPage() { |
|
63 | 63 | return $this->supprimer_page; |
64 | 64 | } |
65 | 65 | |
@@ -141,7 +141,7 @@ discard block |
||
141 | 141 | //page sans droit dans admin |
142 | 142 | $all_access = array("gestion-comptes/mon-compte", "index"); |
143 | 143 | |
144 | - if (($this->super_admin == 1) || (in_array($this->getListeDroitPage($page), $this->getListeDroitAcces()))|| (in_array($page, $all_access))) { |
|
144 | + if (($this->super_admin == 1) || (in_array($this->getListeDroitPage($page), $this->getListeDroitAcces())) || (in_array($page, $all_access))) { |
|
145 | 145 | return true; |
146 | 146 | } |
147 | 147 | else { |
@@ -78,7 +78,9 @@ discard block |
||
78 | 78 | "); |
79 | 79 | |
80 | 80 | if ((is_array($query)) && (count($query) > 0)) { |
81 | - foreach ($query as $obj) $liste_droit_acces[] = $obj->droit_acces; |
|
81 | + foreach ($query as $obj) { |
|
82 | + $liste_droit_acces[] = $obj->droit_acces; |
|
83 | + } |
|
82 | 84 | } |
83 | 85 | |
84 | 86 | return $liste_droit_acces; |
@@ -93,7 +95,9 @@ discard block |
||
93 | 95 | |
94 | 96 | $query = $dbc->query("SELECT droit_acces FROM droit_acces WHERE page LIKE '%$page%'"); |
95 | 97 | if ((is_array($query)) && (count($query) > 0)) { |
96 | - foreach ($query as $obj) $droit_acces = $obj->droit_acces; |
|
98 | + foreach ($query as $obj) { |
|
99 | + $droit_acces = $obj->droit_acces; |
|
100 | + } |
|
97 | 101 | } |
98 | 102 | |
99 | 103 | return $droit_acces; |
@@ -143,8 +147,7 @@ discard block |
||
143 | 147 | |
144 | 148 | if (($this->super_admin == 1) || (in_array($this->getListeDroitPage($page), $this->getListeDroitAcces()))|| (in_array($page, $all_access))) { |
145 | 149 | return true; |
146 | - } |
|
147 | - else { |
|
150 | + } else { |
|
148 | 151 | return false; |
149 | 152 | } |
150 | 153 | } |
@@ -169,8 +172,7 @@ discard block |
||
169 | 172 | //si les trois sont différent de 0 on renvoit true soinon false |
170 | 173 | if (($this->super_admin == 1) || ((in_array($droit, $liste_droit_acces)) && in_array(1, $array_modif))) { |
171 | 174 | return true; |
172 | - } |
|
173 | - else { |
|
175 | + } else { |
|
174 | 176 | return false; |
175 | 177 | } |
176 | 178 | } |
@@ -185,8 +187,7 @@ discard block |
||
185 | 187 | |
186 | 188 | if (($this->super_admin == 1) || (in_array($droit_acces, $liste_droit_acces))) { |
187 | 189 | return true; |
188 | - } |
|
189 | - else { |
|
190 | + } else { |
|
190 | 191 | return false; |
191 | 192 | } |
192 | 193 | } |
@@ -21,8 +21,7 @@ discard block |
||
21 | 21 | foreach ($query as $obj) { |
22 | 22 | $params = $obj->mdp_params; |
23 | 23 | } |
24 | - } |
|
25 | - else { |
|
24 | + } else { |
|
26 | 25 | $params = self::$params; |
27 | 26 | } |
28 | 27 | |
@@ -74,8 +73,7 @@ discard block |
||
74 | 73 | |
75 | 74 | if ($id_identite != null) { |
76 | 75 | self::setSaveParams("$taille_bout1, $debut_bout2, $nb_aleatoire_mdp, $taille_bout2, $debut_bout1, ".ChaineCaractere::random(20), $id_identite); |
77 | - } |
|
78 | - else { |
|
76 | + } else { |
|
79 | 77 | self::$params = "$taille_bout1, $debut_bout2, $nb_aleatoire_mdp, $taille_bout2, $debut_bout1, ".ChaineCaractere::random(20); |
80 | 78 | } |
81 | 79 |
@@ -76,8 +76,7 @@ |
||
76 | 76 | |
77 | 77 | if ($id_page != 0) { |
78 | 78 | $query = $dbc->query("SELECT balise_title, meta_description, ID_page FROM page WHERE ID_page=".$id_page); |
79 | - } |
|
80 | - else { |
|
79 | + } else { |
|
81 | 80 | $query = $dbc->query("SELECT balise_title, meta_description, ID_page FROM page WHERE url LIKE '$url'"); |
82 | 81 | } |
83 | 82 |
@@ -51,8 +51,7 @@ discard block |
||
51 | 51 | if ($query) { |
52 | 52 | $obj = $query->fetchAll(PDO::FETCH_OBJ); |
53 | 53 | return $obj; |
54 | - } |
|
55 | - else { |
|
54 | + } else { |
|
56 | 55 | FlashMessage::setFlash("Une erreur est survenue en executant cette requette : ".$req); |
57 | 56 | } |
58 | 57 | } |
@@ -71,8 +70,7 @@ discard block |
||
71 | 70 | $err = true; |
72 | 71 | } |
73 | 72 | } |
74 | - } |
|
75 | - else { |
|
73 | + } else { |
|
76 | 74 | if (!$query->execute($value)) { |
77 | 75 | $err = true; |
78 | 76 | } |
@@ -94,8 +92,7 @@ discard block |
||
94 | 92 | public function rechercherEgalite($table, $champ, $value, $id_table = null, $id = null) { |
95 | 93 | if ($id == null) { |
96 | 94 | $query = $this->getPdo()->query("SELECT COUNT($champ) as nb FROM $table WHERE $champ LIKE '$value'"); |
97 | - } |
|
98 | - else { |
|
95 | + } else { |
|
99 | 96 | $query = $this->getPdo()->query("SELECT COUNT($champ) as nb FROM $table WHERE $champ LIKE '$value' AND $id_table != $id"); |
100 | 97 | } |
101 | 98 | |
@@ -104,9 +101,10 @@ discard block |
||
104 | 101 | $nb = $obj["nb"]; |
105 | 102 | } |
106 | 103 | |
107 | - if ((isset($nb)) && ($nb != 0)) return true; |
|
108 | - } |
|
109 | - else { |
|
104 | + if ((isset($nb)) && ($nb != 0)) { |
|
105 | + return true; |
|
106 | + } |
|
107 | + } else { |
|
110 | 108 | return false; |
111 | 109 | } |
112 | 110 | } |
@@ -123,8 +121,7 @@ discard block |
||
123 | 121 | |
124 | 122 | if ($query->rowCount() > 0) { |
125 | 123 | return true; |
126 | - } |
|
127 | - else { |
|
124 | + } else { |
|
128 | 125 | return false; |
129 | 126 | } |
130 | 127 | } |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | * pour intialiser la ou les clauses where d'une requete |
112 | 112 | */ |
113 | 113 | public function where($champ, $cond, $champ_test, $closure = null) { |
114 | - if ( $closure === null) { |
|
114 | + if ($closure === null) { |
|
115 | 115 | $this->conditions[] = $champ.$cond.$champ_test; |
116 | 116 | } |
117 | 117 | else { |
@@ -127,10 +127,10 @@ discard block |
||
127 | 127 | * fonction qui permet de récupérer un select fait sur une table |
128 | 128 | */ |
129 | 129 | public function get() { |
130 | - $requete = $this->req_beginning . implode(",", $this->champs) . " FROM " . implode(",", $this->table); |
|
130 | + $requete = $this->req_beginning.implode(",", $this->champs)." FROM ".implode(",", $this->table); |
|
131 | 131 | |
132 | 132 | if (!empty($this->conditions)) { |
133 | - $requete .= " WHERE ". implode(" ", $this->conditions); |
|
133 | + $requete .= " WHERE ".implode(" ", $this->conditions); |
|
134 | 134 | } |
135 | 135 | |
136 | 136 | $this->unsetQueryBuilder(); |
@@ -145,15 +145,15 @@ discard block |
||
145 | 145 | |
146 | 146 | $datas = []; |
147 | 147 | $count = count($this->champs); |
148 | - for ($i=0 ; $i<$count ; $i++) { |
|
148 | + for ($i = 0; $i < $count; $i++) { |
|
149 | 149 | $datas[] = $this->champs[$i]."=:".$this->champs[$i]; |
150 | 150 | } |
151 | 151 | |
152 | 152 | //si on a des conditions alors on sera dans un insert |
153 | - $requete = $this->req_beginning . implode(",", $this->table) . " SET " . implode(", ", $datas); |
|
153 | + $requete = $this->req_beginning.implode(",", $this->table)." SET ".implode(", ", $datas); |
|
154 | 154 | |
155 | 155 | if (!empty($this->conditions)) { |
156 | - $requete .= " WHERE " . implode(" ", $this->conditions); |
|
156 | + $requete .= " WHERE ".implode(" ", $this->conditions); |
|
157 | 157 | } |
158 | 158 | |
159 | 159 | $this->prepare($requete, $values); |
@@ -164,10 +164,10 @@ discard block |
||
164 | 164 | * fonction utilisée pour finir un delete |
165 | 165 | */ |
166 | 166 | public function del() { |
167 | - $requete = $this->req_beginning . implode(",", $this->table); |
|
167 | + $requete = $this->req_beginning.implode(",", $this->table); |
|
168 | 168 | |
169 | 169 | if (!empty($this->conditions)) { |
170 | - $requete .= " WHERE " . implode(" ", $this->conditions); |
|
170 | + $requete .= " WHERE ".implode(" ", $this->conditions); |
|
171 | 171 | } |
172 | 172 | |
173 | 173 | $this->query($requete); |
@@ -76,8 +76,7 @@ |
||
76 | 76 | |
77 | 77 | if ($id_page != 0) { |
78 | 78 | $query = $dbc->query("SELECT balise_title, meta_description, ID_page FROM page WHERE ID_page=".$id_page); |
79 | - } |
|
80 | - else { |
|
79 | + } else { |
|
81 | 80 | $query = $dbc->query("SELECT balise_title, meta_description, ID_page FROM page WHERE url LIKE '$url'"); |
82 | 81 | } |
83 | 82 |