@@ -7,8 +7,7 @@ |
||
| 7 | 7 | |
| 8 | 8 | if (isset($_POST['admin'])) { |
| 9 | 9 | Connexion::setLogin($pseudo, $mdp, WEBROOT."administrator/login", WEBROOT."administrator"); |
| 10 | - } |
|
| 11 | - else { |
|
| 10 | + } else { |
|
| 12 | 11 | Connexion::setLogin($pseudo, $mdp, WEBROOT."login", WEBROOT."index.php"); |
| 13 | 12 | } |
| 14 | 13 | ?> |
| 15 | 14 | \ No newline at end of file |
@@ -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 | |
@@ -9,8 +9,7 @@ discard block |
||
| 9 | 9 | $db_user = $_SESSION['db_user']; |
| 10 | 10 | $db_pass = $_SESSION['db_pass']; |
| 11 | 11 | unset($_SESSION['err_db']); |
| 12 | - } |
|
| 13 | - else { |
|
| 12 | + } else { |
|
| 14 | 13 | $db_type = null; |
| 15 | 14 | $db_host = null; |
| 16 | 15 | $db_name = null; |
@@ -28,8 +27,7 @@ discard block |
||
| 28 | 27 | $mail_administrateur = $_SESSION['mail_administrateur']; |
| 29 | 28 | |
| 30 | 29 | unset($_SESSION['err_config']); |
| 31 | - } |
|
| 32 | - else { |
|
| 30 | + } else { |
|
| 33 | 31 | $nom_site = null; |
| 34 | 32 | $url_site = null; |
| 35 | 33 | $gerant_site = null; |
@@ -45,8 +43,7 @@ discard block |
||
| 45 | 43 | $pseudo = $_SESSION['pseudo']; |
| 46 | 44 | |
| 47 | 45 | unset($_SESSION['err_user']); |
| 48 | - } |
|
| 49 | - else { |
|
| 46 | + } else { |
|
| 50 | 47 | $nom = null; |
| 51 | 48 | $prenom = null; |
| 52 | 49 | $pseudo = null; |
@@ -75,13 +75,13 @@ |
||
| 75 | 75 | } |
| 76 | 76 | |
| 77 | 77 | /** |
| 78 | - * @param $nom_table |
|
| 79 | - * @param $nom_id_table |
|
| 80 | - * @param $champ |
|
| 78 | + * @param string $nom_table |
|
| 79 | + * @param string $nom_id_table |
|
| 80 | + * @param string $champ |
|
| 81 | 81 | * @param $value |
| 82 | - * @param $limit_char |
|
| 83 | - * @param $err_char |
|
| 84 | - * @param $err_egalite |
|
| 82 | + * @param integer $limit_char |
|
| 83 | + * @param string $err_char |
|
| 84 | + * @param string $err_egalite |
|
| 85 | 85 | * @param null $value_id_table |
| 86 | 86 | * @return string |
| 87 | 87 | * fonction qui permet de vérifier qu'il n'y ait pas d'erreur dans le champ spécifié ni de doublons |
@@ -23,7 +23,9 @@ discard block |
||
| 23 | 23 | $query = $dbc->select("titre")->from("page")->where("ID_page", "=", $parent)->get(); |
| 24 | 24 | |
| 25 | 25 | if ((is_array($query)) && (count($query) > 0)) { |
| 26 | - foreach ($query as $obj) $this->parent_texte = $obj->titre; |
|
| 26 | + foreach ($query as $obj) { |
|
| 27 | + $this->parent_texte = $obj->titre; |
|
| 28 | + } |
|
| 27 | 29 | } |
| 28 | 30 | |
| 29 | 31 | return $this->parent_texte; |
@@ -92,8 +94,7 @@ discard block |
||
| 92 | 94 | if (strlen(utf8_decode($value)) > $limit_char) { |
| 93 | 95 | self::$erreur = true; |
| 94 | 96 | return "<li>$err_char</li>"; |
| 95 | - } |
|
| 96 | - else if ($dbc->rechercherEgalite($nom_table, $champ, $value, $nom_id_table, $value_id_table) == true) { |
|
| 97 | + } else if ($dbc->rechercherEgalite($nom_table, $champ, $value, $nom_id_table, $value_id_table) == true) { |
|
| 97 | 98 | self::$erreur = true; |
| 98 | 99 | return "<li>$err_egalite</li>"; |
| 99 | 100 | } |
@@ -175,13 +176,11 @@ discard block |
||
| 175 | 176 | if ($parent != "") { |
| 176 | 177 | $this->setAjoutLienNavigation("ID_page", $this->id_page, 1); |
| 177 | 178 | } |
| 178 | - } |
|
| 179 | - else { |
|
| 179 | + } else { |
|
| 180 | 180 | FlashMessage::setFlash("Impossible de créer cette page, veuillez réeseyer dans un moment. Si le problème persiste contactez votre administrateur."); |
| 181 | 181 | $this->erreur = true; |
| 182 | 182 | } |
| 183 | - } |
|
| 184 | - else { |
|
| 183 | + } else { |
|
| 185 | 184 | $this->setErreurContenus($balise_title, $url, $meta_description, $titre_page, $parent, $err_balise_title, $err_url, $err_meta_description, $err_titre_page); |
| 186 | 185 | } |
| 187 | 186 | } |
@@ -244,8 +243,7 @@ discard block |
||
| 244 | 243 | ->set(); |
| 245 | 244 | |
| 246 | 245 | $this->setModifierLienNavigation("ID_page", $id_page, $this->getParentId($parent), $affiche); |
| 247 | - } |
|
| 248 | - else { |
|
| 246 | + } else { |
|
| 249 | 247 | $this->setErreurContenus($balise_title, $url, $meta_description, $titre_page, $parent, $err_balise_title, $err_url, $err_meta_description, $err_titre_page); |
| 250 | 248 | } |
| 251 | 249 | } |
@@ -294,8 +292,7 @@ discard block |
||
| 294 | 292 | FlashMessage::setFlash("Impossible de supprimer cette page, veuillez contacter votre administrateur pour corriger ce problème"); |
| 295 | 293 | $this->erreur = true; |
| 296 | 294 | } |
| 297 | - } |
|
| 298 | - else { |
|
| 295 | + } else { |
|
| 299 | 296 | FlashMessage::setFlash("Impossible de supprimer cette page, veuillez contacter votre administrateur pour corriger ce problème"); |
| 300 | 297 | $this->erreur = true; |
| 301 | 298 | } |
@@ -321,8 +318,7 @@ discard block |
||
| 321 | 318 | if ($parent != "") { |
| 322 | 319 | $nav = new Navigation(); |
| 323 | 320 | $nav->setSupprimerLien($id, $id_page); |
| 324 | - } |
|
| 325 | - else if (($affiche == 1) && ($parent == "")) { |
|
| 321 | + } else if (($affiche == 1) && ($parent == "")) { |
|
| 326 | 322 | $this->setAjoutLienNavigation($id, $id_page, $affiche); |
| 327 | 323 | } |
| 328 | 324 | } |
@@ -24,8 +24,7 @@ |
||
| 24 | 24 | $_SESSION['acces_admin'] = $inscription->getAccesAdministration(); |
| 25 | 25 | //$id_liste_droit_acces = $_SESSION['id_liste_droit_acces']; |
| 26 | 26 | \core\HTML\flashmessage\FlashMessage::setFlash("<ul>".$inscription->getErreur()."</ul>"); |
| 27 | - } |
|
| 28 | - else { |
|
| 27 | + } else { |
|
| 29 | 28 | \core\HTML\flashmessage\FlashMessage::setFlash("L'utilisateur ".$inscription->getNom()." ".$inscription->getPrenom()."a bien été inscrit", "success"); |
| 30 | 29 | $inscription->setInscrireUtilisateur(); |
| 31 | 30 | } |
@@ -21,8 +21,12 @@ discard block |
||
| 21 | 21 | //-------------------------- CONSTRUCTEUR ----------------------------------------------------------------------------// |
| 22 | 22 | public function __construct() { |
| 23 | 23 | //On test si dossier temporaire + modules a la racines existes bien sinon on les crées |
| 24 | - if (!file_exists(ROOT."temp")) mkdir(ROOT."temp"); |
|
| 25 | - if (!file_exists(ROOT."modules")) mkdir(ROOT."modules"); |
|
| 24 | + if (!file_exists(ROOT."temp")) { |
|
| 25 | + mkdir(ROOT."temp"); |
|
| 26 | + } |
|
| 27 | + if (!file_exists(ROOT."modules")) { |
|
| 28 | + mkdir(ROOT."modules"); |
|
| 29 | + } |
|
| 26 | 30 | } |
| 27 | 31 | //-------------------------- FIN CONSTRUCTEUR ----------------------------------------------------------------------------// |
| 28 | 32 | |
@@ -95,8 +99,7 @@ discard block |
||
| 95 | 99 | } |
| 96 | 100 | |
| 97 | 101 | FlashMessage::setFlash("Votre module a bien été ajouté au site.", "success"); |
| 98 | - } |
|
| 99 | - else { |
|
| 102 | + } else { |
|
| 100 | 103 | FlashMessage::setFlash("Le module n'a pas pu être correctement téléchargé et installé, veuillez réesseyer dans un instant"); |
| 101 | 104 | } |
| 102 | 105 | } |
@@ -131,8 +134,7 @@ discard block |
||
| 131 | 134 | |
| 132 | 135 | FlashMessage::setFlash("Votre module a bien été mis à jour", "success"); |
| 133 | 136 | } |
| 134 | - } |
|
| 135 | - else { |
|
| 137 | + } else { |
|
| 136 | 138 | FlashMessage::setFlash("Impossible de télécharger la mise à jour, veuillez réesseyer dans un instant"); |
| 137 | 139 | } |
| 138 | 140 | } |
@@ -144,8 +146,7 @@ discard block |
||
| 144 | 146 | private function setSupprimerArchiveTemp() { |
| 145 | 147 | if (unlink(TEMPROOT.$this->nom_fichier) == true) { |
| 146 | 148 | return true; |
| 147 | - } |
|
| 148 | - else { |
|
| 149 | + } else { |
|
| 149 | 150 | return false; |
| 150 | 151 | } |
| 151 | 152 | } |
@@ -55,7 +55,11 @@ |
||
| 55 | 55 | $objects = scandir($url); |
| 56 | 56 | foreach ($objects as $object) { |
| 57 | 57 | if ($object != "." && $object != "..") { |
| 58 | - if (filetype($url."/".$object) == "dir") App::supprimerDossier($url."/".$object); else unlink($url."/".$object); |
|
| 58 | + if (filetype($url."/".$object) == "dir") { |
|
| 59 | + App::supprimerDossier($url."/".$object); |
|
| 60 | + } else { |
|
| 61 | + unlink($url."/".$object); |
|
| 62 | + } |
|
| 59 | 63 | } |
| 60 | 64 | } |
| 61 | 65 | reset($objects); |