diff options
| author | michael pereira | 2011-07-18 15:52:22 +0200 |
|---|---|---|
| committer | michael pereira | 2011-07-18 15:52:22 +0200 |
| commit | 14867d123b2c1f7f11ff10979559ffeae391d14b (patch) | |
| tree | 0965271ac5ba62ecb572838f8dcee02673a8dbdf /application/modules | |
| parent | login test (diff) | |
| download | pbs2-14867d123b2c1f7f11ff10979559ffeae391d14b.tar.gz pbs2-14867d123b2c1f7f11ff10979559ffeae391d14b.tar.xz pbs2-14867d123b2c1f7f11ff10979559ffeae391d14b.zip | |
login test
Diffstat (limited to 'application/modules')
| -rw-r--r-- | application/modules/ipxe/controllers/ResourceController.php | 15 | ||||
| -rw-r--r-- | application/modules/ipxe/views/scripts/resource/getvesamenu.phtml | 12 |
2 files changed, 13 insertions, 14 deletions
diff --git a/application/modules/ipxe/controllers/ResourceController.php b/application/modules/ipxe/controllers/ResourceController.php index 8c3866e..ae2d33f 100644 --- a/application/modules/ipxe/controllers/ResourceController.php +++ b/application/modules/ipxe/controllers/ResourceController.php @@ -74,18 +74,15 @@ class Ipxe_ResourceController extends Zend_Controller_Action if(!isset($_SERVER['PHP_AUTH_USER'])){ header('WWW-Authenticate: Basic realm=""'); header('HTTP/1.0 401 Unauthorized'); - echo '>h2>Authorization failed.>/h2>'; 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"'); -// header('Pragma: no-cache'); -// header('Expires: 0'); - - print_a($_SERVER); - + 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"'); + header('Pragma: no-cache'); + header('Expires: 0'); + $vesamenuView = new Zend_View(); $vesamenuView->addScriptPath(APPLICATION_PATH.'/modules/ipxe/views/scripts/resource/'); $vesamenuView->username = $_SERVER['PHP_AUTH_USER']; diff --git a/application/modules/ipxe/views/scripts/resource/getvesamenu.phtml b/application/modules/ipxe/views/scripts/resource/getvesamenu.phtml index f99217c..921bbf3 100644 --- a/application/modules/ipxe/views/scripts/resource/getvesamenu.phtml +++ b/application/modules/ipxe/views/scripts/resource/getvesamenu.phtml @@ -1,11 +1,13 @@ <?php $index = 0; + $username = $this->username; + $password = $this->password; function title ( $title ) { - $this->username; + global $username; echo "menu title ".$title; - echo ( $this->username ? " for ".$this->username : "" )."\n"; + echo ( $username ? " for ".$username : "" )."\n"; } function label ( $label ) { @@ -46,10 +48,10 @@ } function authenticated () { - $this->username; - $this->password; + global $username; + global $password; - switch ( "$this->username:$this->password" ) { + switch ( "$username:$password" ) { case "test:test": case "guest:guest": return 1; |
