3 /***************************************************************************\
4 * SPIP, Systeme de publication pour l'internet *
6 * Copyright (c) 2001-2016 *
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')) {
17 include_spip('inc/dump');
18 include_spip('inc/autoriser');
21 * Telecharger un dump quand on est webmestre
25 function action_telecharger_dump_dist($arg = null) {
27 $securiser_action = charger_fonction('securiser_action', 'inc');
28 $arg = $securiser_action();
31 $file = dump_repertoire() . basename($arg, '.sqlite') . '.sqlite';
35 and autoriser('webmestre')
38 // ce content-type est necessaire pour eviter des corruptions de zip dans ie6
39 header('Content-Type: application/octet-stream');
41 header("Content-Disposition: attachment; filename=\"$f\";");
42 header('Content-Transfer-Encoding: binary');
44 // fix for IE catching or PHP bug issue
45 header('Pragma: public');
46 header('Expires: 0'); // set expiration time
47 header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
49 if ($cl = filesize($file)) {
50 header('Content-Length: ' . $cl);
55 include_spip('inc/minipres');
56 echo minipres(_T('erreur') . ' 404', _T('info_acces_interdit'));
59 // et on finit comme ca d'un coup