diff --git a/lam/templates/login.php b/lam/templates/login.php index 83b5022c..309d4cdf 100644 --- a/lam/templates/login.php +++ b/lam/templates/login.php @@ -230,7 +230,8 @@ if($_POST['action'] == "checklogin") { include_once("../lib/ldap.inc"); // Include ldap.php which provides Ldap class - $ldap = new Ldap($_SESSION['config']); //$config); // Create new Ldap object + session_register("ldap"); // Register $ldap object in session + $_SESSION['ldap'] = new Ldap($_SESSION['config']); //$config); // Create new Ldap object if($_POST['passwd'] == "") { $error_message = _("Empty Password submitted. Try again."); @@ -238,14 +239,13 @@ if($_POST['action'] == "checklogin") } else { - $result = $ldap->connect($_POST['username'],$_POST['passwd']); // Connect to LDAP server for verifing username/password + $result = $_SESSION['ldap']->connect($_POST['username'],$_POST['passwd']); // Connect to LDAP server for verifing username/password if($result == True) // Username/password correct. Do some configuration and load main frame. { $_SESSION['language'] = $_POST['language']; // Write selected language in session $language = explode(":",$_SESSION['language']); $_SESSION['header'] = "\n\n\n"; - session_register("ldap"); // Register $ldap object in session include("./main.php"); // Load main frame }