diff options
| author | michael pereira | 2011-03-18 19:24:47 +0100 |
|---|---|---|
| committer | michael pereira | 2011-03-18 19:24:47 +0100 |
| commit | fd0e66bf49af0bc56e68830b4c59294f0ec8c101 (patch) | |
| tree | a5bd9e4e255c9a841b35931fa8f5d9c8d1ece5a2 /application/modules/dev/controllers/ResourceController.php | |
| parent | Datenbank update, PoolController (diff) | |
| download | pbs2-fd0e66bf49af0bc56e68830b4c59294f0ec8c101.tar.gz pbs2-fd0e66bf49af0bc56e68830b4c59294f0ec8c101.tar.xz pbs2-fd0e66bf49af0bc56e68830b4c59294f0ec8c101.zip | |
BootOs Update implementiert, BootISO anlegen und some fixes
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'); |
