Completed
Push — master ( aa8f4f...e4c4a7 )
by cam
05:04
created
ecrire/inc/acces.php 1 patch
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
  *     Mot de passe
32 32
  **/
33 33
 function creer_pass_aleatoire($longueur = 16, $sel = '') {
34
-	$seed = (int)round(((float)microtime() + 1) * time());
34
+	$seed = (int) round(((float) microtime() + 1) * time());
35 35
 
36 36
 	mt_srand($seed);
37 37
 	srand($seed);
@@ -43,9 +43,9 @@  discard block
 block discarded – undo
43 43
 			if (!$s) {
44 44
 				$s = rand();
45 45
 			}
46
-			$s = substr(md5(uniqid($s) . $sel), 0, 16);
46
+			$s = substr(md5(uniqid($s).$sel), 0, 16);
47 47
 		}
48
-		$r = unpack('Cr', pack('H2', $s . $s));
48
+		$r = unpack('Cr', pack('H2', $s.$s));
49 49
 		$x = $r['r'] & 63;
50 50
 		if ($x < 10) {
51 51
 			$x = chr($x + 48);
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
 	static $seeded;
84 84
 
85 85
 	if (!$seeded) {
86
-		$seed = (int)round(((float)microtime() + 1) * time());
86
+		$seed = (int) round(((float) microtime() + 1) * time());
87 87
 		mt_srand($seed);
88 88
 		srand($seed);
89 89
 		$seeded = true;
@@ -193,9 +193,9 @@  discard block
 block discarded – undo
193 193
 	foreach ($args as $val => $var) {
194 194
 		if ($var) {
195 195
 			if ($val <> 'statut') {
196
-				$a .= ':' . $val . '-' . $var;
196
+				$a .= ':'.$val.'-'.$var;
197 197
 			}
198
-			$b .= $val . '=' . $var . '&';
198
+			$b .= $val.'='.$var.'&';
199 199
 		}
200 200
 	}
201 201
 	$a = substr($a, 1);
@@ -225,7 +225,7 @@  discard block
 block discarded – undo
225 225
  *     Clé
226 226
  **/
227 227
 function afficher_low_sec($id_auteur, $action = '') {
228
-	return substr(md5($action . low_sec($id_auteur)), 0, 8);
228
+	return substr(md5($action.low_sec($id_auteur)), 0, 8);
229 229
 }
230 230
 
231 231
 /**
@@ -267,7 +267,7 @@  discard block
 block discarded – undo
267 267
 function initialiser_sel() {
268 268
 	if (!isset($GLOBALS['htsalt'])) {
269 269
 		if (CRYPT_MD5) {
270
-			$GLOBALS['htsalt'] = '$1$' . creer_pass_aleatoire();
270
+			$GLOBALS['htsalt'] = '$1$'.creer_pass_aleatoire();
271 271
 		} else {
272 272
 			$GLOBALS['htsalt'] = '';
273 273
 		}
@@ -289,8 +289,8 @@  discard block
 block discarded – undo
289 289
  *     - void sinon.
290 290
  **/
291 291
 function ecrire_acces() {
292
-	$htaccess = _DIR_RESTREINT . _ACCESS_FILE_NAME;
293
-	$htpasswd = _DIR_TMP . _AUTH_USER_FILE;
292
+	$htaccess = _DIR_RESTREINT._ACCESS_FILE_NAME;
293
+	$htpasswd = _DIR_TMP._AUTH_USER_FILE;
294 294
 
295 295
 	// Cette variable de configuration peut etre posee par un plugin
296 296
 	// par exemple acces_restreint ;
@@ -300,7 +300,7 @@  discard block
 block discarded – undo
300 300
 		and !@file_exists($htaccess)
301 301
 	) {
302 302
 		spip_unlink($htpasswd);
303
-		spip_unlink($htpasswd . '-admin');
303
+		spip_unlink($htpasswd.'-admin');
304 304
 		return;
305 305
 	}
306 306
 
@@ -332,7 +332,7 @@  discard block
 block discarded – undo
332 332
 	$res = sql_select('login, htpass, statut', 'spip_auteurs', "htpass!='' AND login!='' AND ".sql_in('statut', ['1comite', '0minirezo', 'nouveau']));
333 333
 	while ($row = sql_fetch($res)) {
334 334
 		if (strlen($row['login']) and strlen($row['htpass'])) {
335
-			$ligne = $row['login'] . ':' . $row['htpass'] . "\n";
335
+			$ligne = $row['login'].':'.$row['htpass']."\n";
336 336
 			$pwd_all .= $ligne;
337 337
 			if ($row['statut'] == '0minirezo') {
338 338
 				$pwd_admin .= $ligne;
@@ -377,7 +377,7 @@  discard block
 block discarded – undo
377 377
  * @return boolean
378 378
  */
379 379
 function verifier_htaccess($rep, $force = false) {
380
-	$htaccess = rtrim($rep, '/') . '/' . _ACCESS_FILE_NAME;
380
+	$htaccess = rtrim($rep, '/').'/'._ACCESS_FILE_NAME;
381 381
 	if (((@file_exists($htaccess)) or defined('_TEST_DIRS')) and !$force) {
382 382
 		return true;
383 383
 	}
@@ -404,19 +404,19 @@  discard block
 block discarded – undo
404 404
 		fputs($ht, $deny);
405 405
 		fclose($ht);
406 406
 		@chmod($htaccess, _SPIP_CHMOD & 0666);
407
-		$t = rtrim($rep, '/') . '/.ok';
407
+		$t = rtrim($rep, '/').'/.ok';
408 408
 		if ($ht = @fopen($t, 'w')) {
409 409
 			@fclose($ht);
410 410
 			include_spip('inc/distant');
411 411
 			$t = substr($t, strlen(_DIR_RACINE));
412
-			$t = url_de_base() . $t;
412
+			$t = url_de_base().$t;
413 413
 			$ht = recuperer_url($t, ['methode' => 'HEAD', 'taille_max' => 0, 'follow_location' => false]);
414 414
 			// htaccess inoperant si on a recupere des entetes HTTP
415 415
 			// (ignorer la reussite si connexion par fopen)
416 416
 			$ht = !(isset($ht['headers']) and $ht['headers']);
417 417
 		}
418 418
 	}
419
-	spip_log("Creation de $htaccess " . ($ht ? ' reussie' : ' manquee'));
419
+	spip_log("Creation de $htaccess ".($ht ? ' reussie' : ' manquee'));
420 420
 
421 421
 	return $ht;
422 422
 }
@@ -442,11 +442,11 @@  discard block
 block discarded – undo
442 442
 	$dirs = sql_allfetsel('extension', 'spip_types_documents');
443 443
 	$dirs[] = array('extension' => 'distant');
444 444
 	foreach ($dirs as $e) {
445
-		if (is_dir($dir = _DIR_IMG . $e['extension'])) {
445
+		if (is_dir($dir = _DIR_IMG.$e['extension'])) {
446 446
 			if ($f) {
447 447
 				verifier_htaccess($dir);
448 448
 			} else {
449
-				spip_unlink($dir . '/' . _ACCESS_FILE_NAME);
449
+				spip_unlink($dir.'/'._ACCESS_FILE_NAME);
450 450
 			}
451 451
 		}
452 452
 	}
Please login to merge, or discard this patch.