connect($username,$passwd); if($result == True) // Username/password correct. Doing some configuration and loading main Frame. { session_register(ldap); // Register $ldap object in session session_register(language); // Register $language in session // setting language $language = explode(":", $language); putenv("LANG=" . $language[1]); setlocale("LC_ALL", $language[0]); bindtextdomain("lam", "../locale"); textdomain("lam"); include("./main.php"); } else { 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 else { include("./login.inc"); } ?>