diff options
author | michael pereira | 2011-07-07 14:01:45 +0200 |
---|---|---|
committer | michael pereira | 2011-07-07 14:01:45 +0200 |
commit | b2c5c02e03a8c7ca73e3c787006ad854de5f336a (patch) | |
tree | 6e953f3db08013de4eb2159826a6db49bd43a87f /application/controllers | |
parent | remove parse error (diff) | |
download | pbs2-b2c5c02e03a8c7ca73e3c787006ad854de5f336a.tar.gz pbs2-b2c5c02e03a8c7ca73e3c787006ad854de5f336a.tar.xz pbs2-b2c5c02e03a8c7ca73e3c787006ad854de5f336a.zip |
Bootos zeigt nun an welche Dateien vorhanden sind. iPXE im Resource controller implementiert
Diffstat (limited to 'application/controllers')
-rw-r--r-- | application/controllers/ResourceController.php | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/application/controllers/ResourceController.php b/application/controllers/ResourceController.php index e67e008..25bbc8d 100644 --- a/application/controllers/ResourceController.php +++ b/application/controllers/ResourceController.php @@ -574,6 +574,47 @@ class ResourceController extends Zend_Controller_Action $path = "http://" . $_SERVER['SERVER_NAME'] . $path; return $path; } + + public function getvesamenuAction(){ + if(is_dir("../resources/ipxe/")){ + + header('Content-Type: application/octet-stream'); + $content_disp = ( ereg('MSIE ([0-9].[0-9]{1,2})', $_SERVER['HTTP_USER_AGENT']) == 'IE') ? 'inline' : 'attachment'; + header('Content-Disposition: ' . $content_disp . '; filename="vesamenu.c32"'); + header('Pragma: no-cache'); + header('Expires: 0'); + + chdir("../resources/ipxe/"); + + header("Content-Length: ".filesize(getcwd()."/vesamenu.c32")); + + passthru( "cat vesamenu.c32"); + }else{ + header('HTTP/1.0 404 Not Found'); + } + + } + + + public function ipxeAction(){ + + header('Content-Type: text/plain'); + + $vesamenuView = new Zend_View(); + $vesamenuView->addScriptPath(APPLICATION_PATH.'/views/scripts/resource/'); + $vesamenuView->host = $_SERVER['HTTP_HOST']; + $vesamenu = $vesamenuView->render('getvesamenu.phtml'); + + $result = "#!gpxe\n"; + $result .= "imgfree\n"; + + $result .= "chain http://".$_SERVER['HTTP_HOST']."/resource/getvesamenu $vesamenu"; + + header("Content-Length: ".(strlen($result))); + + echo $result; + + } } |