@@ -44,8 +44,7 @@ discard block |
||
| 44 | 44 | public static function FindInString($string, $find) { |
| 45 | 45 | if (strpos($string, $find) !== false) { |
| 46 | 46 | return true; |
| 47 | - } |
|
| 48 | - else { |
|
| 47 | + } else { |
|
| 49 | 48 | return false; |
| 50 | 49 | } |
| 51 | 50 | } |
@@ -58,8 +57,7 @@ discard block |
||
| 58 | 57 | public static function alphaNumeric($string) { |
| 59 | 58 | if (!preg_match('/^[a-zA-Z0-9]+$/', $string)) { |
| 60 | 59 | return false; |
| 61 | - } |
|
| 62 | - else { |
|
| 60 | + } else { |
|
| 63 | 61 | return true; |
| 64 | 62 | } |
| 65 | 63 | } |
@@ -6,7 +6,6 @@ |
||
| 6 | 6 | if ((\core\App::getErreur() !== true) && ($gestion_contenu->getErreur() !== true)) { |
| 7 | 7 | \core\HTML\flashmessage\FlashMessage::setFlash("La page ".$_POST['titre_page']." a bien été crée", "success"); |
| 8 | 8 | header("location:".ADMWEBROOT."gestion-contenus/modifier-contenu?id=".$gestion_contenu->getIdPage()); |
| 9 | - } |
|
| 10 | - else { |
|
| 9 | + } else { |
|
| 11 | 10 | header("location:".ADMWEBROOT."gestion-contenus/creer-une-page"); |
| 12 | 11 | } |
| 13 | 12 | \ No newline at end of file |
@@ -10,29 +10,24 @@ |
||
| 10 | 10 | if ($gestion_contenu->getErreur() !== true) { |
| 11 | 11 | \core\HTML\flashmessage\FlashMessage::setFlash("La page a bien été supprimée", "success"); |
| 12 | 12 | header("location:".ADMWEBROOT."gestion-contenus/index"); |
| 13 | - } |
|
| 14 | - else { |
|
| 13 | + } else { |
|
| 15 | 14 | header("location:".ADMWEBROOT."gestion-contenus/modifier-contenu?id=".$_GET['id']); |
| 16 | 15 | } |
| 17 | - } |
|
| 18 | - else { |
|
| 16 | + } else { |
|
| 19 | 17 | \core\HTML\flashmessage\FlashMessage::setFlash("Vous n'avez pas le droit de supprimer cette page"); |
| 20 | 18 | |
| 21 | 19 | if (isset($_GET['id'])) { |
| 22 | 20 | header("location:".ADMWEBROOT."gestion-contenus/modifier-contenu?id=".$_GET['id']); |
| 23 | - } |
|
| 24 | - else { |
|
| 21 | + } else { |
|
| 25 | 22 | header("location:".ADMWEBROOT."gestion-contenus/index"); |
| 26 | 23 | } |
| 27 | 24 | } |
| 28 | - } |
|
| 29 | - else { |
|
| 25 | + } else { |
|
| 30 | 26 | \core\HTML\flashmessage\FlashMessage::setFlash("Vous n'avez pas le droit de supprimer cette page"); |
| 31 | 27 | |
| 32 | 28 | if (isset($_GET['id'])) { |
| 33 | 29 | header("location:".ADMWEBROOT."gestion-contenus/modifier-contenu?id=".$_GET['id']); |
| 34 | - } |
|
| 35 | - else { |
|
| 30 | + } else { |
|
| 36 | 31 | header("location:".ADMWEBROOT."gestion-contenus/index"); |
| 37 | 32 | } |
| 38 | 33 | } |
| 39 | 34 | \ No newline at end of file |
@@ -2,7 +2,7 @@ |
||
| 2 | 2 | $gestion_contenu = new \core\admin\contenus\GestionContenus(); |
| 3 | 3 | $droit_acces = new \core\admin\droitsacces\DroitAcces(); |
| 4 | 4 | |
| 5 | - if ((($droit_acces->getDroitAccesContenu("GESTION CONTENU PAGE", $_POST['id_page']) == true) && ($droit_acces->getModifContenu() != 0)) || ($droit_acces->getSuperAdmin() == 1)) { |
|
| 5 | + if ((($droit_acces->getDroitAccesContenu("GESTION CONTENU PAGE", $_POST['id_page']) == true) && ($droit_acces->getModifContenu() != 0)) || ($droit_acces->getSuperAdmin() == 1)) { |
|
| 6 | 6 | |
| 7 | 7 | $gestion_contenu->setModifierContenu($_POST['id_page'], $_POST['contenu']); |
| 8 | 8 | |
@@ -9,8 +9,7 @@ |
||
| 9 | 9 | if ((\core\App::getErreur() !== true) && ($gestion_contenu->getErreur() !== true)) { |
| 10 | 10 | \core\HTML\flashmessage\FlashMessage::setFlash("La page ".$_POST['titre_page']." a été mise à jour", "success"); |
| 11 | 11 | } |
| 12 | - } |
|
| 13 | - else { |
|
| 12 | + } else { |
|
| 14 | 13 | \core\HTML\flashmessage\FlashMessage::setFlash("Vous n'avez pas l'autorisation de modifier cette page !"); |
| 15 | 14 | } |
| 16 | 15 | |
@@ -6,7 +6,6 @@ |
||
| 6 | 6 | if ((\core\App::getErreur() !== true) && ($gestion_contenu->getErreur() !== true)) { |
| 7 | 7 | \core\HTML\flashmessage\FlashMessage::setFlash("La page ".$_POST['titre_page']." a bien été crée", "success"); |
| 8 | 8 | header("location:".ADMWEBROOT."gestion-contenus/modifier-contenu?id=".$gestion_contenu->getIdPage()); |
| 9 | - } |
|
| 10 | - else { |
|
| 9 | + } else { |
|
| 11 | 10 | header("location:".ADMWEBROOT."gestion-contenus/creer-une-page"); |
| 12 | 11 | } |
| 13 | 12 | \ No newline at end of file |
@@ -84,8 +84,7 @@ discard block |
||
| 84 | 84 | |
| 85 | 85 | if (($config->getValiderInscription() == 1) && ($valide == 0)) { |
| 86 | 86 | return "<a href=".ADMWEBROOT."controller/core/admin/comptes/valider_compte?id_identite=$id_identite>Valider cet utilisateur</a>"; |
| 87 | - } |
|
| 88 | - else { |
|
| 87 | + } else { |
|
| 89 | 88 | return "Utilisateur validé"; |
| 90 | 89 | } |
| 91 | 90 | } |
@@ -180,8 +179,7 @@ discard block |
||
| 180 | 179 | |
| 181 | 180 | $mail = new Mail(); |
| 182 | 181 | $mail->setEnvoyerMail("Réinitialisation de votre E-mail effectuée", "Votre mot de passe a été réinitialisé", $this->mail); |
| 183 | - } |
|
| 184 | - else { |
|
| 182 | + } else { |
|
| 185 | 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"); |
| 186 | 184 | $this->erreur = true; |
| 187 | 185 | } |
@@ -24,8 +24,7 @@ |
||
| 24 | 24 | $_SESSION['acces_admin'] = $inscription->getAccesAdministration(); |
| 25 | 25 | |
| 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 | } |
@@ -80,7 +80,9 @@ discard block |
||
| 80 | 80 | ->get(); |
| 81 | 81 | |
| 82 | 82 | if ((is_array($query)) && (count($query) > 0)) { |
| 83 | - foreach ($query as $obj) $liste_droit_acces[] = $obj->droit_acces; |
|
| 83 | + foreach ($query as $obj) { |
|
| 84 | + $liste_droit_acces[] = $obj->droit_acces; |
|
| 85 | + } |
|
| 84 | 86 | } |
| 85 | 87 | |
| 86 | 88 | return $liste_droit_acces; |
@@ -95,7 +97,9 @@ discard block |
||
| 95 | 97 | |
| 96 | 98 | $query = $dbc->select("droit_acces")->from("droit_acces")->where("page", " LIKE ", "'%".$page."%'", "", true)->get(); |
| 97 | 99 | if ((is_array($query)) && (count($query) > 0)) { |
| 98 | - foreach ($query as $obj) $droit_acces = $obj->droit_acces; |
|
| 100 | + foreach ($query as $obj) { |
|
| 101 | + $droit_acces = $obj->droit_acces; |
|
| 102 | + } |
|
| 99 | 103 | } |
| 100 | 104 | |
| 101 | 105 | return $droit_acces; |
@@ -139,8 +143,7 @@ discard block |
||
| 139 | 143 | |
| 140 | 144 | if (($this->super_admin == 1) || (in_array($this->getListeDroitPage($page), $this->getListeDroitAcces())) || (in_array($page, $all_access))) { |
| 141 | 145 | return true; |
| 142 | - } |
|
| 143 | - else { |
|
| 146 | + } else { |
|
| 144 | 147 | return false; |
| 145 | 148 | } |
| 146 | 149 | } |
@@ -165,8 +168,7 @@ discard block |
||
| 165 | 168 | //si les trois sont différent de 0 on renvoit true soinon false |
| 166 | 169 | if (($this->super_admin == 1) || ((in_array($droit, $liste_droit_acces)) && in_array(1, $array_modif))) { |
| 167 | 170 | return true; |
| 168 | - } |
|
| 169 | - else { |
|
| 171 | + } else { |
|
| 170 | 172 | return false; |
| 171 | 173 | } |
| 172 | 174 | } |
@@ -181,8 +183,7 @@ discard block |
||
| 181 | 183 | |
| 182 | 184 | if (($this->super_admin == 1) || (in_array($droit_acces, $liste_droit_acces))) { |
| 183 | 185 | return true; |
| 184 | - } |
|
| 185 | - else { |
|
| 186 | + } else { |
|
| 186 | 187 | return false; |
| 187 | 188 | } |
| 188 | 189 | } |
@@ -30,8 +30,7 @@ |
||
| 30 | 30 | public function __construct($id_liste_droit_acces = null) { |
| 31 | 31 | if ($id_liste_droit_acces === null) { |
| 32 | 32 | $this->getListeDroitAccesAdmin(); |
| 33 | - } |
|
| 34 | - else { |
|
| 33 | + } else { |
|
| 35 | 34 | $this->id_liste_droit_acces = $id_liste_droit_acces; |
| 36 | 35 | } |
| 37 | 36 | } |