From 0667e8092d363413e27dda074bdbf3e342626a03 Mon Sep 17 00:00:00 2001 From: duergner Date: Sat, 15 Mar 2003 12:13:49 +0000 Subject: [PATCH] *** empty log message *** --- lam/templates/login.php | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/lam/templates/login.php b/lam/templates/login.php index aa691032..6fc69208 100644 --- a/lam/templates/login.php +++ b/lam/templates/login.php @@ -34,19 +34,22 @@ if($action == "checklogin") $config = new Config; $ldap = new Ldap($config); $result = $ldap->connect($username,$password); - if($result) + if($result == True) { include("./main.php"); // Username/password correct. Loading main Frame. } - elseif($result == "Unable to bind to Server!") + else { - $error_message = "Wrong Password/Username combination. Try again."; - include("./login.inc"); // Username/password invalid. Returning to Login page. - } - elseif($result == "Unable to connect to Server!") - { - $error_message = "Cannot connect to specified LDAP-Server. Try again."; - include("./login.inc"); // Server not reachable. Returning to Login page. + if($ldap->server) + { + $error_message = "Wrong Password/Username combination. Try again."; + include("./login.inc"); // Username/password invalid. Returning to Login page. + } + else + { + $error_message = "Cannot connect to specified LDAP-Server. Try again."; + include("./login.inc"); // Server not reachable. Returning to Login page. + } } } // Loading Login page