3 /***************************************************************************\
4 * SPIP, Systeme de publication pour l'internet *
6 * Copyright (c) 2001-2014 *
7 * Arnaud Martin, Antoine Pitrou, Philippe Riviere, Emmanuel Saint-James *
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 \***************************************************************************/
13 if (!defined("_ECRIRE_INC_VERSION")) return;
15 include_spip('inc/dump');
16 include_spip('inc/autoriser');
19 * Telecharger un dump quand on est webmestre
23 function action_telecharger_dump_dist($arg=null){
25 $securiser_action = charger_fonction('securiser_action', 'inc');
26 $arg = $securiser_action();
29 $file = dump_repertoire().basename($arg,'.sqlite').'.sqlite';
33 AND autoriser('webmestre')){
36 // ce content-type est necessaire pour eviter des corruptions de zip dans ie6
37 header('Content-Type: application/octet-stream');
39 header("Content-Disposition: attachment; filename=\"$f\";");
40 header("Content-Transfer-Encoding: binary");
42 // fix for IE catching or PHP bug issue
43 header("Pragma: public");
44 header("Expires: 0"); // set expiration time
45 header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
47 if ($cl = filesize($file))
48 header("Content-Length: ". $cl);
54 include_spip('inc/minipres');
55 echo minipres(_T('erreur').' 404',
56 _T('info_acces_interdit'));
59 // et on finit comme ca d'un coup