From 4893204b2153344054999746d941920850c80b88 Mon Sep 17 00:00:00 2001 From: michael pereira Date: Tue, 19 Jul 2011 23:58:01 +0200 Subject: menu structire --- .../modules/ipxe/controllers/ResourceController.php | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) (limited to 'application/modules/ipxe/controllers/ResourceController.php') 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']; -- cgit v1.2.3-55-g7522