@@ -59,8 +59,7 @@ discard block |
||
59 | 59 | |
60 | 60 | $this->setListeDroitAcces($id_liste_droit_acces, $nom_liste, $nb_droit_acces, $nb_droit_acces_page, $nb_user); |
61 | 61 | } |
62 | - } |
|
63 | - else { |
|
62 | + } else { |
|
64 | 63 | $this->id_liste_droit_acces = $id_liste_droit_acces; |
65 | 64 | } |
66 | 65 | } |
@@ -118,7 +117,9 @@ discard block |
||
118 | 117 | public function getListeDroitAccesDetailDroit($id_liste_droit_acces=null){ |
119 | 118 | $dbc = \core\App::getDb(); |
120 | 119 | |
121 | - if ($id_liste_droit_acces == null) $id_liste_droit_acces = $this->id_liste_droit_acces; |
|
120 | + if ($id_liste_droit_acces == null) { |
|
121 | + $id_liste_droit_acces = $this->id_liste_droit_acces; |
|
122 | + } |
|
122 | 123 | |
123 | 124 | $query = $dbc->query("SELECT * FROM droit_acces, liaison_liste_droit WHERE |
124 | 125 | droit_acces.ID_droit_acces = liaison_liste_droit.ID_droit_acces AND |
@@ -139,7 +140,9 @@ discard block |
||
139 | 140 | public function getListeDroitAccesDetailUser($id_liste_droit_acces=null) { |
140 | 141 | $dbc = \core\App::getDb(); |
141 | 142 | |
142 | - if ($id_liste_droit_acces == null) $id_liste_droit_acces = $this->id_liste_droit_acces; |
|
143 | + if ($id_liste_droit_acces == null) { |
|
144 | + $id_liste_droit_acces = $this->id_liste_droit_acces; |
|
145 | + } |
|
143 | 146 | |
144 | 147 | //récupératin des utilisateurs qui sont dans cette liste |
145 | 148 | $query = $dbc->query("SELECT * FROM identite WHERE liste_droit=".$id_liste_droit_acces); |
@@ -162,7 +165,9 @@ discard block |
||
162 | 165 | public function getListeDroitAccesDetailPage($id_liste_droit_acces=null){ |
163 | 166 | $dbc = \core\App::getDb(); |
164 | 167 | |
165 | - if ($id_liste_droit_acces == null) $id_liste_droit_acces = $this->id_liste_droit_acces; |
|
168 | + if ($id_liste_droit_acces == null) { |
|
169 | + $id_liste_droit_acces = $this->id_liste_droit_acces; |
|
170 | + } |
|
166 | 171 | |
167 | 172 | //récupération des droits d'acces pour les pages |
168 | 173 | $query = $dbc->query("SELECT * FROM liste_droit_acces, droit_acces_page, page WHERE |
@@ -50,29 +50,29 @@ |
||
50 | 50 | |
51 | 51 | |
52 | 52 | //-------------------------- GETTER ----------------------------------------------------------------------------// |
53 | - public function getLogged(){ |
|
53 | + public function getLogged() { |
|
54 | 54 | return $this->logged; |
55 | 55 | } |
56 | - public function getSuperAdmin(){ |
|
56 | + public function getSuperAdmin() { |
|
57 | 57 | return $this->super_admin; |
58 | 58 | } |
59 | 59 | |
60 | 60 | //pour la table liste_droit_acces |
61 | - public function getIdListeDroitAcces(){ |
|
61 | + public function getIdListeDroitAcces() { |
|
62 | 62 | return $this->id_liste_droit_acces; |
63 | 63 | } |
64 | 64 | |
65 | 65 | //pour les droits sur la gestion des contenus |
66 | - public function getModifSeo(){ |
|
66 | + public function getModifSeo() { |
|
67 | 67 | return $this->modif_seo; |
68 | 68 | } |
69 | - public function getModifContenu(){ |
|
69 | + public function getModifContenu() { |
|
70 | 70 | return $this->modif_contenu; |
71 | 71 | } |
72 | - public function getModifNavigation(){ |
|
72 | + public function getModifNavigation() { |
|
73 | 73 | return $this->modif_navigation; |
74 | 74 | } |
75 | - public function getSupprimerPage(){ |
|
75 | + public function getSupprimerPage() { |
|
76 | 76 | return $this->supprimer_page; |
77 | 77 | } |
78 | 78 |
@@ -37,8 +37,7 @@ discard block |
||
37 | 37 | $this->id_liste_droit_acces = $obj->liste_droit; |
38 | 38 | } |
39 | 39 | } |
40 | - } |
|
41 | - else { |
|
40 | + } else { |
|
42 | 41 | $this->logged = false; |
43 | 42 | } |
44 | 43 | } |
@@ -84,7 +83,9 @@ discard block |
||
84 | 83 | "); |
85 | 84 | |
86 | 85 | if ((is_array($query)) && (count($query) > 0)) { |
87 | - foreach ($query as $obj) $liste_droit_acces[] = $obj->droit_acces; |
|
86 | + foreach ($query as $obj) { |
|
87 | + $liste_droit_acces[] = $obj->droit_acces; |
|
88 | + } |
|
88 | 89 | } |
89 | 90 | |
90 | 91 | return $liste_droit_acces; |
@@ -99,7 +100,9 @@ discard block |
||
99 | 100 | |
100 | 101 | $query = $dbc->query("SELECT droit_acces FROM droit_acces WHERE page LIKE '%$page%'"); |
101 | 102 | if ((is_array($query)) && (count($query) > 0)) { |
102 | - foreach ($query as $obj) $droit_acces = $obj->droit_acces; |
|
103 | + foreach ($query as $obj) { |
|
104 | + $droit_acces = $obj->droit_acces; |
|
105 | + } |
|
103 | 106 | } |
104 | 107 | |
105 | 108 | return $droit_acces; |
@@ -149,8 +152,7 @@ discard block |
||
149 | 152 | |
150 | 153 | if (($this->super_admin == 1) || (in_array($this->getListeDroitPage($page), $this->getListeDroitAcces())) || (($page == "") || ($page == null)) || (in_array($page, $all_access))) { |
151 | 154 | return true; |
152 | - } |
|
153 | - else { |
|
155 | + } else { |
|
154 | 156 | return false; |
155 | 157 | } |
156 | 158 | } |
@@ -173,8 +175,7 @@ discard block |
||
173 | 175 | //si les trois sont différent de 0 on renvoit true soinon false |
174 | 176 | if (($this->super_admin == 1) || ((in_array($droit, $liste_droit_acces)) && (($this->modif_seo != 0) || ($this->modif_contenu != 0) || ($this->modif_navigation != 0) || ($this->supprimer_page != 0)))) { |
175 | 177 | return true; |
176 | - } |
|
177 | - else { |
|
178 | + } else { |
|
178 | 179 | return false; |
179 | 180 | } |
180 | 181 | } |
@@ -189,8 +190,7 @@ discard block |
||
189 | 190 | |
190 | 191 | if (($this->super_admin == 1) || (in_array($droit_acces, $liste_droit_acces))) { |
191 | 192 | return true; |
192 | - } |
|
193 | - else { |
|
193 | + } else { |
|
194 | 194 | return false; |
195 | 195 | } |
196 | 196 | } |
@@ -51,8 +51,7 @@ discard block |
||
51 | 51 | |
52 | 52 | if ($archiver == null) { |
53 | 53 | $query = $dbc->query("SELECT * FROM identite WHERE archiver IS NULL AND ID_identite > 1"); |
54 | - } |
|
55 | - else { |
|
54 | + } else { |
|
56 | 55 | $query = $dbc->query("SELECT * FROM identite WHERE archiver IS NOT NULL AND ID_identite > 1"); |
57 | 56 | } |
58 | 57 | |
@@ -77,8 +76,7 @@ discard block |
||
77 | 76 | |
78 | 77 | if (($config->getValiderInscription() == 1) && ($obj->valide == 0)) { |
79 | 78 | $valide[] = "<a href=".ADMWEBROOT."controller/core/admin/comptes/valider_compte?id_identite=$obj->ID_identite>Valider cet utilisateur</a>"; |
80 | - } |
|
81 | - else { |
|
79 | + } else { |
|
82 | 80 | $valide[] = "Utilisateur validé"; |
83 | 81 | } |
84 | 82 | } |
@@ -181,8 +179,7 @@ discard block |
||
181 | 179 | |
182 | 180 | $mail = new Mail($this->mail); |
183 | 181 | $mail->setEnvoyerMail("Réinitialisation de votre E-mail effectuée", "Votre mot de passe a été réinitialisé"); |
184 | - } |
|
185 | - else { |
|
182 | + } else { |
|
186 | 183 | FlashMessage::setFlash("le mot de passe de $this->pseudo ne peu pas être réinitialisé car il ne possède pas d'E-mail"); |
187 | 184 | $this->erreur = true; |
188 | 185 | } |
@@ -30,8 +30,7 @@ discard block |
||
30 | 30 | identite.ID_identite = $id_identite |
31 | 31 | ORDER BY page.ordre |
32 | 32 | "); |
33 | - } |
|
34 | - else { |
|
33 | + } else { |
|
35 | 34 | $query = $dbc->query("SELECT ID_page, titre, balise_title, parent, url FROM page ORDER BY ordre"); |
36 | 35 | } |
37 | 36 | |
@@ -65,7 +64,9 @@ discard block |
||
65 | 64 | |
66 | 65 | $query = $dbc->query("SELECT titre FROM page WHERE ID_page=".$parent); |
67 | 66 | if ((is_array($query)) && (count($query) > 0)) { |
68 | - foreach ($query as $obj) $this->parent_texte = $obj->titre; |
|
67 | + foreach ($query as $obj) { |
|
68 | + $this->parent_texte = $obj->titre; |
|
69 | + } |
|
69 | 70 | } |
70 | 71 | |
71 | 72 | return $this->parent_texte; |
@@ -145,13 +146,11 @@ discard block |
||
145 | 146 | |
146 | 147 | $dbc->prepare("INSERT INTO page (titre, contenu, url, meta_description, balise_title, ordre, parent, affiche) VALUES (:titre, :contenu, :url, :meta_description, :balise_title, :ordre, :parent, :affiche)", $value); |
147 | 148 | $this->id_page = $dbc->lastInsertId(); |
148 | - } |
|
149 | - else { |
|
149 | + } else { |
|
150 | 150 | FlashMessage::setFlash("Impossible de créer cette page, veuillez réeseyer dans un moment. Si le problème persiste contactez votre administrateur."); |
151 | 151 | $this->erreur = true; |
152 | 152 | } |
153 | - } |
|
154 | - else { |
|
153 | + } else { |
|
155 | 154 | $_SESSION['balise_title'] = $balise_title; |
156 | 155 | $_SESSION['url'] = $url; |
157 | 156 | $_SESSION['meta_description'] = $meta_description; |
@@ -222,8 +221,7 @@ discard block |
||
222 | 221 | ); |
223 | 222 | |
224 | 223 | $dbc->prepare("UPDATE page SET titre=:titre_page, contenu=:contenu, url=:url, meta_description=:meta_description, balise_title=:balise_title, parent=:parent WHERE ID_page=:id_page", $value); |
225 | - } |
|
226 | - else { |
|
224 | + } else { |
|
227 | 225 | $_SESSION['balise_title'] = $balise_title; |
228 | 226 | $_SESSION['url'] = $url; |
229 | 227 | $_SESSION['meta_description'] = $meta_description; |
@@ -272,8 +270,7 @@ discard block |
||
272 | 270 | FlashMessage::setFlash("Impossible de supprimer cette page, veuillez contacter votre administrateur pour corriger ce problème"); |
273 | 271 | $this->erreur = true; |
274 | 272 | } |
275 | - } |
|
276 | - else { |
|
273 | + } else { |
|
277 | 274 | FlashMessage::setFlash("Impossible de supprimer cette page, veuillez contacter votre administrateur pour corriger ce problème"); |
278 | 275 | $this->erreur = true; |
279 | 276 | } |
@@ -36,17 +36,14 @@ discard block |
||
36 | 36 | if (($required != null) && ($this->getTestRequired($value) === false)) { |
37 | 37 | $this->erreur .= "<li>Le champs accès administration ne peut pas être vide</li>"; |
38 | 38 | return false; |
39 | - } |
|
40 | - else { |
|
39 | + } else { |
|
41 | 40 | if (($value != "") && ($this->getTestInt($value) === true)) { |
42 | 41 | $this->acces_administration = $value; |
43 | 42 | return true; |
44 | - } |
|
45 | - else if (($value != "") && ($this->getTestInt($value) === false)) { |
|
43 | + } else if (($value != "") && ($this->getTestInt($value) === false)) { |
|
46 | 44 | $this->erreur .= "<li>Le champs accès administration n'est pas au bon format</li>"; |
47 | 45 | return false; |
48 | - } |
|
49 | - else { |
|
46 | + } else { |
|
50 | 47 | return true; |
51 | 48 | } |
52 | 49 | } |
@@ -64,17 +61,14 @@ discard block |
||
64 | 61 | if (($required != null) && ($this->getTestRequired($value) === false)) { |
65 | 62 | $this->erreur .= "<li>Le champs accès administration ne peut pas être vide</li>"; |
66 | 63 | return false; |
67 | - } |
|
68 | - else { |
|
64 | + } else { |
|
69 | 65 | if (($value != "") && ($this->getTestInt($value) === true)) { |
70 | 66 | $this->id_liste_droit_acces = $value; |
71 | 67 | return true; |
72 | - } |
|
73 | - else if (($value != "") && ($this->getTestInt($value) === false)) { |
|
68 | + } else if (($value != "") && ($this->getTestInt($value) === false)) { |
|
74 | 69 | $this->erreur .= "<li>Le champs accès administration n'est pas au bon format</li>"; |
75 | 70 | return false; |
76 | - } |
|
77 | - else { |
|
71 | + } else { |
|
78 | 72 | return true; |
79 | 73 | } |
80 | 74 | } |
@@ -132,8 +132,7 @@ |
||
132 | 132 | foreach ($query as $obj) { |
133 | 133 | if ($obj->activer == 1) { |
134 | 134 | return true; |
135 | - } |
|
136 | - else { |
|
135 | + } else { |
|
137 | 136 | return false; |
138 | 137 | } |
139 | 138 | } |
@@ -64,8 +64,7 @@ discard block |
||
64 | 64 | //si pas de version a checker, cela veut dire qu'on vient d'installer le module |
65 | 65 | //du coup on met le next_check aa la semaine pro |
66 | 66 | $set_next = true; |
67 | - } |
|
68 | - else if (($obj->next_check_version <= $today) && ($obj->mettre_jour != 1)) { |
|
67 | + } else if (($obj->next_check_version <= $today) && ($obj->mettre_jour != 1)) { |
|
69 | 68 | //avant tout on regarde si on doit delete une vieille version |
70 | 69 | if ($obj->delete_old_version == 1) { |
71 | 70 | $import = new ImportModule(); |
@@ -102,8 +101,7 @@ discard block |
||
102 | 101 | $dbc->prepare("UPDATE module SET mettre_jour=:update, online_version=:online_version WHERE ID_module=:id_module", $value); |
103 | 102 | |
104 | 103 | $set_next = true; |
105 | - } |
|
106 | - else { |
|
104 | + } else { |
|
107 | 105 | $set_next = true; |
108 | 106 | } |
109 | 107 | } |
@@ -20,8 +20,7 @@ discard block |
||
20 | 20 | |
21 | 21 | if (isset($datas[$i][2])) { |
22 | 22 | $this->$function($datas[$i][1], $datas[$i][2]); |
23 | - } |
|
24 | - else { |
|
23 | + } else { |
|
25 | 24 | $this->$function($datas[$i][1]); |
26 | 25 | } |
27 | 26 | } |
@@ -54,8 +53,7 @@ discard block |
||
54 | 53 | protected function getTestRequired($value) { |
55 | 54 | if (($value == "") || ($value == null) || (strlen($value) == 0)) { |
56 | 55 | return false; |
57 | - } |
|
58 | - else { |
|
56 | + } else { |
|
59 | 57 | return true; |
60 | 58 | } |
61 | 59 | } |
@@ -68,8 +66,7 @@ discard block |
||
68 | 66 | protected function getTestLongueur($value, $longeur) { |
69 | 67 | if (strlen($value) > $longeur) { |
70 | 68 | return true; |
71 | - } |
|
72 | - else { |
|
69 | + } else { |
|
73 | 70 | return false; |
74 | 71 | } |
75 | 72 | } |
@@ -81,8 +78,7 @@ discard block |
||
81 | 78 | protected function getTestInt($value) { |
82 | 79 | if (is_numeric($value)) { |
83 | 80 | return true; |
84 | - } |
|
85 | - else { |
|
81 | + } else { |
|
86 | 82 | return false; |
87 | 83 | } |
88 | 84 | } |
@@ -100,12 +96,10 @@ discard block |
||
100 | 96 | if (($required != null) && ($this->getTestRequired($value) === false)) { |
101 | 97 | $this->erreur .= "<li>$erreur</li>"; |
102 | 98 | return false; |
103 | - } |
|
104 | - else if (($value != "") && ($this->getTestLongueur($value, 2) === false)) { |
|
99 | + } else if (($value != "") && ($this->getTestLongueur($value, 2) === false)) { |
|
105 | 100 | $this->erreur .= "<li>$erreur_long</li>"; |
106 | 101 | return false; |
107 | - } |
|
108 | - else { |
|
102 | + } else { |
|
109 | 103 | $this->$varaible = $value; |
110 | 104 | return true; |
111 | 105 | } |
@@ -153,8 +147,7 @@ discard block |
||
153 | 147 | protected function setVerifRetapeMdp($value) { |
154 | 148 | if ($this->mdp == $value) { |
155 | 149 | return true; |
156 | - } |
|
157 | - else { |
|
150 | + } else { |
|
158 | 151 | $this->erreur .= "<li>Les mots de passent ne correspondent pas</li>"; |
159 | 152 | $this->mdp = null; |
160 | 153 | return false; |
@@ -182,12 +175,10 @@ discard block |
||
182 | 175 | if (($required != null) && ($this->getTestRequired($value) === false)) { |
183 | 176 | $this->erreur .= "<li>Le champs E-mail ne peut pas être vide</li>"; |
184 | 177 | return false; |
185 | - } |
|
186 | - else if (($value != "") && (filter_var($value, FILTER_VALIDATE_EMAIL) == false)) { |
|
178 | + } else if (($value != "") && (filter_var($value, FILTER_VALIDATE_EMAIL) == false)) { |
|
187 | 179 | $this->erreur .= "<li>Le champs E-mail doit être une adresse E-mail valide</li>"; |
188 | 180 | return false; |
189 | - } |
|
190 | - else { |
|
181 | + } else { |
|
191 | 182 | $this->mail = $value; |
192 | 183 | return true; |
193 | 184 | } |