Completed
Push — master ( c2b92a...d64163 )
by cam
04:27
created
ecrire/action/annuler_job.php 1 patch
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@  discard block
 block discarded – undo
17 17
  **/
18 18
 
19 19
 if (!defined('_ECRIRE_INC_VERSION')) {
20
-	return;
20
+    return;
21 21
 }
22 22
 
23 23
 /**
@@ -26,12 +26,12 @@  discard block
 block discarded – undo
26 26
  * @return void
27 27
  */
28 28
 function action_annuler_job_dist() {
29
-	$securiser_action = charger_fonction('securiser_action', 'inc');
30
-	$id_job = $securiser_action();
29
+    $securiser_action = charger_fonction('securiser_action', 'inc');
30
+    $id_job = $securiser_action();
31 31
 
32
-	if ($id_job = intval($id_job)
33
-		and autoriser('annuler', 'job', $id_job)
34
-	) {
35
-		job_queue_remove($id_job);
36
-	}
32
+    if ($id_job = intval($id_job)
33
+        and autoriser('annuler', 'job', $id_job)
34
+    ) {
35
+        job_queue_remove($id_job);
36
+    }
37 37
 }
Please login to merge, or discard this patch.
ecrire/action/activer_plugins.php 1 patch
Indentation   +44 added lines, -44 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@  discard block
 block discarded – undo
17 17
  **/
18 18
 
19 19
 if (!defined('_ECRIRE_INC_VERSION')) {
20
-	return;
20
+    return;
21 21
 }
22 22
 
23 23
 /**
@@ -28,47 +28,47 @@  discard block
 block discarded – undo
28 28
  * @return void
29 29
  */
30 30
 function enregistre_modif_plugin() {
31
-	include_spip('inc/plugin');
32
-	// recuperer les plugins dans l'ordre des $_POST
33
-	$test = array();
34
-	foreach (liste_plugin_files() as $file) {
35
-		$test['s' . substr(md5(_DIR_PLUGINS . $file), 0, 16)] = $file;
36
-	}
37
-	if (defined('_DIR_PLUGINS_SUPPL')) {
38
-		foreach (liste_plugin_files(_DIR_PLUGINS_SUPPL) as $file) {
39
-			$test['s' . substr(md5(_DIR_PLUGINS_SUPPL . $file), 0, 16)] = $file;
40
-		}
41
-	}
31
+    include_spip('inc/plugin');
32
+    // recuperer les plugins dans l'ordre des $_POST
33
+    $test = array();
34
+    foreach (liste_plugin_files() as $file) {
35
+        $test['s' . substr(md5(_DIR_PLUGINS . $file), 0, 16)] = $file;
36
+    }
37
+    if (defined('_DIR_PLUGINS_SUPPL')) {
38
+        foreach (liste_plugin_files(_DIR_PLUGINS_SUPPL) as $file) {
39
+            $test['s' . substr(md5(_DIR_PLUGINS_SUPPL . $file), 0, 16)] = $file;
40
+        }
41
+    }
42 42
 
43
-	$plugin = array();
43
+    $plugin = array();
44 44
 
45
-	foreach ($_POST as $choix => $val) {
46
-		if (isset($test[$choix]) && $val == 'O') {
47
-			$plugin[] = $test[$choix];
48
-		}
49
-	}
45
+    foreach ($_POST as $choix => $val) {
46
+        if (isset($test[$choix]) && $val == 'O') {
47
+            $plugin[] = $test[$choix];
48
+        }
49
+    }
50 50
 
51
-	spip_log("Changement des plugins actifs par l'auteur " . $GLOBALS['visiteur_session']['id_auteur'] . ": " . join(',',
52
-			$plugin));
53
-	ecrire_plugin_actifs($plugin);
51
+    spip_log("Changement des plugins actifs par l'auteur " . $GLOBALS['visiteur_session']['id_auteur'] . ": " . join(',',
52
+            $plugin));
53
+    ecrire_plugin_actifs($plugin);
54 54
 
55
-	// Chaque fois que l'on valide des plugins, on memorise la liste de ces plugins comme etant "interessants", avec un score initial, qui sera decremente a chaque tour : ainsi un plugin active pourra reter visible a l'ecran, jusqu'a ce qu'il tombe dans l'oubli.
56
-	$plugins_interessants = @unserialize($GLOBALS['meta']['plugins_interessants']);
57
-	if (!is_array($plugins_interessants)) {
58
-		$plugins_interessants = array();
59
-	}
55
+    // Chaque fois que l'on valide des plugins, on memorise la liste de ces plugins comme etant "interessants", avec un score initial, qui sera decremente a chaque tour : ainsi un plugin active pourra reter visible a l'ecran, jusqu'a ce qu'il tombe dans l'oubli.
56
+    $plugins_interessants = @unserialize($GLOBALS['meta']['plugins_interessants']);
57
+    if (!is_array($plugins_interessants)) {
58
+        $plugins_interessants = array();
59
+    }
60 60
 
61
-	$plugins_interessants2 = array();
61
+    $plugins_interessants2 = array();
62 62
 
63
-	foreach ($plugins_interessants as $plug => $score) {
64
-		if ($score > 1) {
65
-			$plugins_interessants2[$plug] = $score - 1;
66
-		}
67
-	}
68
-	foreach ($plugin as $plug) {
69
-		$plugins_interessants2[$plug] = 10;
70
-	} // score initial
71
-	ecrire_meta('plugins_interessants', serialize($plugins_interessants2));
63
+    foreach ($plugins_interessants as $plug => $score) {
64
+        if ($score > 1) {
65
+            $plugins_interessants2[$plug] = $score - 1;
66
+        }
67
+    }
68
+    foreach ($plugin as $plug) {
69
+        $plugins_interessants2[$plug] = 10;
70
+    } // score initial
71
+    ecrire_meta('plugins_interessants', serialize($plugins_interessants2));
72 72
 }
73 73
 
74 74
 /**
@@ -80,13 +80,13 @@  discard block
 block discarded – undo
80 80
  */
81 81
 function action_activer_plugins_dist() {
82 82
 
83
-	$securiser_action = charger_fonction('securiser_action', 'inc');
84
-	$securiser_action();
83
+    $securiser_action = charger_fonction('securiser_action', 'inc');
84
+    $securiser_action();
85 85
 
86
-	if (!autoriser('configurer', '_plugins')) {
87
-		die('erreur');
88
-	}
89
-	// forcer la maj des meta pour les cas de modif de numero de version base via phpmyadmin
90
-	lire_metas();
91
-	enregistre_modif_plugin();
86
+    if (!autoriser('configurer', '_plugins')) {
87
+        die('erreur');
88
+    }
89
+    // forcer la maj des meta pour les cas de modif de numero de version base via phpmyadmin
90
+    lire_metas();
91
+    enregistre_modif_plugin();
92 92
 }
Please login to merge, or discard this patch.
ecrire/action/ajouter_lien.php 1 patch
Indentation   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@  discard block
 block discarded – undo
17 17
  **/
18 18
 
19 19
 if (!defined('_ECRIRE_INC_VERSION')) {
20
-	return;
20
+    return;
21 21
 }
22 22
 
23 23
 /**
@@ -34,14 +34,14 @@  discard block
 block discarded – undo
34 34
  * @return void
35 35
  */
36 36
 function action_ajouter_lien_dist($arg = null) {
37
-	if (is_null($arg)) {
38
-		$securiser_action = charger_fonction('securiser_action', 'inc');
39
-		$arg = $securiser_action();
40
-	}
37
+    if (is_null($arg)) {
38
+        $securiser_action = charger_fonction('securiser_action', 'inc');
39
+        $arg = $securiser_action();
40
+    }
41 41
 
42
-	$arg = explode("-", $arg);
43
-	list($objet_source, $ids, $objet_lie, $idl) = $arg;
42
+    $arg = explode("-", $arg);
43
+    list($objet_source, $ids, $objet_lie, $idl) = $arg;
44 44
 
45
-	include_spip('action/editer_liens');
46
-	objet_associer(array($objet_source => $ids), array($objet_lie => $idl));
45
+    include_spip('action/editer_liens');
46
+    objet_associer(array($objet_source => $ids), array($objet_lie => $idl));
47 47
 }
Please login to merge, or discard this patch.
ecrire/action/editer_rubrique.php 1 patch
Indentation   +151 added lines, -151 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@  discard block
 block discarded – undo
16 16
  * @package SPIP\Core\Rubriques\Edition
17 17
  */
18 18
 if (!defined('_ECRIRE_INC_VERSION')) {
19
-	return;
19
+    return;
20 20
 }
21 21
 
22 22
 include_spip('inc/rubriques');
@@ -38,31 +38,31 @@  discard block
 block discarded – undo
38 38
  */
39 39
 function action_editer_rubrique_dist($arg = null) {
40 40
 
41
-	if (is_null($arg)) {
42
-		$securiser_action = charger_fonction('securiser_action', 'inc');
43
-		$arg = $securiser_action();
44
-	}
41
+    if (is_null($arg)) {
42
+        $securiser_action = charger_fonction('securiser_action', 'inc');
43
+        $arg = $securiser_action();
44
+    }
45 45
 
46
-	if (!$id_rubrique = intval($arg)) {
47
-		if ($arg != 'oui') {
48
-			include_spip('inc/headers');
49
-			redirige_url_ecrire();
50
-		}
51
-		$id_rubrique = rubrique_inserer(_request('id_parent'));
52
-	}
46
+    if (!$id_rubrique = intval($arg)) {
47
+        if ($arg != 'oui') {
48
+            include_spip('inc/headers');
49
+            redirige_url_ecrire();
50
+        }
51
+        $id_rubrique = rubrique_inserer(_request('id_parent'));
52
+    }
53 53
 
54
-	$err = rubrique_modifier($id_rubrique);
54
+    $err = rubrique_modifier($id_rubrique);
55 55
 
56
-	if (_request('redirect')) {
57
-		$redirect = parametre_url(
58
-			urldecode(_request('redirect')),
59
-			'id_rubrique', $id_rubrique, '&');
56
+    if (_request('redirect')) {
57
+        $redirect = parametre_url(
58
+            urldecode(_request('redirect')),
59
+            'id_rubrique', $id_rubrique, '&');
60 60
 
61
-		include_spip('inc/headers');
62
-		redirige_par_entete($redirect);
63
-	}
61
+        include_spip('inc/headers');
62
+        redirige_par_entete($redirect);
63
+    }
64 64
 
65
-	return array($id_rubrique, $err);
65
+    return array($id_rubrique, $err);
66 66
 }
67 67
 
68 68
 
@@ -77,40 +77,40 @@  discard block
 block discarded – undo
77 77
  *     Identifiant de la rubrique crée
78 78
  */
79 79
 function rubrique_inserer($id_parent, $set = null) {
80
-	$champs = array(
81
-		'titre' => _T('item_nouvelle_rubrique'),
82
-		'id_parent' => intval($id_parent),
83
-		'statut' => 'prepa'
84
-	);
85
-
86
-	if ($set) {
87
-		$champs = array_merge($champs, $set);
88
-	}
89
-
90
-	// Envoyer aux plugins
91
-	$champs = pipeline('pre_insertion',
92
-		array(
93
-			'args' => array(
94
-				'table' => 'spip_rubriques',
95
-			),
96
-			'data' => $champs
97
-		)
98
-	);
99
-
100
-	$id_rubrique = sql_insertq("spip_rubriques", $champs);
101
-	pipeline('post_insertion',
102
-		array(
103
-			'args' => array(
104
-				'table' => 'spip_rubriques',
105
-				'id_objet' => $id_rubrique
106
-			),
107
-			'data' => $champs
108
-		)
109
-	);
110
-	propager_les_secteurs();
111
-	calculer_langues_rubriques();
112
-
113
-	return $id_rubrique;
80
+    $champs = array(
81
+        'titre' => _T('item_nouvelle_rubrique'),
82
+        'id_parent' => intval($id_parent),
83
+        'statut' => 'prepa'
84
+    );
85
+
86
+    if ($set) {
87
+        $champs = array_merge($champs, $set);
88
+    }
89
+
90
+    // Envoyer aux plugins
91
+    $champs = pipeline('pre_insertion',
92
+        array(
93
+            'args' => array(
94
+                'table' => 'spip_rubriques',
95
+            ),
96
+            'data' => $champs
97
+        )
98
+    );
99
+
100
+    $id_rubrique = sql_insertq("spip_rubriques", $champs);
101
+    pipeline('post_insertion',
102
+        array(
103
+            'args' => array(
104
+                'table' => 'spip_rubriques',
105
+                'id_objet' => $id_rubrique
106
+            ),
107
+            'data' => $champs
108
+        )
109
+    );
110
+    propager_les_secteurs();
111
+    calculer_langues_rubriques();
112
+
113
+    return $id_rubrique;
114 114
 }
115 115
 
116 116
 /**
@@ -126,42 +126,42 @@  discard block
 block discarded – undo
126 126
  *     - chaîne : Texte d'un message d'erreur
127 127
  */
128 128
 function rubrique_modifier($id_rubrique, $set = null) {
129
-	include_spip('inc/autoriser');
130
-	include_spip('inc/filtres');
131
-
132
-	include_spip('inc/modifier');
133
-	$c = collecter_requests(
134
-	// white list
135
-		objet_info('rubrique', 'champs_editables'),
136
-		// black list
137
-		array('id_parent', 'confirme_deplace'),
138
-		// donnees eventuellement fournies
139
-		$set
140
-	);
141
-
142
-	if ($err = objet_modifier_champs('rubrique', $id_rubrique,
143
-		array(
144
-			'data' => $set,
145
-			'nonvide' => array('titre' => _T('titre_nouvelle_rubrique') . " " . _T('info_numero_abbreviation') . $id_rubrique)
146
-		),
147
-		$c)
148
-	) {
149
-		return $err;
150
-	}
151
-
152
-	$c = collecter_requests(array('id_parent', 'confirme_deplace'), array(), $set);
153
-	// Deplacer la rubrique
154
-	if (isset($c['id_parent'])) {
155
-		$err = rubrique_instituer($id_rubrique, $c);
156
-	}
157
-
158
-	// invalider les caches marques de cette rubrique
159
-	include_spip('inc/invalideur');
160
-	suivre_invalideur("id='rubrique/$id_rubrique'");
161
-	// et celui de menu_rubriques 
162
-	effacer_meta("date_calcul_rubriques");
163
-
164
-	return $err;
129
+    include_spip('inc/autoriser');
130
+    include_spip('inc/filtres');
131
+
132
+    include_spip('inc/modifier');
133
+    $c = collecter_requests(
134
+    // white list
135
+        objet_info('rubrique', 'champs_editables'),
136
+        // black list
137
+        array('id_parent', 'confirme_deplace'),
138
+        // donnees eventuellement fournies
139
+        $set
140
+    );
141
+
142
+    if ($err = objet_modifier_champs('rubrique', $id_rubrique,
143
+        array(
144
+            'data' => $set,
145
+            'nonvide' => array('titre' => _T('titre_nouvelle_rubrique') . " " . _T('info_numero_abbreviation') . $id_rubrique)
146
+        ),
147
+        $c)
148
+    ) {
149
+        return $err;
150
+    }
151
+
152
+    $c = collecter_requests(array('id_parent', 'confirme_deplace'), array(), $set);
153
+    // Deplacer la rubrique
154
+    if (isset($c['id_parent'])) {
155
+        $err = rubrique_instituer($id_rubrique, $c);
156
+    }
157
+
158
+    // invalider les caches marques de cette rubrique
159
+    include_spip('inc/invalideur');
160
+    suivre_invalideur("id='rubrique/$id_rubrique'");
161
+    // et celui de menu_rubriques 
162
+    effacer_meta("date_calcul_rubriques");
163
+
164
+    return $err;
165 165
 }
166 166
 
167 167
 /**
@@ -184,21 +184,21 @@  discard block
 block discarded – undo
184 184
  *     false si la confirmation du déplacement n'est pas présente
185 185
  */
186 186
 function editer_rubrique_breves($id_rubrique, $id_parent, $c = array()) {
187
-	if (!sql_countsel('spip_breves', "id_rubrique=$id_rubrique")) {
188
-		return true;
189
-	}
187
+    if (!sql_countsel('spip_breves', "id_rubrique=$id_rubrique")) {
188
+        return true;
189
+    }
190 190
 
191
-	if (empty($c['confirme_deplace']) or $c['confirme_deplace'] != 'oui') {
192
-		return false;
193
-	}
191
+    if (empty($c['confirme_deplace']) or $c['confirme_deplace'] != 'oui') {
192
+        return false;
193
+    }
194 194
 
195
-	if ($id_secteur = sql_getfetsel("id_secteur",
196
-		"spip_rubriques", "id_rubrique=$id_parent")
197
-	) {
198
-		sql_updateq("spip_breves", array("id_rubrique" => $id_secteur), "id_rubrique=$id_rubrique");
199
-	}
195
+    if ($id_secteur = sql_getfetsel("id_secteur",
196
+        "spip_rubriques", "id_rubrique=$id_parent")
197
+    ) {
198
+        sql_updateq("spip_breves", array("id_rubrique" => $id_secteur), "id_rubrique=$id_rubrique");
199
+    }
200 200
 
201
-	return true;
201
+    return true;
202 202
 }
203 203
 
204 204
 
@@ -220,51 +220,51 @@  discard block
 block discarded – undo
220 220
  *     Chaîne : Texte du message d'erreur
221 221
  */
222 222
 function rubrique_instituer($id_rubrique, $c) {
223
-	// traitement de la rubrique parente
224
-	// interdiction de deplacer vers ou a partir d'une rubrique
225
-	// qu'on n'administre pas.
226
-
227
-	if (null !== ($id_parent = $c['id_parent'])) {
228
-		$id_parent = intval($id_parent);
229
-		$filles = calcul_branche_in($id_rubrique);
230
-		if (strpos(",$id_parent,", ",$filles,") !== false) {
231
-			spip_log("La rubrique $id_rubrique ne peut etre fille de sa descendante $id_parent");
232
-		} else {
233
-			$s = sql_fetsel("id_parent, statut", "spip_rubriques", "id_rubrique=$id_rubrique");
234
-			$old_parent = $s['id_parent'];
235
-
236
-			if (!($id_parent != $old_parent
237
-				and autoriser('publierdans', 'rubrique', $id_parent)
238
-				and autoriser('creerrubriquedans', 'rubrique', $id_parent)
239
-				and autoriser('publierdans', 'rubrique', $old_parent)
240
-			)
241
-			) {
242
-				if ($s['statut'] != 'new') {
243
-					spip_log("deplacement de $id_rubrique vers $id_parent refuse a " . $GLOBALS['visiteur_session']['id_auteur'] . ' ' . $GLOBALS['visiteur_session']['statut']);
244
-				}
245
-			} elseif (editer_rubrique_breves($id_rubrique, $id_parent, $c)) {
246
-				$statut_ancien = $s['statut'];
247
-				sql_updateq('spip_rubriques', array('id_parent' => $id_parent), "id_rubrique=$id_rubrique");
248
-
249
-
250
-				propager_les_secteurs();
251
-
252
-				// Deplacement d'une rubrique publiee ==> chgt general de leur statut
253
-				if ($statut_ancien == 'publie') {
254
-					calculer_rubriques_if($old_parent, array('id_rubrique' => $id_parent), $statut_ancien);
255
-				}
256
-				// Creation ou deplacement d'une rubrique non publiee
257
-				// invalider le cache de leur menu
258
-				elseif (!$statut_ancien || $old_parent != $id_parent) {
259
-					effacer_meta("date_calcul_rubriques");
260
-				}
261
-
262
-				calculer_langues_rubriques();
263
-			}
264
-		}
265
-	}
266
-
267
-	return ''; // pas d'erreur
223
+    // traitement de la rubrique parente
224
+    // interdiction de deplacer vers ou a partir d'une rubrique
225
+    // qu'on n'administre pas.
226
+
227
+    if (null !== ($id_parent = $c['id_parent'])) {
228
+        $id_parent = intval($id_parent);
229
+        $filles = calcul_branche_in($id_rubrique);
230
+        if (strpos(",$id_parent,", ",$filles,") !== false) {
231
+            spip_log("La rubrique $id_rubrique ne peut etre fille de sa descendante $id_parent");
232
+        } else {
233
+            $s = sql_fetsel("id_parent, statut", "spip_rubriques", "id_rubrique=$id_rubrique");
234
+            $old_parent = $s['id_parent'];
235
+
236
+            if (!($id_parent != $old_parent
237
+                and autoriser('publierdans', 'rubrique', $id_parent)
238
+                and autoriser('creerrubriquedans', 'rubrique', $id_parent)
239
+                and autoriser('publierdans', 'rubrique', $old_parent)
240
+            )
241
+            ) {
242
+                if ($s['statut'] != 'new') {
243
+                    spip_log("deplacement de $id_rubrique vers $id_parent refuse a " . $GLOBALS['visiteur_session']['id_auteur'] . ' ' . $GLOBALS['visiteur_session']['statut']);
244
+                }
245
+            } elseif (editer_rubrique_breves($id_rubrique, $id_parent, $c)) {
246
+                $statut_ancien = $s['statut'];
247
+                sql_updateq('spip_rubriques', array('id_parent' => $id_parent), "id_rubrique=$id_rubrique");
248
+
249
+
250
+                propager_les_secteurs();
251
+
252
+                // Deplacement d'une rubrique publiee ==> chgt general de leur statut
253
+                if ($statut_ancien == 'publie') {
254
+                    calculer_rubriques_if($old_parent, array('id_rubrique' => $id_parent), $statut_ancien);
255
+                }
256
+                // Creation ou deplacement d'une rubrique non publiee
257
+                // invalider le cache de leur menu
258
+                elseif (!$statut_ancien || $old_parent != $id_parent) {
259
+                    effacer_meta("date_calcul_rubriques");
260
+                }
261
+
262
+                calculer_langues_rubriques();
263
+            }
264
+        }
265
+    }
266
+
267
+    return ''; // pas d'erreur
268 268
 }
269 269
 
270 270
 /**
@@ -281,7 +281,7 @@  discard block
 block discarded – undo
281 281
  *     Identifiant de la rubrique crée
282 282
  **/
283 283
 function insert_rubrique($id_parent) {
284
-	return rubrique_inserer($id_parent);
284
+    return rubrique_inserer($id_parent);
285 285
 }
286 286
 
287 287
 
@@ -302,7 +302,7 @@  discard block
 block discarded – undo
302 302
  *     - chaîne : Texte d'un message d'erreur
303 303
  **/
304 304
 function revisions_rubriques($id_rubrique, $set = null) {
305
-	return rubrique_modifier($id_rubrique, $set);
305
+    return rubrique_modifier($id_rubrique, $set);
306 306
 }
307 307
 
308 308
 /**
@@ -321,5 +321,5 @@  discard block
 block discarded – undo
321 321
  *     Chaîne : Texte du message d'erreur
322 322
  **/
323 323
 function instituer_rubrique($id_rubrique, $c) {
324
-	return rubrique_instituer($id_rubrique, $c);
324
+    return rubrique_instituer($id_rubrique, $c);
325 325
 }
Please login to merge, or discard this patch.
ecrire/action/purger_queue.php 1 patch
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@  discard block
 block discarded – undo
16 16
  * @package SPIP\Core\Queue
17 17
  **/
18 18
 if (!defined('_ECRIRE_INC_VERSION')) {
19
-	return;
19
+    return;
20 20
 }
21 21
 
22 22
 /**
@@ -25,12 +25,12 @@  discard block
 block discarded – undo
25 25
  * @return void
26 26
  */
27 27
 function action_purger_queue_dist() {
28
-	$securiser_action = charger_fonction('securiser_action', 'inc');
29
-	$securiser_action();
28
+    $securiser_action = charger_fonction('securiser_action', 'inc');
29
+    $securiser_action();
30 30
 
31
-	if (autoriser('purger', 'queue')) {
32
-		include_spip('inc/queue');
33
-		queue_purger();
34
-	}
31
+    if (autoriser('purger', 'queue')) {
32
+        include_spip('inc/queue');
33
+        queue_purger();
34
+    }
35 35
 
36 36
 }
Please login to merge, or discard this patch.
ecrire/action/auth.php 1 patch
Indentation   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@  discard block
 block discarded – undo
17 17
  **/
18 18
 
19 19
 if (!defined('_ECRIRE_INC_VERSION')) {
20
-	return;
20
+    return;
21 21
 }
22 22
 
23 23
 /**
@@ -25,25 +25,25 @@  discard block
 block discarded – undo
25 25
  */
26 26
 function action_auth_dist() {
27 27
 
28
-	$securiser_action = charger_fonction('securiser_action', 'inc');
29
-	$arg = $securiser_action();
30
-
31
-	if (!preg_match(",^(\w+)[/](.+)$,", $arg, $r)) {
32
-		spip_log("action_auth_dist $arg pas compris");
33
-	} else {
34
-		$auth_methode = $r[1];
35
-		$login = $r[2];
36
-		include_spip('inc/auth');
37
-		$res = auth_terminer_identifier_login($auth_methode, $login);
38
-
39
-		if (is_string($res)) { // Erreur
40
-			$redirect = _request('redirect');
41
-			$redirect = parametre_url($redirect, 'var_erreur', $res, '&');
42
-			include_spip('inc/headers');
43
-			redirige_par_entete($redirect);
44
-		}
45
-
46
-		// sinon on loge l'auteur identifie, et on finit (redirection automatique)
47
-		auth_loger($res);
48
-	}
28
+    $securiser_action = charger_fonction('securiser_action', 'inc');
29
+    $arg = $securiser_action();
30
+
31
+    if (!preg_match(",^(\w+)[/](.+)$,", $arg, $r)) {
32
+        spip_log("action_auth_dist $arg pas compris");
33
+    } else {
34
+        $auth_methode = $r[1];
35
+        $login = $r[2];
36
+        include_spip('inc/auth');
37
+        $res = auth_terminer_identifier_login($auth_methode, $login);
38
+
39
+        if (is_string($res)) { // Erreur
40
+            $redirect = _request('redirect');
41
+            $redirect = parametre_url($redirect, 'var_erreur', $res, '&');
42
+            include_spip('inc/headers');
43
+            redirige_par_entete($redirect);
44
+        }
45
+
46
+        // sinon on loge l'auteur identifie, et on finit (redirection automatique)
47
+        auth_loger($res);
48
+    }
49 49
 }
Please login to merge, or discard this patch.
ecrire/action/desinstaller_plugin.php 1 patch
Indentation   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@  discard block
 block discarded – undo
17 17
  */
18 18
 
19 19
 if (!defined('_ECRIRE_INC_VERSION')) {
20
-	return;
20
+    return;
21 21
 }
22 22
 
23 23
 /**
@@ -32,28 +32,28 @@  discard block
 block discarded – undo
32 32
  */
33 33
 function action_desinstaller_plugin_dist() {
34 34
 
35
-	$securiser_action = charger_fonction('securiser_action', 'inc');
36
-	$arg = $securiser_action();
37
-	list($dir_plugins, $plugin) = explode("::", $arg);
38
-	$dir_type = "_DIR_PLUGINS";
39
-	if (defined('_DIR_PLUGINS_SUPPL') and $dir_plugins == _DIR_PLUGINS_SUPPL) {
40
-		$dir_type = "_DIR_PLUGINS_SUPPL";
41
-	}
42
-	$installer_plugins = charger_fonction('installer', 'plugins');
43
-	$infos = $installer_plugins($plugin, 'uninstall', $dir_type);
44
-	if ($infos and !$infos['install_test'][0]) {
45
-		include_spip('inc/plugin');
46
-		ecrire_plugin_actifs(array($plugin), false, 'enleve');
47
-		$erreur = '';
48
-	} else {
49
-		$erreur = 'erreur_plugin_desinstalation_echouee';
50
-	}
51
-	if ($redirect = _request('redirect')) {
52
-		include_spip('inc/headers');
53
-		if ($erreur) {
54
-			$redirect = parametre_url($redirect, 'erreur', $erreur);
55
-		}
56
-		$redirect = str_replace('&', '&', $redirect);
57
-		redirige_par_entete($redirect);
58
-	}
35
+    $securiser_action = charger_fonction('securiser_action', 'inc');
36
+    $arg = $securiser_action();
37
+    list($dir_plugins, $plugin) = explode("::", $arg);
38
+    $dir_type = "_DIR_PLUGINS";
39
+    if (defined('_DIR_PLUGINS_SUPPL') and $dir_plugins == _DIR_PLUGINS_SUPPL) {
40
+        $dir_type = "_DIR_PLUGINS_SUPPL";
41
+    }
42
+    $installer_plugins = charger_fonction('installer', 'plugins');
43
+    $infos = $installer_plugins($plugin, 'uninstall', $dir_type);
44
+    if ($infos and !$infos['install_test'][0]) {
45
+        include_spip('inc/plugin');
46
+        ecrire_plugin_actifs(array($plugin), false, 'enleve');
47
+        $erreur = '';
48
+    } else {
49
+        $erreur = 'erreur_plugin_desinstalation_echouee';
50
+    }
51
+    if ($redirect = _request('redirect')) {
52
+        include_spip('inc/headers');
53
+        if ($erreur) {
54
+            $redirect = parametre_url($redirect, 'erreur', $erreur);
55
+        }
56
+        $redirect = str_replace('&', '&', $redirect);
57
+        redirige_par_entete($redirect);
58
+    }
59 59
 }
Please login to merge, or discard this patch.
ecrire/action/instituer_langue_rubrique.php 1 patch
Indentation   +31 added lines, -31 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@  discard block
 block discarded – undo
17 17
  **/
18 18
 
19 19
 if (!defined('_ECRIRE_INC_VERSION')) {
20
-	return;
20
+    return;
21 21
 }
22 22
 
23 23
 /**
@@ -25,34 +25,34 @@  discard block
 block discarded – undo
25 25
  **/
26 26
 function action_instituer_langue_rubrique_dist() {
27 27
 
28
-	$securiser_action = charger_fonction('securiser_action', 'inc');
29
-	$arg = $securiser_action();
30
-	$changer_lang = _request('changer_lang');
31
-
32
-	list($id_rubrique, $id_parent) = preg_split('/\W/', $arg);
33
-
34
-	if ($changer_lang
35
-		and $id_rubrique > 0
36
-		and $GLOBALS['meta']['multi_rubriques'] == 'oui'
37
-		and ($GLOBALS['meta']['multi_secteurs'] == 'non' or $id_parent == 0)
38
-	) {
39
-		if ($changer_lang != "herit") {
40
-			sql_updateq('spip_rubriques', array('lang' => $changer_lang, 'langue_choisie' => 'oui'),
41
-				"id_rubrique=$id_rubrique");
42
-		} else {
43
-			if ($id_parent == 0) {
44
-				$langue_parent = $GLOBALS['meta']['langue_site'];
45
-			} else {
46
-				$langue_parent = sql_getfetsel("lang", "spip_rubriques", "id_rubrique=$id_parent");
47
-			}
48
-			sql_updateq('spip_rubriques', array('lang' => $langue_parent, 'langue_choisie' => 'non'),
49
-				"id_rubrique=$id_rubrique");
50
-		}
51
-		include_spip('inc/rubriques');
52
-		calculer_langues_rubriques();
53
-
54
-		// invalider les caches marques de cette rubrique
55
-		include_spip('inc/invalideur');
56
-		suivre_invalideur("id='rubrique/$id_rubrique'");
57
-	}
28
+    $securiser_action = charger_fonction('securiser_action', 'inc');
29
+    $arg = $securiser_action();
30
+    $changer_lang = _request('changer_lang');
31
+
32
+    list($id_rubrique, $id_parent) = preg_split('/\W/', $arg);
33
+
34
+    if ($changer_lang
35
+        and $id_rubrique > 0
36
+        and $GLOBALS['meta']['multi_rubriques'] == 'oui'
37
+        and ($GLOBALS['meta']['multi_secteurs'] == 'non' or $id_parent == 0)
38
+    ) {
39
+        if ($changer_lang != "herit") {
40
+            sql_updateq('spip_rubriques', array('lang' => $changer_lang, 'langue_choisie' => 'oui'),
41
+                "id_rubrique=$id_rubrique");
42
+        } else {
43
+            if ($id_parent == 0) {
44
+                $langue_parent = $GLOBALS['meta']['langue_site'];
45
+            } else {
46
+                $langue_parent = sql_getfetsel("lang", "spip_rubriques", "id_rubrique=$id_parent");
47
+            }
48
+            sql_updateq('spip_rubriques', array('lang' => $langue_parent, 'langue_choisie' => 'non'),
49
+                "id_rubrique=$id_rubrique");
50
+        }
51
+        include_spip('inc/rubriques');
52
+        calculer_langues_rubriques();
53
+
54
+        // invalider les caches marques de cette rubrique
55
+        include_spip('inc/invalideur');
56
+        suivre_invalideur("id='rubrique/$id_rubrique'");
57
+    }
58 58
 }
Please login to merge, or discard this patch.
ecrire/action/debloquer_edition.php 1 patch
Indentation   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@  discard block
 block discarded – undo
17 17
  */
18 18
 
19 19
 if (!defined('_ECRIRE_INC_VERSION')) {
20
-	return;
20
+    return;
21 21
 }
22 22
 
23 23
 /**
@@ -31,17 +31,17 @@  discard block
 block discarded – undo
31 31
  */
32 32
 function action_debloquer_edition_dist() {
33 33
 
34
-	$securiser_action = charger_fonction('securiser_action', 'inc');
35
-	$arg = $securiser_action();
34
+    $securiser_action = charger_fonction('securiser_action', 'inc');
35
+    $arg = $securiser_action();
36 36
 
37
-	if ($arg) {
38
-		include_spip('inc/drapeau_edition');
39
-		if ($arg == 'tous') {
40
-			debloquer_tous($GLOBALS['visiteur_session']['id_auteur']);
41
-		} else {
42
-			$arg = explode("-", $arg);
43
-			list($objet, $id_objet) = $arg;
44
-			debloquer_edition($GLOBALS['visiteur_session']['id_auteur'], $id_objet, $objet);
45
-		}
46
-	}
37
+    if ($arg) {
38
+        include_spip('inc/drapeau_edition');
39
+        if ($arg == 'tous') {
40
+            debloquer_tous($GLOBALS['visiteur_session']['id_auteur']);
41
+        } else {
42
+            $arg = explode("-", $arg);
43
+            list($objet, $id_objet) = $arg;
44
+            debloquer_edition($GLOBALS['visiteur_session']['id_auteur'], $id_objet, $objet);
45
+        }
46
+    }
47 47
 }
Please login to merge, or discard this patch.