Passed
Push — master ( f418e9...b58333 )
by Anthony
04:11
created
core/auth/Encrypt.class.php 1 patch
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@  discard block
 block discarded – undo
15 15
 		//-------------------------- GETTER ----------------------------------------------------------------------------//
16 16
 		/**
17 17
 		 * @param null $id_identite
18
-		 * @return mixed
18
+		 * @return string
19 19
 		 */
20 20
 		public static function getParams($id_identite=null) {
21 21
 			if ($id_identite != null) {
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
 		//-------------------------- SETTER ----------------------------------------------------------------------------//
39 39
 		/**
40 40
 		 * fonction qui permet d'encrypter un mot de passe, une fois encrype, on save les params pour le retrouver en bdd
41
-		 * @param $mdp
41
+		 * @param string|null $mdp
42 42
 		 * @param $id_identite
43 43
 		 * @return string
44 44
 		 */
Please login to merge, or discard this patch.
core/auth/Membre.class.php 3 patches
Unused Use Statements   -2 removed lines patch added patch discarded remove patch
@@ -2,8 +2,6 @@
 block discarded – undo
2 2
 	namespace core\auth;
3 3
 
4 4
 
5
-	use core\images\Resize;
6
-
7 5
 	class Membre {
8 6
 		protected $id_identite;
9 7
 		protected $nom;
Please login to merge, or discard this patch.
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
 		
20 20
 		//------------------------------ constructeur-----------------------------------
21 21
 		//Récupérer en base de données les infos du membre
22
-		public function __construct($id_identite=null){
22
+		public function __construct($id_identite = null) {
23 23
 			$dbc = \core\App::getDb();
24 24
 
25 25
 			$this->debut_lien = IMGROOT."profil/";
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
 		/**
86 86
 		 * @param null $id_identite
87 87
 		 */
88
-		public function setSupprimUser($id_identite=null) {
88
+		public function setSupprimUser($id_identite = null) {
89 89
 			$dbc = \core\App::getDb();
90 90
 
91 91
 			if ($id_identite == null) {
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
 			$oldimg_profil = $obj->img_profil;
100 100
 			if ($oldimg_profil != "") {
101 101
 				$oldimg_profil = explode("/", $oldimg_profil);
102
-				if(end($oldimg_profil) == "defaut.png") {
102
+				if (end($oldimg_profil) == "defaut.png") {
103 103
 					
104 104
 				}
105 105
 				else {
@@ -194,22 +194,22 @@  discard block
 block discarded – undo
194 194
 		 * @param string $mdp
195 195
 		 * @return integer
196 196
 		 */
197
-		function testpassword($mdp)	{
197
+		function testpassword($mdp) {
198 198
 			$longueur = strlen($mdp);
199 199
 			$point = 0;
200 200
 
201
-			for ($i=0 ; $i<$longueur ; $i++) 	{
201
+			for ($i = 0; $i < $longueur; $i++) {
202 202
 				$lettre = $mdp[$i];
203 203
 
204 204
 				if ($lettre >= 'a' && $lettre <= 'z') {
205 205
 					$point = $point + 1;
206 206
 					$point_min = 1;
207 207
 				}
208
-				else if ($lettre >= 'A' && $lettre <= 'Z'){
208
+				else if ($lettre >= 'A' && $lettre <= 'Z') {
209 209
 					$point = $point + 2;
210 210
 					$point_maj = 2;
211 211
 				}
212
-				else if ($lettre >= '0' && $lettre <= '9'){
212
+				else if ($lettre >= '0' && $lettre <= '9') {
213 213
 					$point = $point + 3;
214 214
 					$point_chiffre = 3;
215 215
 				}
Please login to merge, or discard this patch.
Braces   +12 added lines, -24 removed lines patch added patch discarded remove patch
@@ -38,8 +38,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 				}
Please login to merge, or discard this patch.
core/images/Images.class.php 1 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.