diff options
| author | Simon | 2011-03-18 19:28:25 +0100 |
|---|---|---|
| committer | Simon | 2011-03-18 19:28:25 +0100 |
| commit | 265c031ef9af9b34507e9ba340236d7c4ac2b8f4 (patch) | |
| tree | 678b0c34ad8eae9b4c71b70b0247beab5601b18d /application/modules/dev/controllers/ResourceController.php | |
| parent | FilterController kann editieren (diff) | |
| parent | newsql geaendert (diff) | |
| download | pbs2-265c031ef9af9b34507e9ba340236d7c4ac2b8f4.tar.gz pbs2-265c031ef9af9b34507e9ba340236d7c4ac2b8f4.tar.xz pbs2-265c031ef9af9b34507e9ba340236d7c4ac2b8f4.zip | |
Merge branch 'master' of openslx.org:lsfks/master-teamprojekt/pbs2
Diffstat (limited to 'application/modules/dev/controllers/ResourceController.php')
| -rw-r--r-- | application/modules/dev/controllers/ResourceController.php | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/application/modules/dev/controllers/ResourceController.php b/application/modules/dev/controllers/ResourceController.php index 653b70d..cbca8d0 100644 --- a/application/modules/dev/controllers/ResourceController.php +++ b/application/modules/dev/controllers/ResourceController.php @@ -33,14 +33,16 @@ class dev_ResourceController extends Zend_Controller_Action if(is_dir("../resources/bootos/$bootosID/initramfs/") && is_numeric($bootosID)){ header('Content-Type: application/x-gzip'); - $content_disp = ( ereg('MSIE ([0-9].[0-9]{1,2})', $HTTP_USER_AGENT) == 'IE') ? 'inline' : 'attachment'; + $content_disp = ( ereg('MSIE ([0-9].[0-9]{1,2})', $_SERVER['HTTP_USER_AGENT']) == 'IE') ? 'inline' : 'attachment'; header('Content-Disposition: ' . $content_disp . '; filename="initramfs"'); header('Pragma: no-cache'); header('Expires: 0'); // create file. chdir("../resources/bootos/$bootosID/initramfs/"); - passthru( "cat initramfs"); + $initname = array_pop(scandir("./")); + + passthru( "cat ".$initname); } } @@ -58,7 +60,7 @@ class dev_ResourceController extends Zend_Controller_Action if(is_dir("../resources/config/$configID/config/") && is_numeric($configID)){ header('Content-Type: application/x-gzip'); - $content_disp = ( ereg('MSIE ([0-9].[0-9]{1,2})', $HTTP_USER_AGENT) == 'IE') ? 'inline' : 'attachment'; + $content_disp = ( ereg('MSIE ([0-9].[0-9]{1,2})', $_SERVER['HTTP_USER_AGENT']) == 'IE') ? 'inline' : 'attachment'; header('Content-Disposition: ' . $content_disp . '; filename="config.tar.gz"'); header('Pragma: no-cache'); header('Expires: 0'); @@ -76,14 +78,16 @@ class dev_ResourceController extends Zend_Controller_Action if(is_dir("../resources/bootos/$bootosID/kernel/") && is_numeric($bootosID)){ header('Content-Type: application/x-gzip'); - $content_disp = ( ereg('MSIE ([0-9].[0-9]{1,2})', $HTTP_USER_AGENT) == 'IE') ? 'inline' : 'attachment'; + $content_disp = ( ereg('MSIE ([0-9].[0-9]{1,2})', $_SERVER['HTTP_USER_AGENT']) == 'IE') ? 'inline' : 'attachment'; header('Content-Disposition: ' . $content_disp . '; filename="kernel"'); header('Pragma: no-cache'); header('Expires: 0'); // create the gzipped tarfile. chdir("../resources/bootos/$bootosID/kernel/"); - passthru( "cat kernel"); + $kernelname = array_pop(scandir("./")); + + passthru( "cat ". $kernelname); } } @@ -98,7 +102,7 @@ class dev_ResourceController extends Zend_Controller_Action $bmemapper->find($bmeID,$bme); header('Content-Type: text/html'); - $content_disp = ( ereg('MSIE ([0-9].[0-9]{1,2})', $HTTP_USER_AGENT) == 'IE') ? 'inline' : 'attachment'; + $content_disp = ( ereg('MSIE ([0-9].[0-9]{1,2})', $_SERVER['HTTP_USER_AGENT']) == 'IE') ? 'inline' : 'attachment'; header('Content-Disposition: ' . $content_disp . '; filename="kcl.txt"'); header('Pragma: no-cache'); header('Expires: 0'); |
