File ready for register_globals=off; File ready for translation.

This commit is contained in:
duergner 2003-05-03 15:47:42 +00:00
parent f147212d8c
commit da32dc499d
1 changed files with 7 additions and 16 deletions

View File

@ -25,16 +25,7 @@ $Id$
include_once("../lib/config.inc"); // Include config.inc which provides Config class include_once("../lib/config.inc"); // Include config.inc which provides Config class
// Get session save path session_save_path("../sess"); // Set session save path
$path = getcwd();
$path = explode("/", substr($path,1));
for($i = 0; $i < (count($path) - 1); $i++)
{
$session_save_path .= "/" . $path[$i];
}
$session_save_path .= "/sess";
session_save_path($session_save_path); // Set session save path
@session_start(); // Start LDAP Account Manager session @session_start(); // Start LDAP Account Manager session
function display_LoginPage($config_object) function display_LoginPage($config_object)
@ -67,7 +58,7 @@ function display_LoginPage($config_object)
} }
else else
{ {
$message = "Unable to load available languages. Setting English as default language. For further instructions please contact the Admin of this site."; $message = _("Unable to load available languages. Setting English as default language. For further instructions please contact the Admin of this site.");
} }
echo " echo "
@ -76,7 +67,7 @@ function display_LoginPage($config_object)
<head> <head>
<title> <title>
"; ";
echo _("LDAP Account Manager -Login-"); echo "LDAP Account Manager -Login-";
echo " echo "
</title> </title>
<link rel=\"stylesheet\" type=\"text/css\" href=\"../style/layout.css\"> <link rel=\"stylesheet\" type=\"text/css\" href=\"../style/layout.css\">
@ -198,11 +189,11 @@ function display_LoginPage($config_object)
} }
// checking if the submitted username/password is correct. // checking if the submitted username/password is correct.
if($action == "checklogin") if($_POST['action'] == "checklogin")
{ {
include_once("../lib/ldap.inc"); // Include ldap.php which provides Ldap class include_once("../lib/ldap.inc"); // Include ldap.php which provides Ldap class
$ldap = new Ldap($config); //$config); // Create new Ldap object $ldap = new Ldap($_SESSION['config']); //$config); // Create new Ldap object
$result = $ldap->connect($username,$passwd); // Connect to LDAP server for verifing username/password $result = $ldap->connect($username,$passwd); // Connect to LDAP server for verifing username/password
if($result == True) // Username/password correct. Do some configuration and load main frame. if($result == True) // Username/password correct. Do some configuration and load main frame.
{ {
@ -221,12 +212,12 @@ if($action == "checklogin")
{ {
if($ldap->server) if($ldap->server)
{ {
$error_message = "Wrong Password/Username combination. Try again."; $error_message = _("Wrong Password/Username combination. Try again.");
display_LoginPage($config); // Username/password invalid. Return to login page. display_LoginPage($config); // Username/password invalid. Return to login page.
} }
else else
{ {
$error_message = "Cannot connect to specified LDAP-Server. Try again."; $error_message = _("Cannot connect to specified LDAP-Server. Try again.");
display_LoginPage($config); // Username/password invalid. Return to login page. display_LoginPage($config); // Username/password invalid. Return to login page.
} }
} }