summaryrefslogtreecommitdiffstats
path: root/application
diff options
context:
space:
mode:
Diffstat (limited to 'application')
-rw-r--r--application/modules/ipxe/controllers/ResourceController.php20
-rw-r--r--application/modules/ipxe/views/scripts/resource/getvesamenu.phtml4
2 files changed, 13 insertions, 11 deletions
diff --git a/application/modules/ipxe/controllers/ResourceController.php b/application/modules/ipxe/controllers/ResourceController.php
index 1bf8112..db44a57 100644
--- a/application/modules/ipxe/controllers/ResourceController.php
+++ b/application/modules/ipxe/controllers/ResourceController.php
@@ -73,13 +73,13 @@ class Ipxe_ResourceController extends Zend_Controller_Action
$login = $this->_request->getParam('login');
-// if($login == true){
-// if(!isset($_SERVER['PHP_AUTH_USER']) || !isset($_SERVER['PHP_AUTH_PW'])){
-// header('WWW-Authenticate: Basic realm=""');
-// header('HTTP/1.0 401 Unauthorized');
-// exit;
-// }
-// }
+ if($login == 'true'){
+ if(!isset($_SERVER['PHP_AUTH_USER']) || !isset($_SERVER['PHP_AUTH_PW'])){
+ header('WWW-Authenticate: Basic realm=""');
+ header('HTTP/1.0 401 Unauthorized');
+ exit;
+ }
+ }
header('Content-Type: text/html');
$content_disp = ( ereg('MSIE ([0-9].[0-9]{1,2})', $_SERVER['HTTP_USER_AGENT']) == 'IE') ? 'inline' : 'attachment';
header('Content-Disposition: ' . $content_disp . '; filename="vesamenu.conf"');
@@ -88,8 +88,10 @@ class Ipxe_ResourceController extends Zend_Controller_Action
$vesamenuView = new Zend_View();
$vesamenuView->addScriptPath(APPLICATION_PATH.'/modules/ipxe/views/scripts/resource/');
- $vesamenuView->username = $_SERVER['PHP_AUTH_USER'];
- $vesamenuView->password = $_SERVER['PHP_AUTH_PW'];
+ if($login == 'true'){
+ $vesamenuView->username = $_SERVER['PHP_AUTH_USER'];
+ $vesamenuView->password = $_SERVER['PHP_AUTH_PW'];
+ }
$vesamenuView->login = $login;
$vesamenuView->host = $_SERVER['HTTP_HOST'];
diff --git a/application/modules/ipxe/views/scripts/resource/getvesamenu.phtml b/application/modules/ipxe/views/scripts/resource/getvesamenu.phtml
index e66cf9d..8aedbe4 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 ( !authenticated($this->username, $this->password) && $this->login == true) {
+ if ($this->login == 'true' && !authenticated($this->username, $this->password)) {
retry();
} else {
@@ -123,7 +123,7 @@ MENU MSGCOLOR #ff1c2a33 #00000000 none
}
}
- if($this->login == false){
+ if($this->login == 'false'){
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.");
}