@@ -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 | |
@@ -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 | |
@@ -59,12 +59,10 @@ |
||
| 59 | 59 | if (in_array($explode[$i], $this->getAllModules())) { |
| 60 | 60 | $this->module = $explode[$i]; |
| 61 | 61 | $debut_url = $explode[$i]; |
| 62 | - } |
|
| 63 | - else if ($i == 1) { |
|
| 62 | + } else if ($i == 1) { |
|
| 64 | 63 | $centre_url = $explode[$i]; |
| 65 | 64 | $this->page = $explode[$i]; |
| 66 | - } |
|
| 67 | - else { |
|
| 65 | + } else { |
|
| 68 | 66 | $this->parametre = $explode[$i]; |
| 69 | 67 | } |
| 70 | 68 | } |
@@ -48,8 +48,7 @@ |
||
| 48 | 48 | if (strlen(utf8_decode($value)) > $limit_char) { |
| 49 | 49 | self::$erreur = true; |
| 50 | 50 | return "<li>$err_char</li>"; |
| 51 | - } |
|
| 52 | - else if ($dbc->rechercherEgalite($nom_table, $champ, $value, $nom_id_table, $value_id_table) == true) { |
|
| 51 | + } else if ($dbc->rechercherEgalite($nom_table, $champ, $value, $nom_id_table, $value_id_table) == true) { |
|
| 53 | 52 | self::$erreur = true; |
| 54 | 53 | return "<li>$err_egalite</li>"; |
| 55 | 54 | } |
@@ -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 | |
@@ -27,8 +27,7 @@ discard block |
||
| 27 | 27 | public function setVerifierMail() { |
| 28 | 28 | if (filter_var($this->mail, FILTER_VALIDATE_EMAIL)) { |
| 29 | 29 | return true; |
| 30 | - } |
|
| 31 | - else { |
|
| 30 | + } else { |
|
| 32 | 31 | return false; |
| 33 | 32 | } |
| 34 | 33 | } |
@@ -45,7 +44,9 @@ discard block |
||
| 45 | 44 | //on récupere le mail du site |
| 46 | 45 | $config = new \core\Configuration(); |
| 47 | 46 | |
| 48 | - if ($from == null) $from = $config->getMailSite(); |
|
| 47 | + if ($from == null) { |
|
| 48 | + $from = $config->getMailSite(); |
|
| 49 | + } |
|
| 49 | 50 | |
| 50 | 51 | $headers = 'Content-type: text/html; charset=utf-8'."\r\n"; |
| 51 | 52 | $headers .= "From: ".$from; |
@@ -53,15 +54,13 @@ discard block |
||
| 53 | 54 | //si pas de destinataire on envoi le mail au gérant du site car c'est un mail envoyé par le site lui même |
| 54 | 55 | if (($destinataire == null) && ($this->mail == null)) { |
| 55 | 56 | $destinataire = $config->getMailSite(); |
| 56 | - } |
|
| 57 | - else if ($destinataire == null) { |
|
| 57 | + } else if ($destinataire == null) { |
|
| 58 | 58 | $destinataire = $this->mail; |
| 59 | 59 | } |
| 60 | 60 | |
| 61 | 61 | if (mail($destinataire, $sujet, $message, $headers)) { |
| 62 | 62 | return true; |
| 63 | - } |
|
| 64 | - else { |
|
| 63 | + } else { |
|
| 65 | 64 | return false; |
| 66 | 65 | } |
| 67 | 66 | } |
@@ -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 | } |
@@ -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 | } |