"; 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. { session_register('language'); // store selected language in session session_register("ldap"); // Register $ldap object in session session_register("language"); // Register $language in session include("./main.php"); // Load main frame } 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 } ?>