diff options
| author | michael pereira | 2011-09-19 16:23:04 +0200 |
|---|---|---|
| committer | michael pereira | 2011-09-19 16:23:04 +0200 |
| commit | 7092483c1993d713b68436037f49ba3bb711af02 (patch) | |
| tree | b4e5d345d59568f1b1c7d941951c386212d28df0 | |
| parent | loop fetch_pxelinux (diff) | |
| download | pbs2-7092483c1993d713b68436037f49ba3bb711af02.tar.gz pbs2-7092483c1993d713b68436037f49ba3bb711af02.tar.xz pbs2-7092483c1993d713b68436037f49ba3bb711af02.zip | |
ipxe gefixt
3 files changed, 25 insertions, 9 deletions
diff --git a/application/modules/ipxe/controllers/AuthController.php b/application/modules/ipxe/controllers/AuthController.php index 2b1f7ba..6a5506b 100644 --- a/application/modules/ipxe/controllers/AuthController.php +++ b/application/modules/ipxe/controllers/AuthController.php @@ -43,7 +43,7 @@ class Ipxe_AuthController extends Zend_Controller_Action $bootisomapper = new Application_Model_BootIsoMapper(); $bootiso = new Application_Model_BootIso(); - + $results = $bootisomapper->findBy(array('serialnumber' => $serialnumber),true); if(count($results) == 0){ $this->_redirect('/ipxe/auth/error/serialresult/noserial'); @@ -72,17 +72,13 @@ class Ipxe_AuthController extends Zend_Controller_Action $result .= "imgfree\n"; if($login){ $result .= "login\n"; - //$result .= "kernel http://".$_SERVER['HTTP_HOST']."/ipxe/resource/getvesamenu/alpha/".$session->getAlphasessionID()." http://\${username:uristring}:\${password:uristring}@".$_SERVER['HTTP_HOST']."/ipxe/resource/getvesamenuconfig/alpha/".$session->getAlphasessionID()."/login/true\n"; + $result .= "kernel http://".$_SERVER['HTTP_HOST']."/ipxe/resource/getvesamenu/alpha/".$session->getAlphasessionID()." http://\${username:uristring}:\${password:uristring}@".$_SERVER['HTTP_HOST']."/ipxe/resource/getvesamenuconfig/alpha/".$session->getAlphasessionID()."/login/true\n"; }else{ - //$result .= "kernel http://".$_SERVER['HTTP_HOST']."/ipxe/resource/getvesamenu/alpha/".$session->getAlphasessionID()." http://".$_SERVER['HTTP_HOST']."/ipxe/resource/getvesamenuconfig/alpha/".$session->getAlphasessionID()."/login/false\n"; $result .= "set 209:string http://".$_SERVER['HTTP_HOST']."/ipxe/resource/getvesamenuconfig/alpha/".$session->getAlphasessionID()."/login/false\n"; - $result .= "set 210:string http://pbs2.mp.openslx.org/media/\n"; - $result .= ":retry_pxe\n chain \${210:string}pxelinux.0 || goto retry_pxe\n"; + $result .= "set 210:string http://".$_SERVER['HTTP_HOST']."/\n"; + $result .= "chain \${210:string}ipxe/resource/getpxelinux/alpha/".$session->getAlphasessionID(); } - //$result .= "module http://pbs2.mp.openslx.org/media/img/pbs2.png"; - $result .= "boot"; - header("Content-Length: ".(strlen($result))); echo $result; diff --git a/application/modules/ipxe/controllers/ResourceController.php b/application/modules/ipxe/controllers/ResourceController.php index 1ebfd55..fc0a7e4 100644 --- a/application/modules/ipxe/controllers/ResourceController.php +++ b/application/modules/ipxe/controllers/ResourceController.php @@ -69,6 +69,26 @@ class Ipxe_ResourceController extends Zend_Controller_Action } + public function getpxemenuAction(){ + 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="pxelinux.c32"'); + header('Pragma: no-cache'); + header('Expires: 0'); + + chdir("../resources/ipxe/"); + + header("Content-Length: ".filesize(getcwd()."/pxelinux.0")); + + passthru( "cat pxelinux.0"); + }else{ + header('HTTP/1.0 404 Not Found'); + } + + } + public function getvesamenuconfigAction(){ $login = $this->_request->getParam('login') == 'true'; diff --git a/application/modules/ipxe/views/scripts/resource/getvesamenu.phtml b/application/modules/ipxe/views/scripts/resource/getvesamenu.phtml index 06546aa..20f44a6 100644 --- a/application/modules/ipxe/views/scripts/resource/getvesamenu.phtml +++ b/application/modules/ipxe/views/scripts/resource/getvesamenu.phtml @@ -58,7 +58,7 @@ ?> TIMEOUT 100 PROMPT 0 -DEFAULT http://pbs2.mp.openslx.org/media/vesamenu.c32 +DEFAULT <?php "http://$this->host/ipxe/resource/getvesamenu/alpha/$this->alhaID()" ?> MENU BACKGROUND http://pbs2.mp.openslx.org/media/img/pbs2.png MENU WIDTH 78 |
