tazwok diff web/download.php @ rev 407

Improve chroot configuration
author Antoine Bodin <gokhlayeh@slitaz.org>
date Fri Mar 04 06:23:07 2011 +0100 (2011-03-04)
parents
children eb6a2f0a9faa
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/web/download.php	Fri Mar 04 06:23:07 2011 +0100
     1.3 @@ -0,0 +1,20 @@
     1.4 +<?php
     1.5 +$version=$_GET["version"];
     1.6 +if (file_exists("conf-$version.php")) {
     1.7 +	include("conf-$version.php");
     1.8 +}
     1.9 +else {
    1.10 +	if (file_exists("conf.php")) {
    1.11 +		include("conf.php");
    1.12 +	}
    1.13 +}
    1.14 +$package=$_GET["package"];
    1.15 +$filename=preg_replace('/.*\//', '', $package);
    1.16 +if (file_exists("$version-$package")) {
    1.17 +	header("Content-disposition: attachment; filename=$filename");
    1.18 +	readfile("$version-$package");
    1.19 +}
    1.20 +else {
    1.21 +	echo "Strange things happens...";
    1.22 +}
    1.23 +?>
    1.24 \ No newline at end of file