[SPIP] ~maj 3.0.10 --> 3.0.14
[lhc/web/www.git] / www / ecrire / maj / svn10000.php
1 <?php
2
3 /***************************************************************************\
4 * SPIP, Systeme de publication pour l'internet *
5 * *
6 * Copyright (c) 2001-2014 *
7 * Arnaud Martin, Antoine Pitrou, Philippe Riviere, Emmanuel Saint-James *
8 * *
9 * Ce programme est un logiciel libre distribue sous licence GNU/GPL. *
10 * Pour plus de details voir le fichier COPYING.txt ou l'aide en ligne. *
11 \***************************************************************************/
12
13 if (!defined('_ECRIRE_INC_VERSION')) return;
14
15 /*--------------------------------------------------------------------- */
16 /* Gestion des MAJ par tableau indexe par le numero SVN du chgt */
17 /*--------------------------------------------------------------------- */
18
19 // Type cls et sty pour LaTeX
20 $GLOBALS['maj'][10990] = array(array('upgrade_types_documents'));
21
22 // Type 3gp: http://www.faqs.org/rfcs/rfc3839.html
23 // Aller plus vite pour les vieilles versions en redeclarant une seule les doc
24 unset($GLOBALS['maj'][10990]);
25 $GLOBALS['maj'][11042] = array(array('upgrade_types_documents'));
26
27
28 // Un bug permettait au champ 'upload' d'etre vide, provoquant
29 // l'impossibilite de telecharger une image
30 // http://trac.rezo.net/trac/spip/ticket/1238
31 $GLOBALS['maj'][11171] = array(
32 array('spip_query', "UPDATE spip_types_documents SET upload='oui' WHERE upload IS NULL OR upload!='non'")
33 );
34
35 function maj_11268() {
36 global $tables_auxiliaires;
37 include_spip('base/auxiliaires');
38 $v = $tables_auxiliaires[$k='spip_resultats'];
39 sql_create($k, $v['field'], $v['key'], false, false);
40 }
41 $GLOBALS['maj'][11268] = array(array('maj_11268'));
42
43
44 function maj_11276 () {
45 include_spip('maj/v019');
46 maj_1_938();
47 }
48 $GLOBALS['maj'][11276] = array(array('maj_11276'));
49
50 // reparer les referers d'article, qui sont vides depuis [10572]
51 function maj_11388 () {
52 $s = sql_select('referer_md5', 'spip_referers_articles', "referer='' OR referer IS NULL");
53 while ($t = sql_fetch($s)) {
54 $k = sql_fetsel('referer', 'spip_referers', 'referer_md5='.sql_quote($t['referer_md5']));
55 if ($k['referer']) {
56 spip_query('UPDATE spip_referers_articles
57 SET referer='.sql_quote($k['referer']).'
58 WHERE referer_md5='.sql_quote($t['referer_md5'])
59 ." AND (referer='' OR referer IS NULL)"
60 );
61 }
62 }
63 }
64 $GLOBALS['maj'][11388] = array(array('maj_11388'));
65
66 // reparer spip_mots.type = titre du groupe
67 function maj_11431 () {
68 // mysql only
69 // spip_query("UPDATE spip_mots AS a LEFT JOIN spip_groupes_mots AS b ON (a.id_groupe = b.id_groupe) SET a.type=b.titre");
70
71 // selection des mots cles dont le type est different du groupe
72 $res = sql_select(
73 array("a.id_mot AS id_mot", "b.titre AS type"),
74 array("spip_mots AS a LEFT JOIN spip_groupes_mots AS b ON (a.id_groupe = b.id_groupe)"),
75 array("a.type != b.titre"));
76 // mise a jour de ces mots la
77 if ($res){
78 while ($r = sql_fetch($res)){
79 sql_updateq('spip_mots', array('type'=>$r['type']), 'id_mot='.sql_quote($r['id_mot']));
80 }
81 }
82 }
83 $GLOBALS['maj'][11431] = array(array('maj_11431'));
84
85 // reparer spip_types_documents.id_type
86 // qui est parfois encore present
87 function maj_11778 () {
88 // si presence id_type
89 $s = sql_showtable('spip_types_documents');
90 if (isset($s['field']['id_type'])) {
91 sql_alter('TABLE spip_types_documents CHANGE id_type id_type BIGINT(21) NOT NULL');
92 sql_alter('TABLE spip_types_documents DROP id_type');
93 sql_alter('TABLE spip_types_documents ADD PRIMARY KEY (extension)');
94 }
95 }
96 $GLOBALS['maj'][11778] = array(array('maj_11778'));
97
98 // Optimisation des forums
99 function maj_11790 () {
100 # sql_alter('TABLE spip_forum DROP INDEX id_message id_message');
101 sql_alter('TABLE spip_forum ADD INDEX id_parent (id_parent)');
102 sql_alter('TABLE spip_forum ADD INDEX id_auteur (id_auteur)');
103 sql_alter('TABLE spip_forum ADD INDEX id_thread (id_thread)');
104 }
105
106 $GLOBALS['maj'][11790] = array(array('maj_11790'));
107
108 $GLOBALS['maj'][11794] = array(); // ajout de spip_documents_forum
109
110
111
112 $GLOBALS['maj'][11961] = array(
113 array('sql_alter',"TABLE spip_groupes_mots CHANGE `tables` tables_liees text DEFAULT '' NOT NULL AFTER obligatoire"), // si tables a ete cree on le renomme
114 array('sql_alter',"TABLE spip_groupes_mots ADD tables_liees text DEFAULT '' NOT NULL AFTER obligatoire"), // sinon on l'ajoute
115 array('sql_update','spip_groupes_mots',array('tables_liees'=>"''"),"articles REGEXP '.*'"), // si le champ articles est encore la, on reinit la conversion
116 array('sql_update','spip_groupes_mots',array('tables_liees'=>"concat(tables_liees,'articles,')"),"articles='oui'"), // sinon ces 4 requetes ne feront rien
117 array('sql_update','spip_groupes_mots',array('tables_liees'=>"concat(tables_liees,'breves,')"),"breves='oui'"),
118 array('sql_update','spip_groupes_mots',array('tables_liees'=>"concat(tables_liees,'rubriques,')"),"rubriques='oui'"),
119 array('sql_update','spip_groupes_mots',array('tables_liees'=>"concat(tables_liees,'syndic,')"),"syndic='oui'"),
120 );
121
122
123
124 // Reunir en une seule table les liens de documents
125 // spip_documents_articles et spip_documents_forum
126 function maj_12008 () {
127 // Creer spip_documents_liens
128 global $tables_auxiliaires;
129 include_spip('base/auxiliaires');
130 $v = $tables_auxiliaires[$k='spip_documents_liens'];
131 sql_create($k, $v['field'], $v['key'], false, false);
132
133 // Recopier les donnees
134 foreach (array('article', 'breve', 'rubrique', 'auteur', 'forum') as $l) {
135 if ($s = sql_select('*', 'spip_documents_'.$l.'s')
136 OR $s = sql_select('*', 'spip_documents_'.$l)) {
137 $tampon = array();
138 while ($t = sql_fetch($s)) {
139 // transformer id_xx=N en (id_objet=N, objet=xx)
140 $t['id_objet'] = $t["id_$l"];
141 $t['objet'] = $l;
142 unset($t["id_$l"]);
143 unset($t['maj']);
144 $tampon[] = $t;
145 if (count($tampon)>10000) {
146 sql_insertq_multi('spip_documents_liens',$tampon);
147 $tampon = array();
148 }
149 }
150 if (count($tampon)) {
151 sql_insertq_multi('spip_documents_liens', $tampon);
152 }
153 }
154 }
155 }
156
157 $GLOBALS['maj'][12008] = array(
158 //array('sql_drop_table',"spip_documents_liens"), // tant pis pour ceux qui ont joue a 11974
159 array('sql_alter',"TABLE spip_documents_liens DROP PRIMARY KEY"),
160 array('sql_alter',"TABLE spip_documents_liens ADD id_objet bigint(21) DEFAULT '0' NOT NULL AFTER id_document"),
161 array('sql_alter',"TABLE spip_documents_liens ADD objet VARCHAR (25) DEFAULT '' NOT NULL AFTER id_objet"),
162 array('sql_update','spip_documents_liens',array('id_objet'=>"id_article",'objet'=>"'article'"),"id_article IS NOT NULL AND id_article>0"),
163 array('sql_update','spip_documents_liens',array('id_objet'=>"id_rubrique",'objet'=>"'rubrique'"),"id_rubrique IS NOT NULL AND id_rubrique>0"),
164 array('sql_update','spip_documents_liens',array('id_objet'=>"id_breve",'objet'=>"'breve'"),"id_breve IS NOT NULL AND id_breve>0"),
165 array('sql_update','spip_documents_liens',array('id_objet'=>"id_auteur",'objet'=>"'auteur'"),"id_auteur IS NOT NULL AND id_auteur>0"),
166 array('sql_update','spip_documents_liens',array('id_objet'=>"id_forum",'objet'=>"'forum'"),"id_forum IS NOT NULL AND id_forum>0"),
167 array('sql_alter',"TABLE spip_documents_liens ADD PRIMARY KEY (id_document,id_objet,objet)"),
168 array('sql_alter',"TABLE spip_documents_liens DROP id_article"),
169 array('sql_alter',"TABLE spip_documents_liens DROP id_rubrique"),
170 array('sql_alter',"TABLE spip_documents_liens DROP id_breve"),
171 array('sql_alter',"TABLE spip_documents_liens DROP id_auteur"),
172 array('sql_alter',"TABLE spip_documents_liens DROP id_forum"),
173 array('maj_12008'),
174 );
175
176
177 // destruction des tables spip_documents_articles etc, cf. 12008
178 $GLOBALS['maj'][12009] = array(
179 array('sql_drop_table',"spip_documents_articles"),
180 array('sql_drop_table',"spip_documents_breves"),
181 array('sql_drop_table',"spip_documents_rubriques"),
182 array('sql_drop_table',"spip_documents_auteurs"), # plugin #FORMULAIRE_UPLOAD
183 array('sql_drop_table',"spip_documents_syndic") # plugin podcast_client
184 );
185
186 // destruction des champs articles breves rubriques et syndic, cf. 11961
187 $GLOBALS['maj'][12010] = array(
188 array('sql_alter',"TABLE spip_groupes_mots DROP articles"),
189 array('sql_alter',"TABLE spip_groupes_mots DROP breves"),
190 array('sql_alter',"TABLE spip_groupes_mots DROP rubriques"),
191 array('sql_alter',"TABLE spip_groupes_mots DROP syndic"),
192 );
193
194 function maj_13135 () {
195 include_spip('inc/rubriques');
196 calculer_prochain_postdate();
197
198 // supprimer les eventuels vieux cache plugin qui n'utilisaient pas _chemin
199 @spip_unlink(_CACHE_PLUGINS_OPT);
200 @spip_unlink(_CACHE_PLUGINS_FCT);
201 }
202
203 $GLOBALS['maj'][13135] = array(array('maj_13135'));
204
205 // Type flac: http://flac.sourceforge.net
206 $GLOBALS['maj'][13333] = array(array('upgrade_types_documents'));
207
208 // http://archives.rezo.net/spip-zone.mbox/200903.mbox/%3Cbfc33ad70903141606q2e4c53f2k4fef6b45e611a04f@mail.gmail.com%3E
209
210 $GLOBALS['maj'][13833] = array(
211 array('sql_alter',"TABLE spip_documents_liens ADD INDEX objet(id_objet,objet)"))
212 ;
213
214 // Fin upgrade commun branche 2.0
215
216 $GLOBALS['maj'][13904] = array(
217 array('sql_alter',"TABLE spip_auteurs ADD webmestre varchar(3) DEFAULT 'non' NOT NULL"),
218 array('sql_update','spip_auteurs',array('webmestre'=>"'oui'"),sql_in("id_auteur",defined('_ID_WEBMESTRES')?explode(':',_ID_WEBMESTRES):(autoriser('configurer')?array($GLOBALS['visiteur_session']['id_auteur']):array(0)))) // le webmestre est celui qui fait l'upgrade si rien de defini
219 )
220 ;
221
222 // sites plantes en mode "'su" au lieu de "sus"
223 $GLOBALS['maj'][13929] = array(
224 array('sql_update',"spip_syndic",array('syndication'=>"'sus'"),"syndication LIKE '\\'%'")
225 );
226
227 // Types de fichiers m4a/m4b/m4p/m4u/m4v/dv
228 // Types de fichiers Open XML (cro$oft)
229 $GLOBALS['maj'][14558] = array(array('upgrade_types_documents'));
230
231 // refaire les upgrade dont les numeros sont inferieurs a ceux de la branche 2.0
232 // etre sur qu'ils sont bien unipotents(?)...
233 $GLOBALS['maj'][14559] = $GLOBALS['maj'][13904]+$GLOBALS['maj'][13929]+$GLOBALS['maj'][14558];
234
235 // La version 14588 etait une mauvaise piste:
236 // Retour en arriere pour ceux qui l'ont subi, ne rien faire sinon
237 if (@$GLOBALS['meta']['version_installee'] >= 14588) {
238
239 // "mode" est un mot-cle d'Oracle
240 $GLOBALS['maj'][14588] = array(
241 array('sql_alter',"TABLE spip_documents DROP INDEX mode"),
242 array('sql_alter',"TABLE spip_documents CHANGE mode genre ENUM('vignette', 'image', 'document') DEFAULT 'document' NOT NULL"),
243 array('sql_alter',"TABLE spip_documents ADD INDEX genre(genre)")
244 );
245 // solution moins intrusive au pb de mot-cle d'Oracle, retour avant 14588
246 $GLOBALS['maj'][14598] = array(
247 array('sql_alter',"TABLE spip_documents DROP INDEX genre"),
248 array('sql_alter',"TABLE spip_documents CHANGE genre mode ENUM('vignette', 'image', 'document') DEFAULT 'document' NOT NULL"),
249 array('sql_alter',"TABLE spip_documents ADD INDEX mode(mode)")
250 );
251 }
252
253 // Restauration correcte des types mime des fichiers Ogg
254 // http://trac.rezo.net/trac/spip/ticket/1941
255 // + Types de fichiers : f4a/f4b/f4p/f4v/mpc http://en.wikipedia.org/wiki/Flv#File_formats
256 // + Report du commit oublié : http://trac.rezo.net/trac/spip/changeset/14272
257 $GLOBALS['maj'][15676] = array(array('upgrade_types_documents'));
258
259 // Type de fichiers : webm http://en.wikipedia.org/wiki/Flv#File_formats
260 $GLOBALS['maj'][15827] = array(array('upgrade_types_documents'));
261
262 $GLOBALS['maj'][16428] = array(
263 array('maj_liens','auteur'), // creer la table liens
264 array('maj_liens','auteur','article'),
265 array('sql_drop_table',"spip_auteurs_articles"),
266 array('maj_liens','auteur','rubrique'),
267 array('sql_drop_table',"spip_auteurs_rubriques"),
268 array('maj_liens','auteur','message'),
269 array('sql_drop_table',"spip_auteurs_messages"),
270 );
271
272 // Reunir en une seule table les liens de documents
273 // spip_documents_articles et spip_documents_forum
274 function maj_liens($pivot,$l='') {
275
276 @define('_LOG_FILTRE_GRAVITE',8);
277
278 $exceptions_pluriel = array('forum'=>'forum','syndic'=>'syndic');
279
280 $pivot = preg_replace(',[^\w],','',$pivot); // securite
281 $pivots = (isset($exceptions_pluriel[$pivot])?$exceptions_pluriel[$pivot]:$pivot."s");
282 $liens = "spip_".$pivots."_liens";
283 $id_pivot = "id_".$pivot;
284 // Creer spip_auteurs_liens
285 global $tables_auxiliaires;
286 if (!$l) {
287 include_spip('base/auxiliaires');
288 include_spip('base/create');
289 creer_ou_upgrader_table($liens, $tables_auxiliaires[$liens], false);
290 }
291 else {
292 // Preparer
293 $l = preg_replace(',[^\w],','',$l); // securite
294 $primary = "id_$l";
295 $objet = ($l=='syndic'?'site':$l);
296 $ls = (isset($exceptions_pluriel[$l])?$exceptions_pluriel[$l]:$l."s");
297 $ancienne_table = 'spip_'.$pivots.'_'.$ls;
298 $pool = 400;
299
300 $trouver_table = charger_fonction('trouver_table','base');
301 if (!$desc = $trouver_table($ancienne_table))
302 return;
303
304 $champs = $desc['field'];
305 if (isset($champs['maj'])) unset($champs['maj']);
306 if (isset($champs[$primary])) unset($champs[$primary]);
307
308 $champs = array_keys($champs);
309 // ne garder que les champs qui existent sur la table destination
310 if ($desc_cible = $trouver_table($liens)){
311 $champs = array_intersect($champs,array_keys($desc_cible['field']));
312 }
313
314 $champs[] = "$primary as id_objet";
315 $champs[] = "'$objet' as objet";
316 $champs = implode(', ',$champs);
317
318 // Recopier les donnees
319 $sub_pool = 100;
320 while ($ids = array_map('reset',sql_allfetsel("$primary",$ancienne_table,'','','',"0,$sub_pool"))){
321 $insert = array();
322 foreach($ids as $id){
323 $n = sql_countsel($liens,"objet='$objet' AND id_objet=".intval($id));
324 while ($t = sql_allfetsel($champs, $ancienne_table,"$primary=".intval($id),'',$id_pivot,"$n,$pool")) {
325 $n+=count($t);
326 // empiler en s'assurant a minima de l'unicite
327 while ($r = array_shift($t))
328 $insert[$r[$id_pivot].':'.$r['id_objet']] = $r;
329 if (count($insert)>=$sub_pool){
330 maj_liens_insertq_multi_check($liens,$insert,$tables_auxiliaires[$liens]);
331 $insert = array();
332 }
333 // si timeout, sortir, la relance nous ramenera dans cette fonction
334 // et on verifiera/repartira de la
335 if (time() >= _TIME_OUT) return;
336 }
337 if (time() >= _TIME_OUT) return;
338 }
339 if (count($insert))
340 maj_liens_insertq_multi_check($liens,$insert,$tables_auxiliaires[$liens]);
341 sql_delete ($ancienne_table, sql_in($primary,$ids));
342 }
343 }
344 }
345 function maj_liens_insertq_multi_check($table,$couples,$desc=array()){
346 $n_before = sql_countsel($table);
347 sql_insertq_multi($table,$couples,$desc);
348 $n_after = sql_countsel($table);
349 if (($n_after-$n_before)==count($couples))
350 return;
351 // si ecart, on recommence l'insertion ligne par ligne...
352 // moins rapide mais secure : seul le couple en doublon echouera, et non toute la serie
353 foreach($couples as $c)
354 sql_insertq($table,$c,$desc);
355 }
356
357 $GLOBALS['maj'][17311] = array(
358 array('ecrire_meta',"multi_objets",implode(',',
359 array_diff(
360 array($GLOBALS['meta']['multi_rubriques']=='oui'?'spip_rubriques':'',$GLOBALS['meta']['multi_articles']=='oui'?'spip_articles':''),
361 array('')
362 ))),
363 array('ecrire_meta',"gerer_trad_objets",implode(',',
364 array_diff(
365 array($GLOBALS['meta']['gerer_trad']=='oui'?'spip_articles':''),
366 array('')
367 ))),
368 );
369 $GLOBALS['maj'][17555] = array(
370 array('sql_alter',"TABLE spip_resultats ADD table_objet varchar(30) DEFAULT '' NOT NULL"),
371 array('sql_alter',"TABLE spip_resultats ADD serveur char(16) DEFAULT '' NOT NULL"),
372 );
373
374 $GLOBALS['maj'][17563] = array(
375 array('sql_alter',"TABLE spip_articles ADD virtuel VARCHAR(255) DEFAULT '' NOT NULL"),
376 array('sql_update','spip_articles',array('virtuel'=>'SUBSTRING(chapo,2)','chapo'=>"''"),"chapo LIKE '=_%'"),
377 );
378
379 $GLOBALS['maj'][17577] = array(
380 array('maj_tables',array('spip_jobs','spip_jobs_liens')),
381 );
382
383 $GLOBALS['maj'][17743] = array(
384 array('sql_update','spip_auteurs',array('prefs'=>'bio','bio'=>"''"),"statut='nouveau' AND bio<>''"),
385 );
386
387 $GLOBALS['maj'][18219] = array(
388 array('sql_alter',"TABLE spip_rubriques DROP id_import"),
389 array('sql_alter',"TABLE spip_rubriques DROP export"),
390 );
391
392 $GLOBALS['maj'][18310] = array(
393 array('sql_alter',"TABLE spip_auteurs_liens CHANGE vu vu VARCHAR(6) DEFAULT 'non' NOT NULL"),
394 );
395
396 $GLOBALS['maj'][18597] = array(
397 array('sql_alter',"TABLE spip_rubriques ADD profondeur smallint(5) DEFAULT '0' NOT NULL"),
398 array('maj_propager_les_secteurs'),
399 );
400
401 $GLOBALS['maj'][18955] = array(
402 array('sql_alter',"TABLE spip_auteurs_liens ADD INDEX id_objet (id_objet)"),
403 array('sql_alter',"TABLE spip_auteurs_liens ADD INDEX objet (objet)"),
404 );
405
406
407 function maj_propager_les_secteurs(){
408 include_spip('inc/rubriques');
409 propager_les_secteurs();
410 }
411
412
413 function maj_collation_sqlite(){
414
415
416 include_spip('base/dump');
417 $tables = base_lister_toutes_tables();
418
419 // rien a faire si base non sqlite
420 if (strncmp($GLOBALS['connexions'][0]['type'],'sqlite',6)!==0)
421 return;
422
423 $trouver_table = charger_fonction('trouver_table','base');
424 // forcer le vidage de cache
425 $trouver_table('');
426
427 // cas particulier spip_auteurs : retablir le collate binary sur le login
428 $desc = $trouver_table("spip_auteurs");
429 spip_log("spip_auteurs : ".var_export($desc['field'],true),"maj."._LOG_INFO_IMPORTANTE);
430 if (stripos($desc['field']['login'],"BINARY")===false){
431 spip_log("Retablir champ login BINARY sur table spip_auteurs","maj");
432 sql_alter("table spip_auteurs change login login VARCHAR(255) BINARY");
433 $trouver_table('');
434 $new_desc = $trouver_table("spip_auteurs");
435 spip_log("Apres conversion spip_auteurs : ".var_export($new_desc['field'],true),"maj."._LOG_INFO_IMPORTANTE);
436 }
437
438 foreach ($tables as $table){
439 if (time() >= _TIME_OUT) return;
440 if ($desc = $trouver_table($table)){
441 $desc_collate = _sqlite_remplacements_definitions_table($desc['field']);
442 if ($d=array_diff($desc['field'],$desc_collate)){
443 spip_log("Table $table COLLATE incorrects","maj");
444
445 // cas particulier spip_urls :
446 // supprimer les doublons avant conversion sinon echec (on garde les urls les plus recentes)
447 if ($table=='spip_urls'){
448 // par date DESC pour conserver les urls les plus recentes
449 $data = sql_allfetsel("*","spip_urls",'','','date DESC');
450 $urls = array();
451 foreach ($data as $d){
452 $key = $d['id_parent']."::".strtolower($d['url']);
453 if (!isset($urls[$key]))
454 $urls[$key] = true;
455 else {
456 spip_log("Suppression doublon dans spip_urls avant conversion : ".serialize($d),"maj."._LOG_INFO_IMPORTANTE);
457 sql_delete("spip_urls","id_parent=".sql_quote($d['id_parent'])." AND url=".sql_quote($d['url']));
458 }
459 }
460 }
461 foreach ($desc['field'] as $field=>$type){
462 if ($desc['field'][$field]!==$desc_collate[$field]){
463 spip_log("Conversion COLLATE table $table","maj."._LOG_INFO_IMPORTANTE);
464 sql_alter("table $table change $field $field ".$desc_collate[$field]);
465 $trouver_table('');
466 $new_desc = $trouver_table($table);
467 spip_log("Apres conversion $table : ".var_export($new_desc['field'],true),"maj."._LOG_INFO_IMPORTANTE);
468 continue 2; // inutile de continuer pour cette table : un seul alter remet tout a jour en sqlite
469 }
470 }
471 }
472 }
473 }
474
475 // forcer le vidage de cache
476 $trouver_table('');
477
478 }
479
480
481 $GLOBALS['maj'][19236] = array(
482 array('sql_updateq','spip_meta',array('impt'=>'oui'),"nom='version_installee'"), // version base principale
483 array('sql_updateq','spip_meta',array('impt'=>'oui'),"nom LIKE '%_base_version'"), // version base plugins
484 array('maj_collation_sqlite'),
485 );
486
487 $GLOBALS['maj'][19268] = array(
488 array('supprimer_toutes_sessions'),
489 );
490
491
492 function supprimer_toutes_sessions() {
493 spip_log("supprimer sessions auteur");
494 $dir = opendir(_DIR_SESSIONS);
495 while(($f = readdir($dir)) !== false) {
496 spip_unlink(_DIR_SESSIONS . $f);
497 if (time() >= _TIME_OUT) return;
498 }
499 }
500
501 ?>