Passed
Push — master ( b58333...85a890 )
by Anthony
03:13
created
core/images/Images.class.php 4 patches
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -43,13 +43,13 @@
 block discarded – undo
43 43
 		//-------------------------- GETTER ----------------------------------------------------------------------------//
44 44
 
45 45
 		public function getOldImage() {
46
-		    return $this->old_image;
46
+			return $this->old_image;
47 47
 		}
48 48
 		public function getCheminImage() {
49
-		    return $this->chemin_image;
49
+			return $this->chemin_image;
50 50
 		}
51 51
 		public function getErreur() {
52
-		    return $this->erreur;
52
+			return $this->erreur;
53 53
 		}
54 54
 		public function getNomImage() {
55 55
 			return $this->nom_image;
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
 		 * @param int $delete_old_img
77 77
 		 * @return bool|string -> renvoi false si err sinon renvoi le chemin vers l'img
78 78
 		 */
79
-		public function setEnvoyerImage($name, $old_image_req=null, $autorize_empty=1, $delete_old_img=1) {
79
+		public function setEnvoyerImage($name, $old_image_req = null, $autorize_empty = 1, $delete_old_img = 1) {
80 80
 			$dbc = \core\App::getDb();
81 81
 
82 82
 			$this->old_image = null;
@@ -146,7 +146,7 @@  discard block
 block discarded – undo
146 146
 		 * @param null $req_img
147 147
 		 * @return string
148 148
 		 */
149
-		public function setResizeImage($width, $height, $prefixe, $delete_old=1, $req_img=null) {
149
+		public function setResizeImage($width, $height, $prefixe, $delete_old = 1, $req_img = null) {
150 150
 			if (($req_img == null) && ($this->chemin_image != "")) {
151 151
 				$this->getImage();
152 152
 
@@ -182,7 +182,7 @@  discard block
 block discarded – undo
182 182
 		 * @param null $req_image
183 183
 		 * @return bool
184 184
 		 */
185
-		public function setDeleteImage($nom_image=null) {
185
+		public function setDeleteImage($nom_image = null) {
186 186
 			//si pas de requete et qu'on a une old_img on la supprime
187 187
 			if (($this->old_image != "") && ($nom_image == null)) {
188 188
 				$old_image = explode("/", $this->old_image);
@@ -196,7 +196,7 @@  discard block
 block discarded – undo
196 196
 			else if ($nom_image != null) {
197 197
 
198 198
 				if (is_array($nom_image)) {
199
-					for ($i=0 ; $i<count($nom_image) ; $i++) {
199
+					for ($i = 0; $i < count($nom_image); $i++) {
200 200
 						$chemin_img = $this->dossier_image."/".$nom_image[$i];
201 201
 
202 202
 						if (unlink($chemin_img)) {
Please login to merge, or discard this patch.
Braces   +13 added lines, -26 removed lines patch added patch discarded remove patch
@@ -59,8 +59,7 @@  discard block
 block discarded – undo
59 59
 				$explode = explode("/", $this->chemin_image);
60 60
 				$this->image = end($explode);
61 61
 				return $this->image;
62
-			}
63
-			else {
62
+			} else {
64 63
 				$this->erreur = "Impossible de trouver votre image, vuellez réessayer dans un instant";
65 64
 				return false;
66 65
 			}
@@ -90,8 +89,7 @@  discard block
 block discarded – undo
90 89
 					$this->erreur = "Vous devez obligatoirement ajouter une image";
91 90
 					return false;
92 91
 				}
93
-			}
94
-			else {
92
+			} else {
95 93
 				//test si il y a deja une img
96 94
 				if ($old_image_req != null) {
97 95
 					$query = $dbc->query($old_image_req);
@@ -109,12 +107,10 @@  discard block
 block discarded – undo
109 107
 				if (!in_array(substr($image, -3), $this->autorized_extention)) {
110 108
 					$this->erreur = "Votre image ne comporte pas l'extension jpg, png, jpeg, gif, JPG, PNG, JPEG, GIF";
111 109
 					return false;
112
-				}
113
-				else if (($infos_img[0] >= $this->width_max) && ($infos_img[1] >= $this->height_max) && ($_FILES[$name]['size'] >= $this->poid_max)) {
110
+				} else if (($infos_img[0] >= $this->width_max) && ($infos_img[1] >= $this->height_max) && ($_FILES[$name]['size'] >= $this->poid_max)) {
114 111
 					$this->erreur = "Problème dans les dimensions ou taille de l'image.";
115 112
 					return false;
116
-				}
117
-				else {
113
+				} else {
118 114
 					$uniqid = uniqid();
119 115
 
120 116
 					if (move_uploaded_file($_FILES[$name]['tmp_name'], $this->dossier_image."/".$uniqid.substr($image, -4))) {
@@ -129,8 +125,7 @@  discard block
 block discarded – undo
129 125
 						}
130 126
 
131 127
 						return true;
132
-					}
133
-					else {
128
+					} else {
134 129
 						$this->erreur = "Impossible d'envoyer votre image sur le serveur, veuillez réessayer dans une instant, si l'erreur se reproduit, contactez votre administrateur";
135 130
 					}
136 131
 				}
@@ -157,8 +152,7 @@  discard block
 block discarded – undo
157 152
 				$image = $this->dossier_image."/".$img_resize;
158 153
 
159 154
 				$this->nom_image = $img_resize;
160
-			}
161
-			else {
155
+			} else {
162 156
 
163 157
 				$this->nom_image = null;
164 158
 				/*$resize = new resize($urlimg);
@@ -192,8 +186,7 @@  discard block
 block discarded – undo
192 186
 					unlink($this->dossier_image."/".end($old_image));
193 187
 					return true;
194 188
 				}
195
-			}
196
-			else if ($nom_image != null) {
189
+			} else if ($nom_image != null) {
197 190
 
198 191
 				if (is_array($nom_image)) {
199 192
 					for ($i=0 ; $i<count($nom_image) ; $i++) {
@@ -201,27 +194,22 @@  discard block
 block discarded – undo
201 194
 
202 195
 						if (unlink($chemin_img)) {
203 196
 							$success = true;
204
-						}
205
-						else {
197
+						} else {
206 198
 							if (unlink($this->chemin_image)) {
207 199
 								$success = true;
208
-							}
209
-							else {
200
+							} else {
210 201
 								$this->erreur = "Impossible de supprimer cette image, veuillez réesayer dans un instant, sinon contacter l'administrateur de votre site";
211 202
 								$success = false;
212 203
 							}
213 204
 						}
214 205
 					}
215
-				}
216
-				else {
206
+				} else {
217 207
 					if (unlink($this->dossier_image."/".$nom_image)) {
218 208
 						$success = true;
219
-					}
220
-					else {
209
+					} else {
221 210
 						if (unlink($this->chemin_image)) {
222 211
 							$success = true;
223
-						}
224
-						else {
212
+						} else {
225 213
 							$this->erreur = "Impossible de supprimer cette image, veuillez réesayer dans un instant, sinon contacter l'administrateur de votre site";
226 214
 							$success = false;
227 215
 						}
@@ -229,8 +217,7 @@  discard block
 block discarded – undo
229 217
 				}
230 218
 
231 219
 				return $success;
232
-			}
233
-			else {
220
+			} else {
234 221
 				$this->erreur = "Impossible de supprimer cette image";
235 222
 				return false;
236 223
 			}
Please login to merge, or discard this patch.
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -4,7 +4,6 @@
 block discarded – undo
4 4
 
5 5
 	use core\App;
6 6
 	use core\functions\ChaineCaractere;
7
-	use core\HTML\flashmessage\FlashMessage;
8 7
 
9 8
 	class RouterModule {
10 9
 		//varaibles de base de config
Please login to merge, or discard this patch.
core/images/Resize.class.php 4 patches
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -21,8 +21,8 @@  discard block
 block discarded – undo
21 21
 		{
22 22
 			// *** Class variables
23 23
 			private $image;
24
-		    private $width;
25
-		    private $height;
24
+			private $width;
25
+			private $height;
26 26
 			private $imageResized;
27 27
 
28 28
 			function __construct($fileName)
@@ -30,9 +30,9 @@  discard block
 block discarded – undo
30 30
 				// *** Open up the file
31 31
 				$this->image = $this->openImage($fileName);
32 32
 
33
-			    // *** Get width and height
34
-			    $this->width  = imagesx($this->image);
35
-			    $this->height = imagesy($this->image);
33
+				// *** Get width and height
34
+				$this->width  = imagesx($this->image);
35
+				$this->height = imagesy($this->image);
36 36
 			}
37 37
 
38 38
 			## --------------------------------------------------------
@@ -206,8 +206,8 @@  discard block
 block discarded – undo
206 206
 			public function saveImage($savePath, $imageQuality="100")
207 207
 			{
208 208
 				// *** Get extension
209
-        		$extension = strrchr($savePath, '.');
210
-       			$extension = strtolower($extension);
209
+				$extension = strrchr($savePath, '.');
210
+	   			$extension = strtolower($extension);
211 211
 
212 212
 				switch($extension)
213 213
 				{
Please login to merge, or discard this patch.
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
 				// *** Get extension
43 43
 				$extension = strtolower(strrchr($file, '.'));
44 44
 
45
-				switch($extension)
45
+				switch ($extension)
46 46
 				{
47 47
 					case '.jpg':
48 48
 					case '.jpeg':
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
 
64 64
 			## --------------------------------------------------------
65 65
 
66
-			public function resizeImage($newWidth, $newHeight, $option="auto")
66
+			public function resizeImage($newWidth, $newHeight, $option = "auto")
67 67
 			{
68 68
 				// *** Get optimal width and height - based on $option
69 69
 				$optionArray = $this->getDimensions($newWidth, $newHeight, $option);
@@ -92,15 +92,15 @@  discard block
 block discarded – undo
92 92
 				{
93 93
 					case 'exact':
94 94
 						$optimalWidth = $newWidth;
95
-						$optimalHeight= $newHeight;
95
+						$optimalHeight = $newHeight;
96 96
 						break;
97 97
 					case 'portrait':
98 98
 						$optimalWidth = $this->getSizeByFixedHeight($newHeight);
99
-						$optimalHeight= $newHeight;
99
+						$optimalHeight = $newHeight;
100 100
 						break;
101 101
 					case 'landscape':
102 102
 						$optimalWidth = $newWidth;
103
-						$optimalHeight= $this->getSizeByFixedWidth($newWidth);
103
+						$optimalHeight = $this->getSizeByFixedWidth($newWidth);
104 104
 						break;
105 105
 					case 'auto':
106 106
 						$optionArray = $this->getSizeByAuto($newWidth, $newHeight);
@@ -138,27 +138,27 @@  discard block
 block discarded – undo
138 138
 				// *** Image to be resized is wider (landscape)
139 139
 				{
140 140
 					$optimalWidth = $newWidth;
141
-					$optimalHeight= $this->getSizeByFixedWidth($newWidth);
141
+					$optimalHeight = $this->getSizeByFixedWidth($newWidth);
142 142
 				}
143 143
 				elseif ($this->height > $this->width)
144 144
 				// *** Image to be resized is taller (portrait)
145 145
 				{
146 146
 					$optimalWidth = $this->getSizeByFixedHeight($newHeight);
147
-					$optimalHeight= $newHeight;
147
+					$optimalHeight = $newHeight;
148 148
 				}
149 149
 				else
150 150
 				// *** Image to be resizerd is a square
151 151
 				{
152 152
 					if ($newHeight < $newWidth) {
153 153
 						$optimalWidth = $newWidth;
154
-						$optimalHeight= $this->getSizeByFixedWidth($newWidth);
154
+						$optimalHeight = $this->getSizeByFixedWidth($newWidth);
155 155
 					} else if ($newHeight > $newWidth) {
156 156
 						$optimalWidth = $this->getSizeByFixedHeight($newHeight);
157
-						$optimalHeight= $newHeight;
157
+						$optimalHeight = $newHeight;
158 158
 					} else {
159 159
 						// *** Sqaure being resized to a square
160 160
 						$optimalWidth = $newWidth;
161
-						$optimalHeight= $newHeight;
161
+						$optimalHeight = $newHeight;
162 162
 					}
163 163
 				}
164 164
 
@@ -171,7 +171,7 @@  discard block
 block discarded – undo
171 171
 			{
172 172
 
173 173
 				$heightRatio = $this->height / $newHeight;
174
-				$widthRatio  = $this->width /  $newWidth;
174
+				$widthRatio  = $this->width / $newWidth;
175 175
 
176 176
 				if ($heightRatio < $widthRatio) {
177 177
 					$optimalRatio = $heightRatio;
@@ -180,7 +180,7 @@  discard block
 block discarded – undo
180 180
 				}
181 181
 
182 182
 				$optimalHeight = $this->height / $optimalRatio;
183
-				$optimalWidth  = $this->width  / $optimalRatio;
183
+				$optimalWidth  = $this->width / $optimalRatio;
184 184
 
185 185
 				return array('optimalWidth' => $optimalWidth, 'optimalHeight' => $optimalHeight);
186 186
 			}
@@ -190,26 +190,26 @@  discard block
 block discarded – undo
190 190
 			private function crop($optimalWidth, $optimalHeight, $newWidth, $newHeight)
191 191
 			{
192 192
 				// *** Find center - this will be used for the crop
193
-				$cropStartX = ( $optimalWidth / 2) - ( $newWidth /2 );
194
-				$cropStartY = ( $optimalHeight/ 2) - ( $newHeight/2 );
193
+				$cropStartX = ($optimalWidth / 2) - ($newWidth / 2);
194
+				$cropStartY = ($optimalHeight / 2) - ($newHeight / 2);
195 195
 
196 196
 				$crop = $this->imageResized;
197 197
 				//imagedestroy($this->imageResized);
198 198
 
199 199
 				// *** Now crop from center to exact requested size
200
-				$this->imageResized = imagecreatetruecolor($newWidth , $newHeight);
201
-				imagecopyresampled($this->imageResized, $crop , 0, 0, $cropStartX, $cropStartY, $newWidth, $newHeight , $newWidth, $newHeight);
200
+				$this->imageResized = imagecreatetruecolor($newWidth, $newHeight);
201
+				imagecopyresampled($this->imageResized, $crop, 0, 0, $cropStartX, $cropStartY, $newWidth, $newHeight, $newWidth, $newHeight);
202 202
 			}
203 203
 
204 204
 			## --------------------------------------------------------
205 205
 
206
-			public function saveImage($savePath, $imageQuality="100")
206
+			public function saveImage($savePath, $imageQuality = "100")
207 207
 			{
208 208
 				// *** Get extension
209 209
         		$extension = strrchr($savePath, '.');
210 210
        			$extension = strtolower($extension);
211 211
 
212
-				switch($extension)
212
+				switch ($extension)
213 213
 				{
214 214
 					case '.jpg':
215 215
 					case '.jpeg':
@@ -226,7 +226,7 @@  discard block
 block discarded – undo
226 226
 
227 227
 					case '.png':
228 228
 						// *** Scale quality from 0-100 to 0-9
229
-						$scaleQuality = round(($imageQuality/100) * 9);
229
+						$scaleQuality = round(($imageQuality / 100) * 9);
230 230
 
231 231
 						// *** Invert quality setting as 0 is best, not 9
232 232
 						$invertScaleQuality = 9 - $scaleQuality;
Please login to merge, or discard this patch.
Braces   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -134,19 +134,19 @@
 block discarded – undo
134 134
 
135 135
 			private function getSizeByAuto($newWidth, $newHeight)
136 136
 			{
137
-				if ($this->height < $this->width)
138
-				// *** Image to be resized is wider (landscape)
137
+				if ($this->height < $this->width) {
138
+								// *** Image to be resized is wider (landscape)
139 139
 				{
140 140
 					$optimalWidth = $newWidth;
141
-					$optimalHeight= $this->getSizeByFixedWidth($newWidth);
142 141
 				}
143
-				elseif ($this->height > $this->width)
144
-				// *** Image to be resized is taller (portrait)
142
+					$optimalHeight= $this->getSizeByFixedWidth($newWidth);
143
+				} elseif ($this->height > $this->width) {
144
+								// *** Image to be resized is taller (portrait)
145 145
 				{
146 146
 					$optimalWidth = $this->getSizeByFixedHeight($newHeight);
147
-					$optimalHeight= $newHeight;
148 147
 				}
149
-				else
148
+					$optimalHeight= $newHeight;
149
+				} else
150 150
 				// *** Image to be resizerd is a square
151 151
 				{
152 152
 					if ($newHeight < $newWidth) {
Please login to merge, or discard this patch.
Doc Comments   +9 added lines patch added patch discarded remove patch
@@ -25,6 +25,9 @@  discard block
 block discarded – undo
25 25
 		    private $height;
26 26
 			private $imageResized;
27 27
 
28
+			/**
29
+			 * @param null|string $fileName
30
+			 */
28 31
 			function __construct($fileName)
29 32
 			{
30 33
 				// *** Open up the file
@@ -85,6 +88,9 @@  discard block
 block discarded – undo
85 88
 
86 89
 			## --------------------------------------------------------
87 90
 			
91
+			/**
92
+			 * @param string $option
93
+			 */
88 94
 			private function getDimensions($newWidth, $newHeight, $option)
89 95
 			{
90 96
 
@@ -203,6 +209,9 @@  discard block
 block discarded – undo
203 209
 
204 210
 			## --------------------------------------------------------
205 211
 
212
+			/**
213
+			 * @param string $savePath
214
+			 */
206 215
 			public function saveImage($savePath, $imageQuality="100")
207 216
 			{
208 217
 				// *** Get extension
Please login to merge, or discard this patch.
core/Database.class.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
 		 * @param $req -> la req a executer
63 63
 		 * @param $value -> le ou les tableaux de valeurs
64 64
 		 */
65
-		public function prepare($req, $value=null) {
65
+		public function prepare($req, $value = null) {
66 66
 			//si pas de donnees
67 67
 			if ($value === null) {
68 68
 				$this->getPdo()->query($req);
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
 		 * @param $value
98 98
 		 * @return bool
99 99
 		 */
100
-		public function rechercherEgalite($table, $champ, $value, $id_table=null, $id=null) {
100
+		public function rechercherEgalite($table, $champ, $value, $id_table = null, $id = null) {
101 101
 			if ($id == null) {
102 102
 				$query = $this->getPdo()->query("SELECT COUNT($champ) as nb FROM $table WHERE $champ LIKE '$value'");
103 103
 			}
Please login to merge, or discard this patch.
Braces   +8 added lines, -11 removed lines patch added patch discarded remove patch
@@ -51,8 +51,7 @@  discard block
 block discarded – undo
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
 		}
@@ -66,8 +65,7 @@  discard block
 block discarded – undo
66 65
 			//si pas de donnees
67 66
 			if ($value === null) {
68 67
 				$this->getPdo()->query($req);
69
-			}
70
-			else {
68
+			} else {
71 69
 				$query = $this->getPdo()->prepare($req);
72 70
 				//si on a plusieurs tableaux
73 71
 				if (array_key_exists(0, $value)) {
@@ -76,8 +74,7 @@  discard block
 block discarded – undo
76 74
 							$err = true;
77 75
 						}
78 76
 					}
79
-				}
80
-				else {
77
+				} else {
81 78
 					if (!$query->execute($value)) {
82 79
 						$err = true;
83 80
 					}
@@ -100,8 +97,7 @@  discard block
 block discarded – undo
100 97
 		public function rechercherEgalite($table, $champ, $value, $id_table=null, $id=null) {
101 98
 			if ($id == null) {
102 99
 				$query = $this->getPdo()->query("SELECT COUNT($champ) as nb FROM $table WHERE $champ LIKE '$value'");
103
-			}
104
-			else {
100
+			} else {
105 101
 				$query = $this->getPdo()->query("SELECT COUNT($champ) as nb FROM $table WHERE $champ LIKE '$value' AND $id_table != $id");
106 102
 			}
107 103
 
@@ -109,7 +105,9 @@  discard block
 block discarded – undo
109 105
 				$nb = $obj["nb"];
110 106
 			}
111 107
 
112
-			if ($nb == 1) return true;
108
+			if ($nb == 1) {
109
+				return true;
110
+			}
113 111
 		}
114 112
 		//-------------------------- FIN FUNCTION QUI FONT DES REQUETES SUR LA BDD --------------------------------------------//
115 113
 
@@ -124,8 +122,7 @@  discard block
 block discarded – undo
124 122
 
125 123
 			if ($query->rowCount() > 0) {
126 124
 				return true;
127
-			}
128
-			else {
125
+			} else {
129 126
 				return false;
130 127
 			}
131 128
 		}
Please login to merge, or discard this patch.
core/admin/droitsacces/liste/get_detail.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -29,6 +29,6 @@
 block discarded – undo
29 29
 		$contenu[] = "Cette liste ne contient pas d'élément dans cette catégorie, modifiez la liste pour en ajouter.";
30 30
 	}
31 31
 ?>
32
-<?php for ($i=0 ; $i<$counter ; $i++):?>
32
+<?php for ($i = 0; $i < $counter; $i++):?>
33 33
 	<h4><?=$contenu[$i]?></h4>
34
-<?php endfor;?>
35 34
\ No newline at end of file
35
+<?php endfor; ?>
36 36
\ No newline at end of file
Please login to merge, or discard this patch.
core/admin/droitsacces/GestionDroitAcces.class.php 3 patches
Indentation   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -1,7 +1,7 @@  discard block
 block discarded – undo
1 1
 <?php
2
-    namespace core\admin\droitsacces;
2
+	namespace core\admin\droitsacces;
3 3
 
4
-    use core\App;
4
+	use core\App;
5 5
 
6 6
 	class GestionDroitAcces extends DroitAcces {
7 7
 		//pour les droit_acces standard
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
 
25 25
 
26 26
 
27
-        //-------------------------- CONSTRUCTEUR ----------------------------------------------------------------------------//
27
+		//-------------------------- CONSTRUCTEUR ----------------------------------------------------------------------------//
28 28
 		public function __construct($id_liste_droit_acces=null) {
29 29
 			$dbc = App::getDb();
30 30
 
@@ -64,11 +64,11 @@  discard block
 block discarded – undo
64 64
 				$this->id_liste_droit_acces = $id_liste_droit_acces;
65 65
 			}
66 66
 		}
67
-        //-------------------------- FIN CONSTRUCTEUR ----------------------------------------------------------------------------//
67
+		//-------------------------- FIN CONSTRUCTEUR ----------------------------------------------------------------------------//
68 68
 
69 69
 
70 70
 
71
-        //-------------------------- GETTER ----------------------------------------------------------------------------//
71
+		//-------------------------- GETTER ----------------------------------------------------------------------------//
72 72
 		//pour les droit_acces standard
73 73
 		public function getIdListeDroitAcces() {
74 74
 			return $this->id_liste_droit_acces;
@@ -108,7 +108,7 @@  discard block
 block discarded – undo
108 108
 			return $this->pseudo;
109 109
 		}
110 110
 		public function getNbUser(){
111
-		    return $this->nb_user;
111
+			return $this->nb_user;
112 112
 		}
113 113
 
114 114
 		/**
@@ -116,7 +116,7 @@  discard block
 block discarded – undo
116 116
 		 * @param $id_liste_droit_acces
117 117
 		 */
118 118
 		public function getListeDroitAccesDetailDroit($id_liste_droit_acces=null){
119
-		    $dbc = \core\App::getDb();
119
+			$dbc = \core\App::getDb();
120 120
 
121 121
 			if ($id_liste_droit_acces == null) $id_liste_droit_acces = $this->id_liste_droit_acces;
122 122
 
@@ -160,7 +160,7 @@  discard block
 block discarded – undo
160 160
 		 * @param $id_liste_droit_acces
161 161
 		 */
162 162
 		public function getListeDroitAccesDetailPage($id_liste_droit_acces=null){
163
-		    $dbc = \core\App::getDb();
163
+			$dbc = \core\App::getDb();
164 164
 
165 165
 			if ($id_liste_droit_acces == null) $id_liste_droit_acces = $this->id_liste_droit_acces;
166 166
 
@@ -179,11 +179,11 @@  discard block
 block discarded – undo
179 179
 				$this->setListeDroitAccesDetailPage($id_page, $titre_page);
180 180
 			}
181 181
 		}
182
-        //-------------------------- FIN GETTER ----------------------------------------------------------------------------//
182
+		//-------------------------- FIN GETTER ----------------------------------------------------------------------------//
183 183
 
184 184
 
185 185
 
186
-        //-------------------------- SETTER ----------------------------------------------------------------------------//
186
+		//-------------------------- SETTER ----------------------------------------------------------------------------//
187 187
 		private function setListeDroitAcces($id_liste_droit_acces, $nom_liste, $nb_droit_acces, $nb_droit_acces_page, $nb_user){
188 188
 			$this->id_liste_droit_acces = $id_liste_droit_acces;
189 189
 			$this->nom_liste = $nom_liste;
@@ -205,4 +205,4 @@  discard block
 block discarded – undo
205 205
 			$this->prenom = $prenom;
206 206
 		}
207 207
 		//-------------------------- FIN SETTER ----------------------------------------------------------------------------//
208
-    }
209 208
\ No newline at end of file
209
+	}
210 210
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
 
26 26
 
27 27
         //-------------------------- CONSTRUCTEUR ----------------------------------------------------------------------------//
28
-		public function __construct($id_liste_droit_acces=null) {
28
+		public function __construct($id_liste_droit_acces = null) {
29 29
 			$dbc = App::getDb();
30 30
 
31 31
 			if ($id_liste_droit_acces == null) {
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
 		public function getIdPage() {
88 88
 			return $this->id_page;
89 89
 		}
90
-		public function getTitrePage(){
90
+		public function getTitrePage() {
91 91
 			return $this->titre_page;
92 92
 		}
93 93
 		public function getNbDroitAccesPage() {
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
 		public function getPseudo() {
108 108
 			return $this->pseudo;
109 109
 		}
110
-		public function getNbUser(){
110
+		public function getNbUser() {
111 111
 		    return $this->nb_user;
112 112
 		}
113 113
 
@@ -115,7 +115,7 @@  discard block
 block discarded – undo
115 115
 		 * fonction qui récupère la liste des droits d'acces en texte en fonction de l'id de la liste
116 116
 		 * @param $id_liste_droit_acces
117 117
 		 */
118
-		public function getListeDroitAccesDetailDroit($id_liste_droit_acces=null){
118
+		public function getListeDroitAccesDetailDroit($id_liste_droit_acces = null) {
119 119
 		    $dbc = \core\App::getDb();
120 120
 
121 121
 			if ($id_liste_droit_acces == null) $id_liste_droit_acces = $this->id_liste_droit_acces;
@@ -136,7 +136,7 @@  discard block
 block discarded – undo
136 136
 		 * fonction qui récupère la liste des utilisateur dans une liste de droits d'acces en texte en fonction de l'id de la liste
137 137
 		 * @param $id_liste_droit_acces
138 138
 		 */
139
-		public function getListeDroitAccesDetailUser($id_liste_droit_acces=null) {
139
+		public function getListeDroitAccesDetailUser($id_liste_droit_acces = null) {
140 140
 			$dbc = \core\App::getDb();
141 141
 
142 142
 			if ($id_liste_droit_acces == null) $id_liste_droit_acces = $this->id_liste_droit_acces;
@@ -159,7 +159,7 @@  discard block
 block discarded – undo
159 159
 		 * fonction qui récupère la liste des droits d'acces sur les pages en texte en fonction de l'id de la liste
160 160
 		 * @param $id_liste_droit_acces
161 161
 		 */
162
-		public function getListeDroitAccesDetailPage($id_liste_droit_acces=null){
162
+		public function getListeDroitAccesDetailPage($id_liste_droit_acces = null) {
163 163
 		    $dbc = \core\App::getDb();
164 164
 
165 165
 			if ($id_liste_droit_acces == null) $id_liste_droit_acces = $this->id_liste_droit_acces;
@@ -184,7 +184,7 @@  discard block
 block discarded – undo
184 184
 
185 185
 
186 186
         //-------------------------- SETTER ----------------------------------------------------------------------------//
187
-		private function setListeDroitAcces($id_liste_droit_acces, $nom_liste, $nb_droit_acces, $nb_droit_acces_page, $nb_user){
187
+		private function setListeDroitAcces($id_liste_droit_acces, $nom_liste, $nb_droit_acces, $nb_droit_acces_page, $nb_user) {
188 188
 			$this->id_liste_droit_acces = $id_liste_droit_acces;
189 189
 			$this->nom_liste = $nom_liste;
190 190
 			$this->nb_droit_acces = $nb_droit_acces;
Please login to merge, or discard this patch.
Braces   +10 added lines, -5 removed lines patch added patch discarded remove patch
@@ -59,8 +59,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
Please login to merge, or discard this patch.
core/admin/droitsacces/initialise/ajout_modification.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -7,8 +7,7 @@  discard block
 block discarded – undo
7 7
 		$article = $_SESSION['contenu'];*/
8 8
 
9 9
 		unset($_SESSION['err_modification_droitsacces']);
10
-	}
11
-	else if ($page == "gestion-droits-acces/modifier-liste") {
10
+	} else if ($page == "gestion-droits-acces/modifier-liste") {
12 11
 		$gestion_droit_acces = new \core\admin\droitsacces\GestionDroitAcces($_GET['id_liste']);
13 12
 		/*$id_article = $_GET['id_article'];
14 13
 		$balise_title = $admin_blog->getBaliseTitle();
@@ -16,8 +15,7 @@  discard block
 block discarded – undo
16 15
 		$meta_description = $admin_blog->getMetaDescription();
17 16
 		$titre_courant = $admin_blog->getTitre();
18 17
 		$article = $admin_blog->getContenuArticle();*/
19
-	}
20
-	else {
18
+	} else {
21 19
 		$balise_title = null;
22 20
 		$url = null;
23 21
 		$meta_description = null;
Please login to merge, or discard this patch.
core/admin/droitsacces/DroitAcces.class.php 3 patches
Indentation   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -1,10 +1,10 @@  discard block
 block discarded – undo
1 1
 <?php
2
-    namespace core\admin\droitsacces;
2
+	namespace core\admin\droitsacces;
3 3
 
4 4
 	use core\App;
5 5
 
6 6
 	class DroitAcces {
7
-    	private $logged;
7
+		private $logged;
8 8
 
9 9
 		//pour la table identite
10 10
 		private $id_identite;
@@ -21,10 +21,10 @@  discard block
 block discarded – undo
21 21
 
22 22
 
23 23
 		//-------------------------- CONSTRUCTEUR ----------------------------------------------------------------------------//
24
-        public function __construct() {
24
+		public function __construct() {
25 25
 			$dbc = \core\App::getDb();
26 26
 
27
-            if (isset($_SESSION["idlogin".CLEF_SITE])) {
27
+			if (isset($_SESSION["idlogin".CLEF_SITE])) {
28 28
 				$this->logged = true;
29 29
 				$this->id_identite = $_SESSION["idlogin".CLEF_SITE];
30 30
 
@@ -44,36 +44,36 @@  discard block
 block discarded – undo
44 44
 			else {
45 45
 				$this->logged = false;
46 46
 			}
47
-        }
48
-        //-------------------------- FIN CONSTRUCTEUR ----------------------------------------------------------------------------//
47
+		}
48
+		//-------------------------- FIN CONSTRUCTEUR ----------------------------------------------------------------------------//
49 49
     
50 50
     
51 51
     
52
-        //-------------------------- GETTER ----------------------------------------------------------------------------//
52
+		//-------------------------- GETTER ----------------------------------------------------------------------------//
53 53
 		public function getLogged(){
54
-		    return $this->logged;
54
+			return $this->logged;
55 55
 		}
56 56
 		public function getSuperAdmin(){
57
-		    return $this->super_admin;
57
+			return $this->super_admin;
58 58
 		}
59 59
 
60 60
 		//pour la table liste_droit_acces
61 61
 		public function getIdListeDroitAcces(){
62
-		    return $this->id_liste_droit_acces;
62
+			return $this->id_liste_droit_acces;
63 63
 		}
64 64
 
65 65
 		//pour les droits sur la gestion des contenus
66 66
 		public function getModifSeo(){
67
-		    return $this->modif_seo;
67
+			return $this->modif_seo;
68 68
 		}
69 69
 		public function getModifContenu(){
70
-		    return $this->modif_contenu;
70
+			return $this->modif_contenu;
71 71
 		}
72 72
 		public function getModifNavigation(){
73
-		    return $this->modif_navigation;
73
+			return $this->modif_navigation;
74 74
 		}
75 75
 		public function getSupprimerPage(){
76
-		    return $this->supprimer_page;
76
+			return $this->supprimer_page;
77 77
 		}
78 78
 
79 79
 		//autres getter
@@ -240,11 +240,11 @@  discard block
 block discarded – undo
240 240
 				return true;
241 241
 			}
242 242
 		}
243
-        //-------------------------- FIN GETTER ----------------------------------------------------------------------------//
243
+		//-------------------------- FIN GETTER ----------------------------------------------------------------------------//
244 244
     
245 245
     
246 246
     
247
-        //-------------------------- SETTER ----------------------------------------------------------------------------//
247
+		//-------------------------- SETTER ----------------------------------------------------------------------------//
248 248
 
249
-        //-------------------------- FIN SETTER ----------------------------------------------------------------------------//
250
-    }
251 249
\ No newline at end of file
250
+		//-------------------------- FIN SETTER ----------------------------------------------------------------------------//
251
+	}
252 252
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -50,29 +50,29 @@
 block discarded – undo
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
 
Please login to merge, or discard this patch.
Braces   +31 added lines, -37 removed lines patch added patch discarded remove patch
@@ -31,17 +31,17 @@  discard block
 block discarded – undo
31 31
 				//on test voir si super admin
32 32
 				$query = $dbc->query("SELECT super_admin,liste_droit FROM identite WHERE ID_identite=".$this->id_identite);
33 33
 				foreach ($query as $obj) {
34
-					if ($obj->super_admin == 1) $this->super_admin = 1;
34
+					if ($obj->super_admin == 1) {
35
+						$this->super_admin = 1;
36
+					}
35 37
 
36 38
 					if ($obj->liste_droit == 1) {
37 39
 						$this->id_liste_droit_acces = $obj->liste_droit;
38
-					}
39
-					else {
40
+					} else {
40 41
 						$this->id_liste_droit_acces = 0;
41 42
 					}
42 43
 				}
43
-			}
44
-			else {
44
+			} else {
45 45
 				$this->logged = false;
46 46
 			}
47 47
         }
@@ -93,14 +93,15 @@  discard block
 block discarded – undo
93 93
 
94 94
 				if (!in_array($page, $all_access)) {
95 95
 					$query = $dbc->query("SELECT droit_acces FROM droit_acces WHERE page LIKE '%$page%'");
96
-					foreach ($query as $obj) $droit_acces = $obj->droit_acces;
96
+					foreach ($query as $obj) {
97
+						$droit_acces = $obj->droit_acces;
98
+					}
97 99
 				}
98 100
 
99 101
 				//si la page n'est pas trouvée dans les droit d'accès c'est qu'elle est obligatoirement accessible dans admin
100 102
 				if (!isset($droit_acces)) {
101 103
 					$acces = true;
102
-				}
103
-				else {
104
+				} else {
104 105
 					$acces = false;
105 106
 				}
106 107
 
@@ -112,25 +113,23 @@  discard block
 block discarded – undo
112 113
 				");
113 114
 
114 115
 				if (count($query) > 0) {
115
-					foreach ($query as $obj) $liste_droit_acces[] = $obj->droit_acces;
116
+					foreach ($query as $obj) {
117
+						$liste_droit_acces[] = $obj->droit_acces;
118
+					}
116 119
 
117 120
 					if (($this->super_admin == 1) || ($acces == true) || (in_array($droit_acces, $liste_droit_acces)) || (($page == "") || ($page == null))) {
118 121
 						return true;
119
-					}
120
-					else {
122
+					} else {
121 123
 						return false;
122 124
 					}
123
-				}
124
-				else {
125
+				} else {
125 126
 					if ($acces == true) {
126 127
 						return true;
127
-					}
128
-					else {
128
+					} else {
129 129
 						return false;
130 130
 					}
131 131
 				}
132
-			}
133
-			else {
132
+			} else {
134 133
 				return true;
135 134
 			}
136 135
 		}
@@ -155,7 +154,9 @@  discard block
 block discarded – undo
155 154
 								liste_droit_acces.ID_liste_droit_acces = liaison_liste_droit.ID_liste_droit_acces AND
156 155
 								liste_droit_acces.ID_liste_droit_acces = $this->id_liste_droit_acces
157 156
 				");
158
-				foreach ($query as $obj) $liste_droit_acces[] = $obj->droit_acces;
157
+				foreach ($query as $obj) {
158
+					$liste_droit_acces[] = $obj->droit_acces;
159
+				}
159 160
 
160 161
 				if (in_array($droit, $liste_droit_acces)) {
161 162
 					//on check si il a le droit de modifier ou supprimer cette page
@@ -178,27 +179,21 @@  discard block
 block discarded – undo
178 179
 							//si les trois sont différent de 0 on renvoit true soinon false
179 180
 							if (($this->modif_seo != 0) || ($this->modif_contenu != 0) || ($this->modif_navigation != 0) || ($this->supprimer_page != 0)) {
180 181
 								return true;
181
-							}
182
-							else {
182
+							} else {
183 183
 								return false;
184 184
 							}
185
-						}
186
-						else {
185
+						} else {
187 186
 							return false;
188 187
 						}
189
-					}
190
-					else if ($id_page == "creation_page") {
188
+					} else if ($id_page == "creation_page") {
191 189
 						$this->getDroitAccesPage("gestion-contenus/index");
192
-					}
193
-					else {
190
+					} else {
194 191
 						return false;
195 192
 					}
196
-				}
197
-				else {
193
+				} else {
198 194
 					return false;
199 195
 				}
200
-			}
201
-			else {
196
+			} else {
202 197
 				$this->modif_seo = 1;
203 198
 				$this->modif_contenu = 1;
204 199
 				$this->modif_navigation = 1;
@@ -223,20 +218,19 @@  discard block
 block discarded – undo
223 218
 								liste_droit_acces.ID_liste_droit_acces = $this->id_liste_droit_acces
224 219
 				");
225 220
 				if (count($query) > 0) {
226
-					foreach ($query as $obj) $liste_droit_acces[] = $obj->droit_acces;
221
+					foreach ($query as $obj) {
222
+						$liste_droit_acces[] = $obj->droit_acces;
223
+					}
227 224
 
228 225
 					if (($this->super_admin == 1) || (in_array($droit_acces, $liste_droit_acces))) {
229 226
 						return true;
230
-					}
231
-					else {
227
+					} else {
232 228
 						return false;
233 229
 					}
234
-				}
235
-				else {
230
+				} else {
236 231
 					return false;
237 232
 				}
238
-			}
239
-			else {
233
+			} else {
240 234
 				return true;
241 235
 			}
242 236
 		}
Please login to merge, or discard this patch.
core/admin/comptes/creer_utilisateur.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@
 block discarded – undo
18 18
 		session_start();
19 19
 		$_SESSION['err_ajout_utilisateur'] = true;
20 20
 		$_SESSION['nom'] = $inscription->getNom();
21
-		$_SESSION['prenom']= $inscription->getPrenom();
21
+		$_SESSION['prenom'] = $inscription->getPrenom();
22 22
 		$_SESSION['pseudo'] = $inscription->getPseudo();
23 23
 		$_SESSION['mail'] = $inscription->getMail();
24 24
 		$_SESSION['acces_admin'] = $inscription->getAccesAdministration();
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -24,8 +24,7 @@
 block discarded – undo
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
 	}
Please login to merge, or discard this patch.
core/admin/inscription/AdminInscription.class.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
 		 * @param null $required
31 31
 		 * @return bool
32 32
 		 */
33
-		protected function setVerifAccesAdministration($value, $required=null) {
33
+		protected function setVerifAccesAdministration($value, $required = null) {
34 34
 			//on verifie que la valeur est bien un int
35 35
 			//test avec le required, si le champe est vide et que le required est != null on return fa	lse sinon on va tester
36 36
 			if (($required != null) && ($this->getTestRequired($value) == false)) {
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
 		 * @param null $required
59 59
 		 * @return bool
60 60
 		 */
61
-		protected function setVerifListeDroitAcces($value, $required=null) {
61
+		protected function setVerifListeDroitAcces($value, $required = null) {
62 62
 			//on verifie que la valeur est bien un int
63 63
 			//test avec le required, si le champe est vide et que le required est != null on return fa	lse sinon on va tester
64 64
 			if (($required != null) && ($this->getTestRequired($value) == false)) {
Please login to merge, or discard this patch.
Braces   +6 added lines, -12 removed lines patch added patch discarded remove patch
@@ -36,17 +36,14 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 			}
Please login to merge, or discard this patch.