[ Index ] |
|
Code source de SPIP Agora 1.4 |
1 <?php 2 /***************************************************** 3 * This file is part of Agora, web based content management system. 4 * 5 * Agora is free software; you can redistribute it and/or modify 6 * it under the terms of the GNU General Public License as published by 7 * the Free Software Foundation; version 2 of the License. 8 * 9 * Agora is distributed in the hope that it will be useful, 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 * GNU General Public License for more details (file "COPYING"). 13 * 14 * Copyright © Arnaud Martin, Antoine Pitrou et Philippe Rivière. 15 * List of authors detailed in "copyright_fr.html" file. 16 * E-mail : agora@sig.premier-ministre.gouv.fr 17 * Web site : http://www.agora.gouv.fr 18 *****************************************************/ 19 include ("inc_version.php"); 20 21 include_ecrire ("inc_auth.php"); 22 include_ecrire ("inc_import.php"); 23 include_ecrire ("inc_admin.php"); 24 include_ecrire ("inc_meta.php"); 25 include_ecrire ("inc_texte.php"); 26 include_ecrire ("inc_filtres.php"); 27 28 function verifier_version_sauvegarde ($archive) { 29 global $spip_version; 30 global $flag_gz; 31 32 $ok = file_exists("data/$archive"); 33 $gz = $flag_gz; 34 $_fopen = ($gz) ? gzopen : fopen; 35 $_fread = ($gz) ? gzread : fread; 36 $buf_len = 1024; // la version doit etre dans le premier ko 37 38 if ($ok) { 39 $f = $_fopen("data/$archive", "rb"); 40 $buf = $_fread($f, $buf_len); 41 if (ereg("<SPIP [^>]* version_base=\"([0-9\.]+)\" ", $buf, $regs)AND $regs[1] == $spip_version) 42 return false; // c'est bon 43 else 44 return _T('avis_erreur_version_archive', array('archive' => $archive)); 45 } 46 else 47 return _T('avis_probleme_archive', array('archive' => $archive)); 48 } 49 50 if ($archive) { 51 $action = _T('info_restauration_sauvegarde', array('archive' => $archive)); 52 $commentaire = verifier_version_sauvegarde($archive); 53 } 54 55 debut_admin($action, $commentaire); 56 57 $archive = "data/$archive"; 58 59 ecrire_meta("debut_restauration", "debut"); 60 ecrire_meta("fichier_restauration", $archive); 61 ecrire_meta("status_restauration", "0"); 62 ecrire_metas(); 63 64 fin_admin($action); 65 66 @header("Location: index.php"); 67 68 exit; 69 ?>
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
Généré le : Sat Feb 24 14:40:03 2007 | par Balluche grâce à PHPXref 0.7 |