summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormichael pereira2011-07-22 16:36:58 +0200
committermichael pereira2011-07-22 16:36:58 +0200
commit6119d81194d9c03ff7f677e6d7a5220afdeae9e2 (patch)
treeed2c6d35f95e0f00bb4fb8910f241855bf3a2ce4
parentneuer kernel (diff)
downloadpbs2-6119d81194d9c03ff7f677e6d7a5220afdeae9e2.tar.gz
pbs2-6119d81194d9c03ff7f677e6d7a5220afdeae9e2.tar.xz
pbs2-6119d81194d9c03ff7f677e6d7a5220afdeae9e2.zip
kernel statt chain zum laden des vesamenu im pxe script
-rw-r--r--application/modules/ipxe/controllers/AuthController.php11
-rw-r--r--application/modules/ipxe/controllers/ResourceController.php4
-rw-r--r--application/modules/ipxe/views/scripts/resource/getvesamenu.phtml7
3 files changed, 12 insertions, 10 deletions
diff --git a/application/modules/ipxe/controllers/AuthController.php b/application/modules/ipxe/controllers/AuthController.php
index b7e9a1f..75b25c2 100644
--- a/application/modules/ipxe/controllers/AuthController.php
+++ b/application/modules/ipxe/controllers/AuthController.php
@@ -34,7 +34,7 @@ class Ipxe_AuthController extends Zend_Controller_Action
{
$serialnumber = $this->_request->getParam('serialnumber');
$mac = $this->_request->getParam('mac');
- $login = $this->_request->getParam('login');
+ $login = $this->_request->getParam('login') == 'true';
if(isset($serialnumber)){
// Create a session
@@ -70,14 +70,15 @@ class Ipxe_AuthController extends Zend_Controller_Action
$result = "#!ipxe\n";
$result .= "imgfree\n";
- if($login == 'true'){
+ if($login){
$result .= "login\n";
- $result .= "chain 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";
+ $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 .= "chain http://".$_SERVER['HTTP_HOST']."/ipxe/resource/getvesamenu/alpha/".$session->getAlphasessionID()." http://".$_SERVER['HTTP_HOST']."/ipxe/resource/getvesamenuconfig/alpha/".$session->getAlphasessionID()."/login/false";
+ $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 .= "module http://pbs2.mp.openslx.org/media/img/pbs2.png\n";
+ $result .= "boot";
header("Content-Length: ".(strlen($result)));
diff --git a/application/modules/ipxe/controllers/ResourceController.php b/application/modules/ipxe/controllers/ResourceController.php
index db44a57..1ebfd55 100644
--- a/application/modules/ipxe/controllers/ResourceController.php
+++ b/application/modules/ipxe/controllers/ResourceController.php
@@ -71,9 +71,9 @@ class Ipxe_ResourceController extends Zend_Controller_Action
public function getvesamenuconfigAction(){
- $login = $this->_request->getParam('login');
+ $login = $this->_request->getParam('login') == 'true';
- if($login == 'true'){
+ if($login){
if(!isset($_SERVER['PHP_AUTH_USER']) || !isset($_SERVER['PHP_AUTH_PW'])){
header('WWW-Authenticate: Basic realm=""');
header('HTTP/1.0 401 Unauthorized');
diff --git a/application/modules/ipxe/views/scripts/resource/getvesamenu.phtml b/application/modules/ipxe/views/scripts/resource/getvesamenu.phtml
index fed9aa3..3499354 100644
--- a/application/modules/ipxe/views/scripts/resource/getvesamenu.phtml
+++ b/application/modules/ipxe/views/scripts/resource/getvesamenu.phtml
@@ -102,7 +102,7 @@ MENU MSGCOLOR #ff1c2a33 #00000000 none
title($this->error);
}
- if ($this->login == 'true' && !authenticated($this->username, $this->password)) {
+ if ($this->login && !authenticated($this->username, $this->password)) {
retry();
} else {
@@ -121,10 +121,11 @@ MENU MSGCOLOR #ff1c2a33 #00000000 none
"http://$this->host/ipxe/resource/getkernel/alpha/$this->alphaID/bme/".$bme->getID()."/file/kernel", "initrd=http://$this->host/ipxe/resource/getinitramfs/alpha/$this->alphaID/bme/".$bme->getID()."/file/initramfs alpha=$this->alphaID file=http://$this->host/c/$this->alphaID/default.tgz ".$bme->getKclappend());
}
}
- uriboot ( "Return to Group Bootmenu", "/ipxe/auth/serial/serialnumber/55-44-33-22-11/mac/123/login/false", "" );
+ if($this->login)
+ uriboot ( "Return to Group Bootmenu", "/ipxe/auth/serial/serialnumber/55-44-33-22-11/mac/123/login/false", "" );
}
- if($this->login == 'false'){
+ if(!$this->login){
uriboot ( "Login", "http://$this->host/ipxe/auth/serial/serialnumber/55-44-33-22-11/mac/123/login/true", "" );
texthelp("Login to get your own Bootmenu.");
}