From 1dbcd26106d91a0ca024f00e33cbc7ab108cdc28 Mon Sep 17 00:00:00 2001 From: artem Date: Wed, 6 Aug 2008 11:45:12 +0000 Subject: - [DEV-144] fixes for HTTP auth method (Artem) git-svn-id: svn://svn.zabbix.com/trunk@5880 97f52cf1-0a1b-0410-bd0e-c28be96e8082 --- frontends/php/index.php | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'frontends/php/index.php') diff --git a/frontends/php/index.php b/frontends/php/index.php index 97da7afa..86972612 100644 --- a/frontends/php/index.php +++ b/frontends/php/index.php @@ -57,25 +57,23 @@ $config = select_config(); $authentication_type = $config['authentication_type']; - + if($authentication_type == ZBX_AUTH_HTTP){ - if(isset($_SERVER['PHP_AUTH_USER']) && !empty($_SERVER['PHP_AUTH_USER'])){ if(!isset($sessionid)) $_REQUEST['enter'] = 'Enter'; $_REQUEST['name'] = $_SERVER["PHP_AUTH_USER"]; -// $_REQUEST['password'] = $_SERVER["PHP_AUTH_PW"]; + $_REQUEST['password'] = 'zabbix';//$_SERVER["PHP_AUTH_PW"]; } else{ access_deny(); } } - + if(isset($_REQUEST['enter'])&&($_REQUEST['enter']=='Enter')){ $name = get_request('name',''); $passwd = get_request('password',''); - $password = md5($passwd); $sql = 'SELECT u.userid,u.attempt_failed, u.attempt_clock, u.attempt_ip '. @@ -88,10 +86,10 @@ // ' AND ('.time().'-attempt_clock)>'.ZBX_LOGIN_BLOCK.'))'; $login = $attempt = DBfetch(DBselect($sql)); - + if(($name!=ZBX_GUEST_USER) && zbx_empty($passwd)){ $login = $attempt = false; - } + } if($login){ if($login['attempt_failed'] >= ZBX_LOGIN_ATTEMPTS){ -- cgit