@@ -51,15 +51,15 @@ |
||
51 | 51 | * @param $url_module |
52 | 52 | * fonction qui permets d'importer un module dans notre site internet |
53 | 53 | */ |
54 | - public function setImportModule($url_module, $update=null) { |
|
55 | - $dbc= App::getDb(); |
|
54 | + public function setImportModule($url_module, $update = null) { |
|
55 | + $dbc = App::getDb(); |
|
56 | 56 | |
57 | 57 | //avant tout on récupère le nom du fichier pour le mettre dans le dossier temporaire |
58 | 58 | $explode = explode("/", $url_module); |
59 | 59 | $this->nom_fichier = end($explode); |
60 | 60 | |
61 | 61 | //on recupere le nom du dossier + extention |
62 | - $explode = explode(".", $this->nom_fichier); |
|
62 | + $explode = explode(".", $this->nom_fichier); |
|
63 | 63 | $this->nom_dossier = $explode[0]; |
64 | 64 | $this->extension = $explode[1]; |
65 | 65 |
@@ -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 | |
@@ -81,19 +85,16 @@ discard block |
||
81 | 85 | |
82 | 86 | |
83 | 87 | FlashMessage::setFlash("Votre module a bien été ajouté au site.", "success"); |
84 | - } |
|
85 | - else { |
|
88 | + } else { |
|
86 | 89 | \core\HTML\flashmessage\FlashMessage::setFlash("Erreur lors du téléchargement du module, veuillez réessayer dans un instant."); |
87 | 90 | $this->erreur = true; |
88 | 91 | } |
89 | - } |
|
90 | - else { |
|
92 | + } else { |
|
91 | 93 | \core\HTML\flashmessage\FlashMessage::setFlash("Erreur lors du téléchargement du module, veuillez réessayer dans un instant."); |
92 | 94 | $this->setSupprimerArchiveTemp(); |
93 | 95 | $this->erreur = true; |
94 | 96 | } |
95 | - } |
|
96 | - else { |
|
97 | + } else { |
|
97 | 98 | \core\HTML\flashmessage\FlashMessage::setFlash("Erreur lors du téléchargement du module, veuillez réessayer dans un instant."); |
98 | 99 | $this->setSupprimerArchiveTemp(); |
99 | 100 | $this->erreur = true; |
@@ -101,18 +102,15 @@ discard block |
||
101 | 102 | |
102 | 103 | $zip->close(); |
103 | 104 | $this->setSupprimerArchiveTemp(); |
104 | - } |
|
105 | - else { |
|
105 | + } else { |
|
106 | 106 | FlashMessage::setFlash("Le module n'a pas pu être correctement téléchargé, veuillez réesseyer dans un instant"); |
107 | 107 | $this->erreur = true; |
108 | 108 | } |
109 | - } |
|
110 | - else { |
|
109 | + } else { |
|
111 | 110 | FlashMessage::setFlash("Ce module est déjà présent sur ce site, merci de renommer votre module"); |
112 | 111 | $this->erreur = true; |
113 | 112 | } |
114 | - } |
|
115 | - else { |
|
113 | + } else { |
|
116 | 114 | FlashMessage::setFlash("Le format de votre archive doit obligatoirement être un .zip"); |
117 | 115 | $this->erreur = true; |
118 | 116 | } |
@@ -150,8 +148,7 @@ discard block |
||
150 | 148 | |
151 | 149 | FlashMessage::setFlash("Votre module a bien été mis à jour", "success"); |
152 | 150 | } |
153 | - } |
|
154 | - else { |
|
151 | + } else { |
|
155 | 152 | FlashMessage::setFlash("Impossible de télécharger la mise à jour, veuillez réesseyer dans un instant"); |
156 | 153 | } |
157 | 154 | } |
@@ -163,8 +160,7 @@ discard block |
||
163 | 160 | private function setSupprimerArchiveTemp() { |
164 | 161 | if (unlink(TEMPROOT.$this->nom_fichier) == true) { |
165 | 162 | return true; |
166 | - } |
|
167 | - else { |
|
163 | + } else { |
|
168 | 164 | return false; |
169 | 165 | } |
170 | 166 | } |
@@ -191,8 +187,7 @@ discard block |
||
191 | 187 | ); |
192 | 188 | |
193 | 189 | $dbc->prepare("UPDATE module SET activer=:activer, installer=:installer WHERE ID_module=:id_module", $value); |
194 | - } |
|
195 | - else { |
|
190 | + } else { |
|
196 | 191 | $value = array( |
197 | 192 | "id_module" => $id_module, |
198 | 193 | ); |
@@ -234,7 +229,11 @@ discard block |
||
234 | 229 | $objects = scandir($url); |
235 | 230 | foreach ($objects as $object) { |
236 | 231 | if ($object != "." && $object != "..") { |
237 | - if (filetype($url."/".$object) == "dir") $this->supprimerDossier($url."/".$object); else unlink($url."/".$object); |
|
232 | + if (filetype($url."/".$object) == "dir") { |
|
233 | + $this->supprimerDossier($url."/".$object); |
|
234 | + } else { |
|
235 | + unlink($url."/".$object); |
|
236 | + } |
|
238 | 237 | } |
239 | 238 | } |
240 | 239 | reset($objects); |
@@ -48,10 +48,10 @@ discard block |
||
48 | 48 | * @param $url |
49 | 49 | * @return string |
50 | 50 | */ |
51 | - public function getUrl($url){ |
|
51 | + public function getUrl($url) { |
|
52 | 52 | $explode = explode("/", $url); |
53 | 53 | |
54 | - for ($i=0 ; $i<count($explode) ; $i++) { |
|
54 | + for ($i = 0; $i < count($explode); $i++) { |
|
55 | 55 | if (in_array($explode[$i], $this->getAllModules())) { |
56 | 56 | $this->module = $explode[$i]; |
57 | 57 | $debut_url = $explode[$i]; |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | |
86 | 86 | $query = $dbc->query("SELECT * FROM module"); |
87 | 87 | |
88 | - foreach($query as $obj) { |
|
88 | + foreach ($query as $obj) { |
|
89 | 89 | $test_module = ChaineCaractere::FindInString($url, $obj->url); |
90 | 90 | $test_module1 = ChaineCaractere::FindInString($url, str_replace("/", "", $obj->url)); |
91 | 91 | $module_activer = \core\modules\GestionModule::getModuleActiver($obj->nom_module); |
@@ -55,12 +55,10 @@ discard block |
||
55 | 55 | if (in_array($explode[$i], $this->getAllModules())) { |
56 | 56 | $this->module = $explode[$i]; |
57 | 57 | $debut_url = $explode[$i]; |
58 | - } |
|
59 | - else if ($i == 1) { |
|
58 | + } else if ($i == 1) { |
|
60 | 59 | $centre_url = $explode[$i]; |
61 | 60 | $this->page = $explode[$i]; |
62 | - } |
|
63 | - else { |
|
61 | + } else { |
|
64 | 62 | $this->parametre = $explode[$i]; |
65 | 63 | } |
66 | 64 | } |
@@ -93,16 +91,14 @@ discard block |
||
93 | 91 | if ((($test_module == true) || ($test_module1 == true)) && ($module_activer == true)) { |
94 | 92 | $error = false; |
95 | 93 | break; |
96 | - } |
|
97 | - else { |
|
94 | + } else { |
|
98 | 95 | $error = true; |
99 | 96 | } |
100 | 97 | } |
101 | 98 | |
102 | 99 | if ($error == true) { |
103 | 100 | return false; |
104 | - } |
|
105 | - else { |
|
101 | + } else { |
|
106 | 102 | return true; |
107 | 103 | } |
108 | 104 | } |
@@ -18,7 +18,7 @@ discard block |
||
18 | 18 | |
19 | 19 | |
20 | 20 | //-------------------------- CONSTRUCTEUR ----------------------------------------------------------------------------// |
21 | - public function __construct($init_all=0) { |
|
21 | + public function __construct($init_all = 0) { |
|
22 | 22 | $dbc = \core\App::getDb(); |
23 | 23 | |
24 | 24 | if ($init_all == 1) { |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | * pour récupérer l'en tete d'une page (balise title ++ meta description) |
72 | 72 | * @param $id_page |
73 | 73 | */ |
74 | - public function getHeadPage($id_page, $url=null) { |
|
74 | + public function getHeadPage($id_page, $url = null) { |
|
75 | 75 | $dbc = \core\App::getDb(); |
76 | 76 | |
77 | 77 | if ($id_page != 0) { |
@@ -94,7 +94,7 @@ discard block |
||
94 | 94 | * pour récupérer une page en particulier |
95 | 95 | * @param $id_page |
96 | 96 | */ |
97 | - public function getContenuPage($id_page=null) { |
|
97 | + public function getContenuPage($id_page = null) { |
|
98 | 98 | $dbc = \core\App::getDb(); |
99 | 99 | |
100 | 100 | if ($id_page == null) { |
@@ -120,7 +120,7 @@ discard block |
||
120 | 120 | |
121 | 121 | |
122 | 122 | //-------------------------- SETTER ----------------------------------------------------------------------------// |
123 | - protected function setMenu($id_page, $titre, $balise_title, $url, $parent ){ |
|
123 | + protected function setMenu($id_page, $titre, $balise_title, $url, $parent) { |
|
124 | 124 | $this->id_page = $id_page; |
125 | 125 | $this->titre = $titre; |
126 | 126 | $this->balise_title = $balise_title; |
@@ -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 |
@@ -1,7 +1,9 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | //error_reporting(E_ALL ^ E_NOTICE); |
3 | 3 | |
4 | - if (!isset($page_root)) $page_root = "index.php"; |
|
4 | + if (!isset($page_root)) { |
|
5 | + $page_root = "index.php"; |
|
6 | + } |
|
5 | 7 | |
6 | 8 | //-------------------------- CONSTANTE POUR LES ROUTES ----------------------------------------------------------------------------// |
7 | 9 | //definit le chemin vers la racine du projet (depuis racine serveur web |
@@ -48,15 +50,13 @@ discard block |
||
48 | 50 | if ($ini["installation"] == 1) { |
49 | 51 | header("location:".WEBROOT."installation"); |
50 | 52 | } |
51 | - } |
|
52 | - else { |
|
53 | + } else { |
|
53 | 54 | header("location:".WEBROOT."installation"); |
54 | 55 | } |
55 | 56 | |
56 | 57 | if ($ini["developpment"] == 1) { |
57 | 58 | $tab = "dev"; |
58 | - } |
|
59 | - else { |
|
59 | + } else { |
|
60 | 60 | $tab = "prod"; |
61 | 61 | } |
62 | 62 |
@@ -1,4 +1,4 @@ |
||
1 | -<?=\core\HTML\flashmessage\FlashMessage::getFlash();?> |
|
1 | +<?=\core\HTML\flashmessage\FlashMessage::getFlash(); ?> |
|
2 | 2 | <header> |
3 | 3 | <div class="inner"> |
4 | 4 | <h1>Mon compte</h1> |
@@ -3,7 +3,7 @@ |
||
3 | 3 | <h1>Gestion des droits d'accès | modifier la liste : </h1> |
4 | 4 | </div> |
5 | 5 | </header> |
6 | -<?php include("header.php");?> |
|
6 | +<?php include("header.php"); ?> |
|
7 | 7 | |
8 | 8 | <form action="<?=ADMWEBROOT?>controller/core/admin/modules/blog/article/modifier" method="post"> |
9 | 9 | <button type="submit" class="submit-contenu" type="submit"><i class="fa fa-pencil"></i>Modifier</button> |
@@ -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 |
@@ -38,8 +38,7 @@ discard block |
||
38 | 38 | |
39 | 39 | if ($obj->img_profil == "") { |
40 | 40 | $this->img = $this->debut_lien."defaut.png"; |
41 | - } |
|
42 | - else { |
|
41 | + } else { |
|
43 | 42 | $this->img = $obj->img_profil; |
44 | 43 | } |
45 | 44 | } |
@@ -101,8 +100,7 @@ discard block |
||
101 | 100 | $oldimg_profil = explode("/", $oldimg_profil); |
102 | 101 | if(end($oldimg_profil) == "defaut.png") { |
103 | 102 | |
104 | - } |
|
105 | - else { |
|
103 | + } else { |
|
106 | 104 | unlink("../../images/profil/".end($oldimg_profil)); |
107 | 105 | |
108 | 106 | } |
@@ -127,16 +125,13 @@ discard block |
||
127 | 125 | if (strlen($new_pseudo) < 5) { |
128 | 126 | $err = "Votre pseudo est trop court"; |
129 | 127 | $this->erreur = $err; |
130 | - } |
|
131 | - else if (strlen($new_pseudo) > 15) { |
|
128 | + } else if (strlen($new_pseudo) > 15) { |
|
132 | 129 | $err = "Votre pseudo est trop long"; |
133 | 130 | $this->erreur = $err; |
134 | - } |
|
135 | - else if ($new_pseudo == $pseudo_bdd) { |
|
131 | + } else if ($new_pseudo == $pseudo_bdd) { |
|
136 | 132 | $err = "Ce pseudo est déjà utilisé, veuillez en choisir un autre"; |
137 | 133 | $this->erreur = $err; |
138 | - } |
|
139 | - else { |
|
134 | + } else { |
|
140 | 135 | $dbc->query("UPDATE identite set pseudo=$new_pseudo WHERE ID_identite=".$_SESSION["idlogin".CLEF_SITE]); |
141 | 136 | $this->pseudo = $new_pseudo; |
142 | 137 | } |
@@ -157,24 +152,20 @@ discard block |
||
157 | 152 | if (md5($old_mdp) != $mdp) { |
158 | 153 | $err = "Votre mot de passe est incorrect"; |
159 | 154 | $this->erreur = $err; |
160 | - } |
|
161 | - else { |
|
155 | + } else { |
|
162 | 156 | if ($new_mdp != $verif_new_mdp) { |
163 | 157 | $err = "Vos mots de passe sont différents"; |
164 | 158 | $this->erreur = $err; |
165 | - } |
|
166 | - else { |
|
159 | + } else { |
|
167 | 160 | $testmdp = $this->testpassword($new_mdp); |
168 | 161 | |
169 | 162 | if (strlen($new_mdp) < 5) { |
170 | 163 | $err = "Votre mot de passe est trop court"; |
171 | 164 | $this->erreur = $err; |
172 | - } |
|
173 | - else if ($testmdp < 40) { |
|
165 | + } else if ($testmdp < 40) { |
|
174 | 166 | $err = "Votre mot de passe est trop simple"; |
175 | 167 | $this->erreur = $err; |
176 | - } |
|
177 | - else { |
|
168 | + } else { |
|
178 | 169 | $mdpok = Encrypt::setEncryptMdp($new_mdp, $this->id_identite); |
179 | 170 | //le nouveau mdp est bon on update |
180 | 171 | $dbc->query("UPDATE identite SET mdp='$mdpok' WHERE ID_identite=".$this->id_identite); |
@@ -204,16 +195,13 @@ discard block |
||
204 | 195 | if ($lettre >= 'a' && $lettre <= 'z') { |
205 | 196 | $point = $point + 1; |
206 | 197 | $point_min = 1; |
207 | - } |
|
208 | - else if ($lettre >= 'A' && $lettre <= 'Z'){ |
|
198 | + } else if ($lettre >= 'A' && $lettre <= 'Z'){ |
|
209 | 199 | $point = $point + 2; |
210 | 200 | $point_maj = 2; |
211 | - } |
|
212 | - else if ($lettre >= '0' && $lettre <= '9'){ |
|
201 | + } else if ($lettre >= '0' && $lettre <= '9'){ |
|
213 | 202 | $point = $point + 3; |
214 | 203 | $point_chiffre = 3; |
215 | - } |
|
216 | - else { |
|
204 | + } else { |
|
217 | 205 | $point = $point + 5; |
218 | 206 | $point_caracteres = 5; |
219 | 207 | } |
@@ -17,7 +17,7 @@ discard block |
||
17 | 17 | |
18 | 18 | //------------------------------ constructeur----------------------------------- |
19 | 19 | //Récupérer en base de données les infos du membre |
20 | - public function __construct($id_identite=null){ |
|
20 | + public function __construct($id_identite = null) { |
|
21 | 21 | $dbc = \core\App::getDb(); |
22 | 22 | |
23 | 23 | $this->debut_lien = IMGROOT."profil/"; |
@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | /** |
84 | 84 | * @param null $id_identite |
85 | 85 | */ |
86 | - public function setSupprimUser($id_identite=null) { |
|
86 | + public function setSupprimUser($id_identite = null) { |
|
87 | 87 | $dbc = \core\App::getDb(); |
88 | 88 | |
89 | 89 | if ($id_identite == null) { |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | $oldimg_profil = $obj->img_profil; |
98 | 98 | if ($oldimg_profil != "") { |
99 | 99 | $oldimg_profil = explode("/", $oldimg_profil); |
100 | - if(end($oldimg_profil) == "defaut.png") { |
|
100 | + if (end($oldimg_profil) == "defaut.png") { |
|
101 | 101 | |
102 | 102 | } |
103 | 103 | else { |
@@ -192,22 +192,22 @@ discard block |
||
192 | 192 | * @param string $mdp |
193 | 193 | * @return integer |
194 | 194 | */ |
195 | - private function testpassword($mdp) { |
|
195 | + private function testpassword($mdp) { |
|
196 | 196 | $longueur = strlen($mdp); |
197 | 197 | $point = 0; |
198 | 198 | |
199 | - for ($i=0 ; $i<$longueur ; $i++) { |
|
199 | + for ($i = 0; $i < $longueur; $i++) { |
|
200 | 200 | $lettre = $mdp[$i]; |
201 | 201 | |
202 | 202 | if ($lettre >= 'a' && $lettre <= 'z') { |
203 | 203 | $point = $point + 1; |
204 | 204 | $point_min = 1; |
205 | 205 | } |
206 | - else if ($lettre >= 'A' && $lettre <= 'Z'){ |
|
206 | + else if ($lettre >= 'A' && $lettre <= 'Z') { |
|
207 | 207 | $point = $point + 2; |
208 | 208 | $point_maj = 2; |
209 | 209 | } |
210 | - else if ($lettre >= '0' && $lettre <= '9'){ |
|
210 | + else if ($lettre >= '0' && $lettre <= '9') { |
|
211 | 211 | $point = $point + 3; |
212 | 212 | $point_chiffre = 3; |
213 | 213 | } |
@@ -2,6 +2,6 @@ |
||
2 | 2 | include_once(ROOT.'libs/ckeditor/ckeditor.php'); |
3 | 3 | require_once(ROOT.'libs/ckfinder/ckfinder.php'); |
4 | 4 | $ckeditor = new CKEditor(); |
5 | - $ckeditor->basePath = WEBROOT.'libs/ckeditor/'; |
|
5 | + $ckeditor->basePath = WEBROOT.'libs/ckeditor/'; |
|
6 | 6 | CKFinder::SetupCKEditor($ckeditor, WEBROOT.'libs/ckfinder/'); |
7 | 7 | ?> |
8 | 8 | \ No newline at end of file |