"; echo _("Configuration Login"); echo "



"; echo _("Enter Username and Password for Account:"); echo "

"; if($error_message != "") { echo "

"; echo _($error_message); echo "

"; } echo "
"; if($message != "") { echo " "; } else { echo " "; } echo "
"; echo _("Username:"); echo "
"; echo _("Password:"); echo "
"; echo _($message); echo " "; echo _("Your Language:"); echo "
"; echo "



"; echo _("You are connecting to the server specified below:"); echo "

ServerURL: "; echo $config_object->get_ServerURL(); echo "
"; } // checking if the submitted username/password is correct. 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 $result = $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. { // setting language $language = explode(":", $language); putenv("LANG=" . $language[1]); setlocale(LC_ALL, $language[0]); bindtextdomain("lam", "../locale"); textdomain("lam"); include("./main.php"); // Load main frame session_register("ldap"); // Register $ldap object in session session_register("language"); // Register $language in session } else { if($ldap->server) { $error_message = _("Wrong Password/Username combination. Try again."); display_LoginPage($_SESSION['config']); // Username/password invalid. Return to login page. } else { $error_message = _("Cannot connect to specified LDAP-Server. Try again."); display_LoginPage($_SESSION['config']); // Username/password invalid. Return to login page. } } } // Load login page else { session_register("config"); // Register $config object in session $config = new Config; // Create new Config object display_LoginPage($config); // Load Login page } ?>