From 45c629cece3858112d4ac9a2782233ceda9eff91 Mon Sep 17 00:00:00 2001 From: michael pereira Date: Fri, 28 Oct 2011 17:04:14 +0200 Subject: login --- .../modules/ipxe/controllers/AuthController.php | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'application/modules/ipxe/controllers') diff --git a/application/modules/ipxe/controllers/AuthController.php b/application/modules/ipxe/controllers/AuthController.php index d66620b..4d11298 100644 --- a/application/modules/ipxe/controllers/AuthController.php +++ b/application/modules/ipxe/controllers/AuthController.php @@ -103,6 +103,17 @@ class Ipxe_AuthController extends Zend_Controller_Action $login = $this->_request->getParam('login'); $error = $this->_request->getParam('error'); + if(!isset($_SERVER['PHP_AUTH_USER']) || !isset($_SERVER['PHP_AUTH_PW'])){ + header('WWW-Authenticate: Basic realm=""'); + header('HTTP/1.0 401 Unauthorized'); + $result = "#!ipxe\n"; + $result .= "imgfree\n"; + $result .= "module http://".$_SERVER['HTTP_HOST']."/ipxe/auth/login/alpha/".$alpha."/error/login\n"; + header("Content-Length: ".(strlen($result))); + echo $result; + exit; + } + if (isset($error)){ header('Content-Type: text/plain'); $result = "error"; @@ -111,7 +122,6 @@ class Ipxe_AuthController extends Zend_Controller_Action exit; } - if (isset($login)){ header('Content-Type: text/plain'); $result = "#!ipxe\n"; @@ -122,16 +132,6 @@ class Ipxe_AuthController extends Zend_Controller_Action exit; } - if(!isset($_SERVER['PHP_AUTH_USER']) || !isset($_SERVER['PHP_AUTH_PW'])){ - header('WWW-Authenticate: Basic realm=""'); - header('HTTP/1.0 401 Unauthorized'); - $result = "#!ipxe\n"; - $result .= "imgfree\n"; - $result .= "module http://".$_SERVER['HTTP_HOST']."/ipxe/auth/login/alpha/".$alpha."/error/login\n"; - header("Content-Length: ".(strlen($result))); - echo $result; - exit; - } $email = $_SERVER['PHP_AUTH_USER']; $password = $_SERVER['PHP_AUTH_PW']; -- cgit v1.2.3-55-g7522