Completed
Pull Request — master (#40)
by
unknown
04:13
created
prive/formulaires/configurer_annonces.php 2 patches
Indentation   +69 added lines, -69 removed lines patch added patch discarded remove patch
@@ -11,87 +11,87 @@
 block discarded – undo
11 11
 \***************************************************************************/
12 12
 
13 13
 if (!defined('_ECRIRE_INC_VERSION')) {
14
-	return;
14
+    return;
15 15
 }
16 16
 
17 17
 function formulaires_configurer_annonces_charger_dist() {
18
-	$valeurs = array();
19
-	foreach (array(
20
-		'suivi_edito',
21
-		'adresse_suivi',
22
-		'adresse_suivi_inscription',
23
-		'quoi_de_neuf',
24
-		'adresse_neuf',
25
-		'jours_neuf',
26
-		'email_envoi',
27
-	) as $m) {
28
-		$valeurs[$m] = $GLOBALS['meta'][$m];
29
-	}
18
+    $valeurs = array();
19
+    foreach (array(
20
+        'suivi_edito',
21
+        'adresse_suivi',
22
+        'adresse_suivi_inscription',
23
+        'quoi_de_neuf',
24
+        'adresse_neuf',
25
+        'jours_neuf',
26
+        'email_envoi',
27
+    ) as $m) {
28
+        $valeurs[$m] = $GLOBALS['meta'][$m];
29
+    }
30 30
 
31
-	return $valeurs;
31
+    return $valeurs;
32 32
 }
33 33
 
34 34
 function formulaires_configurer_annonces_verifier_dist() {
35
-	$erreurs = array();
36
-	if (_request('suivi_edito') == 'oui') {
37
-		if (!$email = _request('adresse_suivi')) {
38
-			$erreurs['adresse_suivi'] = _T('info_obligatoire');
39
-		} else {
40
-			include_spip('inc/filtres');
41
-			if (!email_valide($email)) {
42
-				$erreurs['adresse_suivi'] = _T('form_prop_indiquer_email');
43
-			}
44
-		}
45
-	}
46
-	if (_request('quoi_de_neuf') == 'oui') {
47
-		if (!$email = _request('adresse_neuf')) {
48
-			$erreurs['adresse_neuf'] = _T('info_obligatoire');
49
-		} else {
50
-			include_spip('inc/filtres');
51
-			if (!email_valide($email)) {
52
-				$erreurs['adresse_neuf'] = _T('form_prop_indiquer_email');
53
-			}
54
-		}
55
-		if (!$email = _request('jours_neuf')) {
56
-			$erreurs['jours_neuf'] = _T('info_obligatoire');
57
-		}
58
-	}
35
+    $erreurs = array();
36
+    if (_request('suivi_edito') == 'oui') {
37
+        if (!$email = _request('adresse_suivi')) {
38
+            $erreurs['adresse_suivi'] = _T('info_obligatoire');
39
+        } else {
40
+            include_spip('inc/filtres');
41
+            if (!email_valide($email)) {
42
+                $erreurs['adresse_suivi'] = _T('form_prop_indiquer_email');
43
+            }
44
+        }
45
+    }
46
+    if (_request('quoi_de_neuf') == 'oui') {
47
+        if (!$email = _request('adresse_neuf')) {
48
+            $erreurs['adresse_neuf'] = _T('info_obligatoire');
49
+        } else {
50
+            include_spip('inc/filtres');
51
+            if (!email_valide($email)) {
52
+                $erreurs['adresse_neuf'] = _T('form_prop_indiquer_email');
53
+            }
54
+        }
55
+        if (!$email = _request('jours_neuf')) {
56
+            $erreurs['jours_neuf'] = _T('info_obligatoire');
57
+        }
58
+    }
59 59
 
60
-	return $erreurs;
60
+    return $erreurs;
61 61
 }
62 62
 
63 63
 function formulaires_configurer_annonces_traiter_dist() {
64
-	$res = array('editable' => true);
65
-	foreach (array(
66
-		'suivi_edito',
67
-		'quoi_de_neuf',
68
-	) as $m) {
69
-		if (!is_null($v = _request($m))) {
70
-			ecrire_meta($m, $v == 'oui' ? 'oui' : 'non');
71
-		}
72
-	}
64
+    $res = array('editable' => true);
65
+    foreach (array(
66
+        'suivi_edito',
67
+        'quoi_de_neuf',
68
+    ) as $m) {
69
+        if (!is_null($v = _request($m))) {
70
+            ecrire_meta($m, $v == 'oui' ? 'oui' : 'non');
71
+        }
72
+    }
73 73
 
74
-	foreach (array(
75
-		'adresse_suivi',
76
-		'adresse_suivi_inscription',
77
-		'adresse_neuf',
78
-		'jours_neuf',
79
-		'email_envoi',
80
-	) as $m) {
81
-		if (!is_null($v = _request($m))) {
82
-			ecrire_meta($m, $v);
83
-		}
84
-	}
74
+    foreach (array(
75
+        'adresse_suivi',
76
+        'adresse_suivi_inscription',
77
+        'adresse_neuf',
78
+        'jours_neuf',
79
+        'email_envoi',
80
+    ) as $m) {
81
+        if (!is_null($v = _request($m))) {
82
+            ecrire_meta($m, $v);
83
+        }
84
+    }
85 85
 
86
-	$res['message_ok'] = _T('config_info_enregistree');
87
-	// provoquer l'envoi des nouveautes en supprimant le fichier lock
88
-	if (_request('envoi_now')) {
89
-		effacer_meta('dernier_envoi_neuf');
90
-		$id_job = job_queue_add('mail', 'Test Envoi des nouveautes', array(0), 'genie/');
91
-		include_spip('inc/queue');
92
-		queue_schedule(array($id_job));
93
-		$res['message_ok'] .= '<br />' . _T('info_liste_nouveautes_envoyee');
94
-	}
86
+    $res['message_ok'] = _T('config_info_enregistree');
87
+    // provoquer l'envoi des nouveautes en supprimant le fichier lock
88
+    if (_request('envoi_now')) {
89
+        effacer_meta('dernier_envoi_neuf');
90
+        $id_job = job_queue_add('mail', 'Test Envoi des nouveautes', array(0), 'genie/');
91
+        include_spip('inc/queue');
92
+        queue_schedule(array($id_job));
93
+        $res['message_ok'] .= '<br />' . _T('info_liste_nouveautes_envoyee');
94
+    }
95 95
 
96
-	return $res;
96
+    return $res;
97 97
 }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -90,7 +90,7 @@
 block discarded – undo
90 90
 		$id_job = job_queue_add('mail', 'Test Envoi des nouveautes', array(0), 'genie/');
91 91
 		include_spip('inc/queue');
92 92
 		queue_schedule(array($id_job));
93
-		$res['message_ok'] .= '<br />' . _T('info_liste_nouveautes_envoyee');
93
+		$res['message_ok'] .= '<br />'._T('info_liste_nouveautes_envoyee');
94 94
 	}
95 95
 
96 96
 	return $res;
Please login to merge, or discard this patch.
prive/formulaires/declarer_bases.php 2 patches
Indentation   +193 added lines, -193 removed lines patch added patch discarded remove patch
@@ -11,221 +11,221 @@
 block discarded – undo
11 11
 \***************************************************************************/
12 12
 
13 13
 if (!defined('_ECRIRE_INC_VERSION')) {
14
-	return;
14
+    return;
15 15
 }
16 16
 
17 17
 include_spip('inc/install');
18 18
 
19 19
 function formulaires_declarer_bases_charger_dist() {
20
-	list($adresse_db, $login_db, $pass_db, $sel, $server_db) = analyse_fichier_connection(_FILE_CONNECT);
21
-
22
-	$deja = bases_referencees(_FILE_CONNECT);
23
-	// proposer un nom de connect si pas encore saisi
24
-	$nom_connect = '';
25
-	if (defined('_DECLARER_CHOIX_DB')) {
26
-		$nom_connect = _DECLARER_CHOIX_DB;
27
-		$n = '';
28
-		while (in_array($nom_connect . $n, $deja)) {
29
-			$n = ($n ? $n + 1 : 1);
30
-		}
31
-		$nom_connect = $nom_connect . $n;
32
-	}
33
-
34
-	$valeurs = array(
35
-		'_etapes' => 3,
36
-		'_bases_deja' => $deja,
37
-		'_bases_prop' => defined('_DECLARER_SERVEUR_DB') ? liste_bases(_DECLARER_SERVEUR_DB) : '',
38
-		'_tables' => (defined('_DECLARER_SERVEUR_DB') and defined('_DECLARER_CHOIX_DB')) ?
39
-			$tables = sql_alltable('%', _DECLARER_SERVEUR_DB)
40
-			:
41
-			array(),
42
-		'main_db' => '',
43
-		'_serveurs' => liste_serveurs(),
44
-		'sql_serveur_db' => 'sqlite3', // valeur par defaut
45
-		'adresse_db' => $adresse_db,
46
-		'login_db' => '',
47
-		'pass_db' => '',
48
-		'choix_db' => '',
49
-		'table_new' => '',
50
-		'nom_connect' => $nom_connect,
51
-	);
52
-
53
-	return $valeurs;
20
+    list($adresse_db, $login_db, $pass_db, $sel, $server_db) = analyse_fichier_connection(_FILE_CONNECT);
21
+
22
+    $deja = bases_referencees(_FILE_CONNECT);
23
+    // proposer un nom de connect si pas encore saisi
24
+    $nom_connect = '';
25
+    if (defined('_DECLARER_CHOIX_DB')) {
26
+        $nom_connect = _DECLARER_CHOIX_DB;
27
+        $n = '';
28
+        while (in_array($nom_connect . $n, $deja)) {
29
+            $n = ($n ? $n + 1 : 1);
30
+        }
31
+        $nom_connect = $nom_connect . $n;
32
+    }
33
+
34
+    $valeurs = array(
35
+        '_etapes' => 3,
36
+        '_bases_deja' => $deja,
37
+        '_bases_prop' => defined('_DECLARER_SERVEUR_DB') ? liste_bases(_DECLARER_SERVEUR_DB) : '',
38
+        '_tables' => (defined('_DECLARER_SERVEUR_DB') and defined('_DECLARER_CHOIX_DB')) ?
39
+            $tables = sql_alltable('%', _DECLARER_SERVEUR_DB)
40
+            :
41
+            array(),
42
+        'main_db' => '',
43
+        '_serveurs' => liste_serveurs(),
44
+        'sql_serveur_db' => 'sqlite3', // valeur par defaut
45
+        'adresse_db' => $adresse_db,
46
+        'login_db' => '',
47
+        'pass_db' => '',
48
+        'choix_db' => '',
49
+        'table_new' => '',
50
+        'nom_connect' => $nom_connect,
51
+    );
52
+
53
+    return $valeurs;
54 54
 }
55 55
 
56 56
 function liste_serveurs() {
57
-	$options = array();
58
-	$dir = _DIR_RESTREINT . 'req/';
59
-	$d = opendir($dir);
60
-	if (!$d) {
61
-		return array();
62
-	}
63
-	while ($f = readdir($d)) {
64
-		if ((preg_match('/^(.*)[.]php$/', $f, $s))
65
-			and is_readable($f = $dir . $f)
66
-		) {
67
-			require_once($f);
68
-			$s = $s[1];
69
-			$v = 'spip_versions_' . $s;
70
-			if (function_exists($v) and $v()) {
71
-				$options[$s] = "install_select_type_$s";
72
-			} else {
73
-				spip_log("$s: portage indisponible");
74
-			}
75
-		}
76
-	}
77
-	ksort($options);
78
-
79
-	return $options;
57
+    $options = array();
58
+    $dir = _DIR_RESTREINT . 'req/';
59
+    $d = opendir($dir);
60
+    if (!$d) {
61
+        return array();
62
+    }
63
+    while ($f = readdir($d)) {
64
+        if ((preg_match('/^(.*)[.]php$/', $f, $s))
65
+            and is_readable($f = $dir . $f)
66
+        ) {
67
+            require_once($f);
68
+            $s = $s[1];
69
+            $v = 'spip_versions_' . $s;
70
+            if (function_exists($v) and $v()) {
71
+                $options[$s] = "install_select_type_$s";
72
+            } else {
73
+                spip_log("$s: portage indisponible");
74
+            }
75
+        }
76
+    }
77
+    ksort($options);
78
+
79
+    return $options;
80 80
 }
81 81
 
82 82
 function liste_bases($server_db) {
83
-	if (is_null($server_db)
84
-		or !$result = sql_listdbs($server_db)
85
-	) {
86
-		return '';
87
-	}
88
-
89
-	$noms = array();
90
-
91
-	// si sqlite : result est deja un tableau
92
-	if (is_array($result)) {
93
-		$noms = $result;
94
-	} else {
95
-		while ($row = sql_fetch($result, $server_db)) {
96
-			$noms[] = reset($row);
97
-		}
98
-	}
99
-
100
-	return $noms;
83
+    if (is_null($server_db)
84
+        or !$result = sql_listdbs($server_db)
85
+    ) {
86
+        return '';
87
+    }
88
+
89
+    $noms = array();
90
+
91
+    // si sqlite : result est deja un tableau
92
+    if (is_array($result)) {
93
+        $noms = $result;
94
+    } else {
95
+        while ($row = sql_fetch($result, $server_db)) {
96
+            $noms[] = reset($row);
97
+        }
98
+    }
99
+
100
+    return $noms;
101 101
 }
102 102
 
103 103
 function formulaires_declarer_bases_verifier_1_dist() {
104
-	$erreurs = array();
105
-	list($def_adresse_db, $def_login_db, $def_pass_db, $sel_db, $def_serveur_db) = analyse_fichier_connection(_FILE_CONNECT);
106
-
107
-	if (!$adresse_db = _request('adresse_db')) {
108
-		if (defined('_INSTALL_HOST_DB')) {
109
-			$adresse_db = _INSTALL_HOST_DB;
110
-		} else {
111
-			$adresse_db = $def_adresse_db;
112
-		}
113
-	}
114
-	if (!$serveur_db = _request('sql_serveur_db')) {
115
-		if (defined('_INSTALL_SERVER_DB')) {
116
-			$serveur_db = _INSTALL_SERVER_DB;
117
-		} else {
118
-			$serveur_db = $def_serveur_db;
119
-		}
120
-	}
121
-
122
-	$login_db = $pass_db = '';
123
-	if (!preg_match(',^sqlite,i', $serveur_db)) {
124
-		if (!$login_db = _request('login_db')) {
125
-			if (defined('_INSTALL_USER_DB')) {
126
-				$login_db = _INSTALL_USER_DB;
127
-			} else {
128
-				$login_db = $def_login_db;
129
-			}
130
-		}
131
-		if (!$pass_db = _request('pass_db')) {
132
-			if (defined('_INSTALL_PASS_DB')) {
133
-				$pass_db = _INSTALL_PASS_DB;
134
-			} else {
135
-				$pass_db = $def_pass_db;
136
-			}
137
-		}
138
-	}
139
-
140
-	$link = spip_connect_db($adresse_db, '', $login_db, $pass_db, '@test@', $serveur_db);
141
-	if ($link) {
142
-		$GLOBALS['connexions'][$serveur_db][$GLOBALS['spip_sql_version']] = $GLOBALS['spip_' . $serveur_db . '_functions_' . $GLOBALS['spip_sql_version']];
143
-		$GLOBALS['connexions'][$serveur_db] = $link;
144
-		define('_DECLARER_SERVEUR_DB', $serveur_db);
145
-		define('_DECLARER_ADRESSE_DB', $adresse_db);
146
-		define('_DECLARER_LOGIN_DB', $login_db);
147
-		define('_DECLARER_PASS_DB', $pass_db);
148
-		// si on est sur le meme serveur que connect.php
149
-		// indiquer quelle est la db utilisee pour l'exclure des choix possibles
150
-		if ($serveur_db == $def_serveur_db and $adresse_db == $def_adresse_db) {
151
-			set_request('main_db', $sel_db);
152
-		} else {
153
-			set_request('main_db', '');
154
-		}
155
-	} else {
156
-		$erreurs['message_erreur'] = _T('avis_connexion_echec_1');
157
-	}
158
-
159
-	return $erreurs;
104
+    $erreurs = array();
105
+    list($def_adresse_db, $def_login_db, $def_pass_db, $sel_db, $def_serveur_db) = analyse_fichier_connection(_FILE_CONNECT);
106
+
107
+    if (!$adresse_db = _request('adresse_db')) {
108
+        if (defined('_INSTALL_HOST_DB')) {
109
+            $adresse_db = _INSTALL_HOST_DB;
110
+        } else {
111
+            $adresse_db = $def_adresse_db;
112
+        }
113
+    }
114
+    if (!$serveur_db = _request('sql_serveur_db')) {
115
+        if (defined('_INSTALL_SERVER_DB')) {
116
+            $serveur_db = _INSTALL_SERVER_DB;
117
+        } else {
118
+            $serveur_db = $def_serveur_db;
119
+        }
120
+    }
121
+
122
+    $login_db = $pass_db = '';
123
+    if (!preg_match(',^sqlite,i', $serveur_db)) {
124
+        if (!$login_db = _request('login_db')) {
125
+            if (defined('_INSTALL_USER_DB')) {
126
+                $login_db = _INSTALL_USER_DB;
127
+            } else {
128
+                $login_db = $def_login_db;
129
+            }
130
+        }
131
+        if (!$pass_db = _request('pass_db')) {
132
+            if (defined('_INSTALL_PASS_DB')) {
133
+                $pass_db = _INSTALL_PASS_DB;
134
+            } else {
135
+                $pass_db = $def_pass_db;
136
+            }
137
+        }
138
+    }
139
+
140
+    $link = spip_connect_db($adresse_db, '', $login_db, $pass_db, '@test@', $serveur_db);
141
+    if ($link) {
142
+        $GLOBALS['connexions'][$serveur_db][$GLOBALS['spip_sql_version']] = $GLOBALS['spip_' . $serveur_db . '_functions_' . $GLOBALS['spip_sql_version']];
143
+        $GLOBALS['connexions'][$serveur_db] = $link;
144
+        define('_DECLARER_SERVEUR_DB', $serveur_db);
145
+        define('_DECLARER_ADRESSE_DB', $adresse_db);
146
+        define('_DECLARER_LOGIN_DB', $login_db);
147
+        define('_DECLARER_PASS_DB', $pass_db);
148
+        // si on est sur le meme serveur que connect.php
149
+        // indiquer quelle est la db utilisee pour l'exclure des choix possibles
150
+        if ($serveur_db == $def_serveur_db and $adresse_db == $def_adresse_db) {
151
+            set_request('main_db', $sel_db);
152
+        } else {
153
+            set_request('main_db', '');
154
+        }
155
+    } else {
156
+        $erreurs['message_erreur'] = _T('avis_connexion_echec_1');
157
+    }
158
+
159
+    return $erreurs;
160 160
 }
161 161
 
162 162
 function formulaires_declarer_bases_verifier_2_dist() {
163
-	$erreurs = array();
164
-	$choix_db = _request('choix_db');
165
-	if ($choix_db == '-1') {
166
-		$choix_db = _request('table_new');
167
-	}
168
-	if (!$choix_db) {
169
-		$erreurs['choix_db'] = _T('info_obligatoire');
170
-	} else {
171
-		define('_ECRIRE_INSTALL', 1); // hackons sqlite
172
-		if (!sql_selectdb($choix_db, _DECLARER_SERVEUR_DB)) {
173
-			$erreurs['choix_db'] = _T('avis_base_inaccessible', array('base' => $choix_db));
174
-		} else {
175
-			define('_DECLARER_CHOIX_DB', $choix_db);
176
-		}
177
-	}
178
-
179
-	return $erreurs;
163
+    $erreurs = array();
164
+    $choix_db = _request('choix_db');
165
+    if ($choix_db == '-1') {
166
+        $choix_db = _request('table_new');
167
+    }
168
+    if (!$choix_db) {
169
+        $erreurs['choix_db'] = _T('info_obligatoire');
170
+    } else {
171
+        define('_ECRIRE_INSTALL', 1); // hackons sqlite
172
+        if (!sql_selectdb($choix_db, _DECLARER_SERVEUR_DB)) {
173
+            $erreurs['choix_db'] = _T('avis_base_inaccessible', array('base' => $choix_db));
174
+        } else {
175
+            define('_DECLARER_CHOIX_DB', $choix_db);
176
+        }
177
+    }
178
+
179
+    return $erreurs;
180 180
 }
181 181
 
182 182
 function formulaires_declarer_bases_verifier_3_dist() {
183
-	$erreurs = array();
184
-	$nom_connect = _request('nom_connect');
185
-	if (!$nom_connect) {
186
-		$erreurs['nom_connect'] = _T('info_obligatoire');
187
-	} else {
188
-		// securite : le nom doit etre un mot sans caracteres speciaux
189
-		$f = preg_replace(',[^\w],', '', $nom_connect);
190
-		if ($f !== $nom_connect) {
191
-			$erreurs['nom_connect'] = _T('erreur_nom_connect_incorrect');
192
-		} elseif (file_exists(_DIR_CONNECT . $nom_connect . '.php')) {
193
-			$erreurs['nom_connect'] = _T('erreur_connect_deja_existant');
194
-		} else {
195
-			define('_DECLARER_NOM_CONNECT', $nom_connect);
196
-		}
197
-	}
198
-
199
-	return $erreurs;
183
+    $erreurs = array();
184
+    $nom_connect = _request('nom_connect');
185
+    if (!$nom_connect) {
186
+        $erreurs['nom_connect'] = _T('info_obligatoire');
187
+    } else {
188
+        // securite : le nom doit etre un mot sans caracteres speciaux
189
+        $f = preg_replace(',[^\w],', '', $nom_connect);
190
+        if ($f !== $nom_connect) {
191
+            $erreurs['nom_connect'] = _T('erreur_nom_connect_incorrect');
192
+        } elseif (file_exists(_DIR_CONNECT . $nom_connect . '.php')) {
193
+            $erreurs['nom_connect'] = _T('erreur_connect_deja_existant');
194
+        } else {
195
+            define('_DECLARER_NOM_CONNECT', $nom_connect);
196
+        }
197
+    }
198
+
199
+    return $erreurs;
200 200
 }
201 201
 
202 202
 function formulaires_declarer_bases_traiter_dist() {
203 203
 
204
-	$adresse_db = _DECLARER_ADRESSE_DB;
205
-	if (preg_match(',(.*):(.*),', $adresse_db, $r)) {
206
-		list(, $adresse_db, $port) = $r;
207
-	} else {
208
-		$port = '';
209
-	}
210
-
211
-	$server_db = addcslashes(_DECLARER_SERVEUR_DB, "'\\");
212
-
213
-	$conn = install_mode_appel($server_db)
214
-		. install_connexion(
215
-			$adresse_db,
216
-			$port,
217
-			_DECLARER_LOGIN_DB,
218
-			_DECLARER_PASS_DB,
219
-			_DECLARER_CHOIX_DB,
220
-			_DECLARER_SERVEUR_DB,
221
-			'',
222
-			'',
223
-			''
224
-		);
225
-
226
-	install_fichier_connexion(_DIR_CONNECT . _DECLARER_NOM_CONNECT . '.php', $conn);
227
-
228
-	return array(
229
-		'message_ok' => _T('install_connect_ok', array('connect' => '<strong>' . _DECLARER_NOM_CONNECT . '</strong>'))
230
-	);
204
+    $adresse_db = _DECLARER_ADRESSE_DB;
205
+    if (preg_match(',(.*):(.*),', $adresse_db, $r)) {
206
+        list(, $adresse_db, $port) = $r;
207
+    } else {
208
+        $port = '';
209
+    }
210
+
211
+    $server_db = addcslashes(_DECLARER_SERVEUR_DB, "'\\");
212
+
213
+    $conn = install_mode_appel($server_db)
214
+        . install_connexion(
215
+            $adresse_db,
216
+            $port,
217
+            _DECLARER_LOGIN_DB,
218
+            _DECLARER_PASS_DB,
219
+            _DECLARER_CHOIX_DB,
220
+            _DECLARER_SERVEUR_DB,
221
+            '',
222
+            '',
223
+            ''
224
+        );
225
+
226
+    install_fichier_connexion(_DIR_CONNECT . _DECLARER_NOM_CONNECT . '.php', $conn);
227
+
228
+    return array(
229
+        'message_ok' => _T('install_connect_ok', array('connect' => '<strong>' . _DECLARER_NOM_CONNECT . '</strong>'))
230
+    );
231 231
 }
Please login to merge, or discard this patch.
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -25,10 +25,10 @@  discard block
 block discarded – undo
25 25
 	if (defined('_DECLARER_CHOIX_DB')) {
26 26
 		$nom_connect = _DECLARER_CHOIX_DB;
27 27
 		$n = '';
28
-		while (in_array($nom_connect . $n, $deja)) {
28
+		while (in_array($nom_connect.$n, $deja)) {
29 29
 			$n = ($n ? $n + 1 : 1);
30 30
 		}
31
-		$nom_connect = $nom_connect . $n;
31
+		$nom_connect = $nom_connect.$n;
32 32
 	}
33 33
 
34 34
 	$valeurs = array(
@@ -55,18 +55,18 @@  discard block
 block discarded – undo
55 55
 
56 56
 function liste_serveurs() {
57 57
 	$options = array();
58
-	$dir = _DIR_RESTREINT . 'req/';
58
+	$dir = _DIR_RESTREINT.'req/';
59 59
 	$d = opendir($dir);
60 60
 	if (!$d) {
61 61
 		return array();
62 62
 	}
63 63
 	while ($f = readdir($d)) {
64 64
 		if ((preg_match('/^(.*)[.]php$/', $f, $s))
65
-			and is_readable($f = $dir . $f)
65
+			and is_readable($f = $dir.$f)
66 66
 		) {
67 67
 			require_once($f);
68 68
 			$s = $s[1];
69
-			$v = 'spip_versions_' . $s;
69
+			$v = 'spip_versions_'.$s;
70 70
 			if (function_exists($v) and $v()) {
71 71
 				$options[$s] = "install_select_type_$s";
72 72
 			} else {
@@ -139,7 +139,7 @@  discard block
 block discarded – undo
139 139
 
140 140
 	$link = spip_connect_db($adresse_db, '', $login_db, $pass_db, '@test@', $serveur_db);
141 141
 	if ($link) {
142
-		$GLOBALS['connexions'][$serveur_db][$GLOBALS['spip_sql_version']] = $GLOBALS['spip_' . $serveur_db . '_functions_' . $GLOBALS['spip_sql_version']];
142
+		$GLOBALS['connexions'][$serveur_db][$GLOBALS['spip_sql_version']] = $GLOBALS['spip_'.$serveur_db.'_functions_'.$GLOBALS['spip_sql_version']];
143 143
 		$GLOBALS['connexions'][$serveur_db] = $link;
144 144
 		define('_DECLARER_SERVEUR_DB', $serveur_db);
145 145
 		define('_DECLARER_ADRESSE_DB', $adresse_db);
@@ -189,7 +189,7 @@  discard block
 block discarded – undo
189 189
 		$f = preg_replace(',[^\w],', '', $nom_connect);
190 190
 		if ($f !== $nom_connect) {
191 191
 			$erreurs['nom_connect'] = _T('erreur_nom_connect_incorrect');
192
-		} elseif (file_exists(_DIR_CONNECT . $nom_connect . '.php')) {
192
+		} elseif (file_exists(_DIR_CONNECT.$nom_connect.'.php')) {
193 193
 			$erreurs['nom_connect'] = _T('erreur_connect_deja_existant');
194 194
 		} else {
195 195
 			define('_DECLARER_NOM_CONNECT', $nom_connect);
@@ -223,9 +223,9 @@  discard block
 block discarded – undo
223 223
 			''
224 224
 		);
225 225
 
226
-	install_fichier_connexion(_DIR_CONNECT . _DECLARER_NOM_CONNECT . '.php', $conn);
226
+	install_fichier_connexion(_DIR_CONNECT._DECLARER_NOM_CONNECT.'.php', $conn);
227 227
 
228 228
 	return array(
229
-		'message_ok' => _T('install_connect_ok', array('connect' => '<strong>' . _DECLARER_NOM_CONNECT . '</strong>'))
229
+		'message_ok' => _T('install_connect_ok', array('connect' => '<strong>'._DECLARER_NOM_CONNECT.'</strong>'))
230 230
 	);
231 231
 }
Please login to merge, or discard this patch.
prive/formulaires/configurer_redacteurs.php 1 patch
Indentation   +30 added lines, -30 removed lines patch added patch discarded remove patch
@@ -11,41 +11,41 @@
 block discarded – undo
11 11
 \***************************************************************************/
12 12
 
13 13
 if (!defined('_ECRIRE_INC_VERSION')) {
14
-	return;
14
+    return;
15 15
 }
16 16
 
17 17
 function formulaires_configurer_redacteurs_charger_dist() {
18
-	$valeurs = array();
19
-	foreach (array(
20
-		'accepter_inscriptions',
21
-	) as $m) {
22
-		$valeurs[$m] = $GLOBALS['meta'][$m];
23
-	}
24
-
25
-	return $valeurs;
18
+    $valeurs = array();
19
+    foreach (array(
20
+        'accepter_inscriptions',
21
+    ) as $m) {
22
+        $valeurs[$m] = $GLOBALS['meta'][$m];
23
+    }
24
+
25
+    return $valeurs;
26 26
 }
27 27
 
28 28
 
29 29
 function formulaires_configurer_redacteurs_traiter_dist() {
30
-	$res = array('editable' => true);
31
-	// Modification du reglage accepter_inscriptions => vider le cache
32
-	// (pour repercuter la modif sur le panneau de login)
33
-	if (($i = _request('accepter_inscriptions')
34
-		and $i != $GLOBALS['meta']['accepter_inscriptions'])
35
-	) {
36
-		include_spip('inc/invalideur');
37
-		suivre_invalideur('1'); # tout effacer
38
-	}
39
-
40
-	foreach (array(
41
-		'accepter_inscriptions',
42
-	) as $m) {
43
-		if (!is_null($v = _request($m))) {
44
-			ecrire_meta($m, $v == 'oui' ? 'oui' : 'non');
45
-		}
46
-	}
47
-
48
-	$res['message_ok'] = _T('config_info_enregistree');
49
-
50
-	return $res;
30
+    $res = array('editable' => true);
31
+    // Modification du reglage accepter_inscriptions => vider le cache
32
+    // (pour repercuter la modif sur le panneau de login)
33
+    if (($i = _request('accepter_inscriptions')
34
+        and $i != $GLOBALS['meta']['accepter_inscriptions'])
35
+    ) {
36
+        include_spip('inc/invalideur');
37
+        suivre_invalideur('1'); # tout effacer
38
+    }
39
+
40
+    foreach (array(
41
+        'accepter_inscriptions',
42
+    ) as $m) {
43
+        if (!is_null($v = _request($m))) {
44
+            ecrire_meta($m, $v == 'oui' ? 'oui' : 'non');
45
+        }
46
+    }
47
+
48
+    $res['message_ok'] = _T('config_info_enregistree');
49
+
50
+    return $res;
51 51
 }
Please login to merge, or discard this patch.
prive/formulaires/configurer_langage.php 2 patches
Indentation   +29 added lines, -29 removed lines patch added patch discarded remove patch
@@ -11,49 +11,49 @@
 block discarded – undo
11 11
 \***************************************************************************/
12 12
 
13 13
 if (!defined('_ECRIRE_INC_VERSION')) {
14
-	return;
14
+    return;
15 15
 }
16 16
 
17 17
 function formulaires_configurer_langage_charger_dist() {
18 18
 
19
-	include_spip('inc/lang');
20
-	$GLOBALS['meta']['langues_proposees'] = '';
21
-	init_langues();
22
-	$langues = explode(',', $GLOBALS['meta']['langues_proposees']);
19
+    include_spip('inc/lang');
20
+    $GLOBALS['meta']['langues_proposees'] = '';
21
+    init_langues();
22
+    $langues = explode(',', $GLOBALS['meta']['langues_proposees']);
23 23
 
24 24
 
25
-	$valeurs = array(
26
-		'var_lang_ecrire' => $GLOBALS['spip_lang'],
27
-		'_langues' => $langues
28
-	);
25
+    $valeurs = array(
26
+        'var_lang_ecrire' => $GLOBALS['spip_lang'],
27
+        '_langues' => $langues
28
+    );
29 29
 
30
-	return $valeurs;
30
+    return $valeurs;
31 31
 }
32 32
 
33 33
 
34 34
 function formulaires_configurer_langage_traiter_dist() {
35
-	include_spip('action/converser');
36
-	action_converser_changer_langue(true);
35
+    include_spip('action/converser');
36
+    action_converser_changer_langue(true);
37 37
 
38
-	refuser_traiter_formulaire_ajax();
38
+    refuser_traiter_formulaire_ajax();
39 39
 
40
-	// on ne peut pas changer la langue pour tout le hit ici,
41
-	// car CVT repasse derriere et retablit la langue avant l'appel a traiter()
42
-	// il faut rediriger !
43
-	return array('message_ok' => _T('config_info_enregistree'), 'editable' => true, 'redirect' => self());
40
+    // on ne peut pas changer la langue pour tout le hit ici,
41
+    // car CVT repasse derriere et retablit la langue avant l'appel a traiter()
42
+    // il faut rediriger !
43
+    return array('message_ok' => _T('config_info_enregistree'), 'editable' => true, 'redirect' => self());
44 44
 }
45 45
 
46 46
 function afficher_langues_choix($langues, $name, $id, $selected) {
47
-	include_spip('inc/lang');
48
-	$ret = '';
49
-	sort($langues);
50
-	foreach ($langues as $l) {
51
-		$checked = ($l == $selected) ? ' checked=\'checked\'' : '';
52
-		$ret .= "<div class='choix'>"
53
-			. "<input type='radio' name='$name' id='{$id}_$l' value='$l'$checked />"
54
-			. "<label for='{$id}_$l'>" . traduire_nom_langue($l) . '</label>'
55
-			. '</div>';
56
-	}
57
-
58
-	return $ret;
47
+    include_spip('inc/lang');
48
+    $ret = '';
49
+    sort($langues);
50
+    foreach ($langues as $l) {
51
+        $checked = ($l == $selected) ? ' checked=\'checked\'' : '';
52
+        $ret .= "<div class='choix'>"
53
+            . "<input type='radio' name='$name' id='{$id}_$l' value='$l'$checked />"
54
+            . "<label for='{$id}_$l'>" . traduire_nom_langue($l) . '</label>'
55
+            . '</div>';
56
+    }
57
+
58
+    return $ret;
59 59
 }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -51,7 +51,7 @@
 block discarded – undo
51 51
 		$checked = ($l == $selected) ? ' checked=\'checked\'' : '';
52 52
 		$ret .= "<div class='choix'>"
53 53
 			. "<input type='radio' name='$name' id='{$id}_$l' value='$l'$checked />"
54
-			. "<label for='{$id}_$l'>" . traduire_nom_langue($l) . '</label>'
54
+			. "<label for='{$id}_$l'>".traduire_nom_langue($l).'</label>'
55 55
 			. '</div>';
56 56
 	}
57 57
 
Please login to merge, or discard this patch.
prive/formulaires/configurer_previsualiseur.php 2 patches
Indentation   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -11,28 +11,28 @@
 block discarded – undo
11 11
 \***************************************************************************/
12 12
 
13 13
 if (!defined('_ECRIRE_INC_VERSION')) {
14
-	return;
14
+    return;
15 15
 }
16 16
 include_spip('inc/presentation');
17 17
 
18 18
 function formulaires_configurer_previsualiseur_charger_dist() {
19
-	$valeurs = array();
20
-	$valeurs['preview'] = explode(',', $GLOBALS['meta']['preview']);
19
+    $valeurs = array();
20
+    $valeurs['preview'] = explode(',', $GLOBALS['meta']['preview']);
21 21
 
22
-	return $valeurs;
22
+    return $valeurs;
23 23
 }
24 24
 
25 25
 
26 26
 function formulaires_configurer_previsualiseur_traiter_dist() {
27
-	$res = array('editable' => true);
27
+    $res = array('editable' => true);
28 28
 
29
-	if ($i = _request('preview') and is_array($i)) {
30
-		$i = ',' . implode(',', $i) . ',';
31
-	}
29
+    if ($i = _request('preview') and is_array($i)) {
30
+        $i = ',' . implode(',', $i) . ',';
31
+    }
32 32
 
33
-	ecrire_meta('preview', $i);
33
+    ecrire_meta('preview', $i);
34 34
 
35
-	$res['message_ok'] = _T('config_info_enregistree');
35
+    $res['message_ok'] = _T('config_info_enregistree');
36 36
 
37
-	return $res;
37
+    return $res;
38 38
 }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@
 block discarded – undo
27 27
 	$res = array('editable' => true);
28 28
 
29 29
 	if ($i = _request('preview') and is_array($i)) {
30
-		$i = ',' . implode(',', $i) . ',';
30
+		$i = ','.implode(',', $i).',';
31 31
 	}
32 32
 
33 33
 	ecrire_meta('preview', $i);
Please login to merge, or discard this patch.
prive/formulaires/configurer_langue.php 2 patches
Indentation   +41 added lines, -41 removed lines patch added patch discarded remove patch
@@ -11,59 +11,59 @@
 block discarded – undo
11 11
 \***************************************************************************/
12 12
 
13 13
 if (!defined('_ECRIRE_INC_VERSION')) {
14
-	return;
14
+    return;
15 15
 }
16 16
 
17 17
 function formulaires_configurer_langue_charger_dist() {
18
-	$valeurs = array();
18
+    $valeurs = array();
19 19
 
20
-	include_spip('inc/lang');
21
-	$l_site = $GLOBALS['meta']['langue_site'];
22
-	$langue_site = traduire_nom_langue($l_site);
20
+    include_spip('inc/lang');
21
+    $l_site = $GLOBALS['meta']['langue_site'];
22
+    $langue_site = traduire_nom_langue($l_site);
23 23
 
24
-	$langues = explode(',', $GLOBALS['meta']['langues_proposees']);
25
-	if (!in_array($l_site, $langues)) {
26
-		$langues[] = $l_site;
27
-	}
28
-	sort($langues);
24
+    $langues = explode(',', $GLOBALS['meta']['langues_proposees']);
25
+    if (!in_array($l_site, $langues)) {
26
+        $langues[] = $l_site;
27
+    }
28
+    sort($langues);
29 29
 
30
-	$res = '';
31
-	foreach ($langues as $l) {
32
-		$res .= "<option value='$l'"
33
-			. ($l == $l_site ? " selected='selected'" : '')
34
-			. '>' . traduire_nom_langue($l) . "</option>\n";
35
-	}
30
+    $res = '';
31
+    foreach ($langues as $l) {
32
+        $res .= "<option value='$l'"
33
+            . ($l == $l_site ? " selected='selected'" : '')
34
+            . '>' . traduire_nom_langue($l) . "</option>\n";
35
+    }
36 36
 
37
-	$valeurs = array(
38
-		'_langues' => $res,
39
-		'_langue_site' => $langue_site,
40
-		'changer_langue_site' => '',
41
-	);
37
+    $valeurs = array(
38
+        '_langues' => $res,
39
+        '_langue_site' => $langue_site,
40
+        'changer_langue_site' => '',
41
+    );
42 42
 
43
-	return $valeurs;
43
+    return $valeurs;
44 44
 }
45 45
 
46 46
 
47 47
 function formulaires_configurer_langue_traiter_dist() {
48
-	$res = array('editable' => true);
48
+    $res = array('editable' => true);
49 49
 
50
-	if ($lang = _request('changer_langue_site')) {
51
-		include_spip('inc/lang');
52
-		// verif que la langue demandee est licite
53
-		if (changer_langue($lang)) {
54
-			ecrire_meta('langue_site', $lang);
55
-			// le test a defait ca:
56
-			utiliser_langue_visiteur();
57
-			$res['message_ok'] = _T('config_info_enregistree');
58
-			include_spip('inc/rubriques');
59
-			calculer_langues_rubriques();
60
-		}
61
-		// le test a defait ca:
62
-		utiliser_langue_visiteur();
63
-	}
64
-	if (!$res['message_ok']) {
65
-		$res['message_erreur'] = _L('erreur');
66
-	}
50
+    if ($lang = _request('changer_langue_site')) {
51
+        include_spip('inc/lang');
52
+        // verif que la langue demandee est licite
53
+        if (changer_langue($lang)) {
54
+            ecrire_meta('langue_site', $lang);
55
+            // le test a defait ca:
56
+            utiliser_langue_visiteur();
57
+            $res['message_ok'] = _T('config_info_enregistree');
58
+            include_spip('inc/rubriques');
59
+            calculer_langues_rubriques();
60
+        }
61
+        // le test a defait ca:
62
+        utiliser_langue_visiteur();
63
+    }
64
+    if (!$res['message_ok']) {
65
+        $res['message_erreur'] = _L('erreur');
66
+    }
67 67
 
68
-	return $res;
68
+    return $res;
69 69
 }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@
 block discarded – undo
31 31
 	foreach ($langues as $l) {
32 32
 		$res .= "<option value='$l'"
33 33
 			. ($l == $l_site ? " selected='selected'" : '')
34
-			. '>' . traduire_nom_langue($l) . "</option>\n";
34
+			. '>'.traduire_nom_langue($l)."</option>\n";
35 35
 	}
36 36
 
37 37
 	$valeurs = array(
Please login to merge, or discard this patch.
prive/informer_auteur_fonctions.php 1 patch
Indentation   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
11 11
 \***************************************************************************/
12 12
 
13 13
 if (!defined('_ECRIRE_INC_VERSION')) {
14
-	return;
14
+    return;
15 15
 }
16 16
 
17 17
 
@@ -34,14 +34,14 @@  discard block
 block discarded – undo
34 34
  *     JSON des différentes informations
35 35
  */
36 36
 function informer_auteur($bof) {
37
-	include_spip('inc/json');
38
-	include_spip('formulaires/login');
39
-	include_spip('inc/auth');
40
-	$login = strval(_request('var_login'));
41
-	$row = auth_informer_login($login);
42
-	if ($row and is_array($row) and isset($row['id_auteur'])) {
43
-		unset($row['id_auteur']);
44
-	}
37
+    include_spip('inc/json');
38
+    include_spip('formulaires/login');
39
+    include_spip('inc/auth');
40
+    $login = strval(_request('var_login'));
41
+    $row = auth_informer_login($login);
42
+    if ($row and is_array($row) and isset($row['id_auteur'])) {
43
+        unset($row['id_auteur']);
44
+    }
45 45
 	
46
-	return json_export($row);
46
+    return json_export($row);
47 47
 }
Please login to merge, or discard this patch.
prive/echafaudage/hierarchie/objet_fonctions.php 1 patch
Indentation   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
11 11
 \***************************************************************************/
12 12
 
13 13
 if (!defined('_ECRIRE_INC_VERSION')) {
14
-	return;
14
+    return;
15 15
 }
16 16
 
17 17
 /**
@@ -24,20 +24,20 @@  discard block
 block discarded – undo
24 24
  */
25 25
 function deplacement_restreint($objet, $statut) {
26 26
 
27
-	switch ($objet) {
28
-		case 'rubrique':
29
-			return (!$GLOBALS['connect_toutes_rubriques']);
30
-			break;
31
-		case 'article':
32
-		case 'site':
33
-		case 'syndic':
34
-		case 'breve':
35
-			return ($statut == 'publie');
36
-			break;
37
-		default:
38
-			return ($statut ? $statut == 'publie' : false);
39
-			break;
40
-	}
27
+    switch ($objet) {
28
+        case 'rubrique':
29
+            return (!$GLOBALS['connect_toutes_rubriques']);
30
+            break;
31
+        case 'article':
32
+        case 'site':
33
+        case 'syndic':
34
+        case 'breve':
35
+            return ($statut == 'publie');
36
+            break;
37
+        default:
38
+            return ($statut ? $statut == 'publie' : false);
39
+            break;
40
+    }
41 41
 
42
-	return false;
42
+    return false;
43 43
 }
Please login to merge, or discard this patch.
prive/images/index.php 1 patch
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -9,13 +9,13 @@
 block discarded – undo
9 9
 	<h1>Index des icones de <a href='http://www.spip.net'>Spip</a></h1>
10 10
 	<table>
11 11
 		<?php
12
-		$myDir = opendir('.');
13
-		while ($file = readdir($myDir)) {
14
-			if (preg_match(',\.(png|gif)$,i', $file)) {
15
-				echo "		<tr><td>$file</td><td><img src='$file' alt='$file' /></td></tr>\n";
16
-			}
17
-		}
18
-		?>
12
+        $myDir = opendir('.');
13
+        while ($file = readdir($myDir)) {
14
+            if (preg_match(',\.(png|gif)$,i', $file)) {
15
+                echo "		<tr><td>$file</td><td><img src='$file' alt='$file' /></td></tr>\n";
16
+            }
17
+        }
18
+        ?>
19 19
 	</table>
20 20
 </center>
21 21
 </body>
Please login to merge, or discard this patch.