Some bugs corrected
This commit is contained in:
parent
ae63cec198
commit
2762f0fdb3
|
@ -43,7 +43,6 @@ function display_LoginPage($config_object)
|
||||||
$_SESSION["language"] = $config_object->get_defaultLanguage();
|
$_SESSION["language"] = $config_object->get_defaultLanguage();
|
||||||
|
|
||||||
// loading available languages from language.conf file
|
// loading available languages from language.conf file
|
||||||
|
|
||||||
$languagefile = "../config/language.conf";
|
$languagefile = "../config/language.conf";
|
||||||
if(is_file($languagefile) == True)
|
if(is_file($languagefile) == True)
|
||||||
{
|
{
|
||||||
|
@ -87,7 +86,7 @@ function display_LoginPage($config_object)
|
||||||
<link rel=\"stylesheet\" type=\"text/css\" href=\"../style/layout.css\">
|
<link rel=\"stylesheet\" type=\"text/css\" href=\"../style/layout.css\">
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<p align=\"center\"><img src=\"../graphics/banner.jpg\" border=\"1\"></p>
|
<p align=\"center\"><a href=\"http://lam.sf.net\" target=\"_blank\"><img src=\"../graphics/banner.jpg\" border=\"1\"></a></p>
|
||||||
<table width=\"100%\" border=\"0\">
|
<table width=\"100%\" border=\"0\">
|
||||||
<tr>
|
<tr>
|
||||||
<td width=\"100%\" align=\"right\">
|
<td width=\"100%\" align=\"right\">
|
||||||
|
@ -99,7 +98,7 @@ function display_LoginPage($config_object)
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
<hr><br><br>
|
<hr><br><br>
|
||||||
<b><p align=\"center\">";
|
<p align=\"center\"><b>";
|
||||||
echo _("Enter Username and Password for Account:");
|
echo _("Enter Username and Password for Account:");
|
||||||
echo "
|
echo "
|
||||||
</b></p>";
|
</b></p>";
|
||||||
|
@ -186,19 +185,11 @@ function display_LoginPage($config_object)
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
<br><br><br>
|
<br><br><br>
|
||||||
<table width=\"310\" align=\"center\" bgcolor=\"#C7E7C7\" border=\"0\">
|
<table width=\"345\" align=\"center\" bgcolor=\"#C7E7C7\" border=\"0\">
|
||||||
<tr>
|
<tr>
|
||||||
<td width=\"100%\" align=\"center\">";
|
<td width=\"100%\" align=\"center\">";
|
||||||
echo _("You are connecting to the server specified below:");
|
echo _("You are connecting to ServerURL: ");
|
||||||
echo "
|
echo " <b>";
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><br></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td width=\"100%\" align=\"center\">
|
|
||||||
ServerURL: <b>";
|
|
||||||
echo $config_object->get_ServerURL();
|
echo $config_object->get_ServerURL();
|
||||||
echo "
|
echo "
|
||||||
</b></td>
|
</b></td>
|
||||||
|
@ -215,25 +206,33 @@ 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($_SESSION['config']); //$config); // Create new Ldap object
|
$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($_POST['passwd'] == "")
|
||||||
if($result == True) // Username/password correct. Do some configuration and load main frame.
|
|
||||||
{
|
{
|
||||||
$_SESSION["language"] = $_POST["language"]; // Write selected language in session
|
$error_message = _("Empty Password submitted. Try again.");
|
||||||
session_register("ldap"); // Register $ldap object in session
|
display_LoginPage($_SESSION['config']); // Empty password submitted. Return to login page.
|
||||||
|
|
||||||
include("./main.php"); // Load main frame
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if($ldap->server)
|
$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.
|
||||||
{
|
{
|
||||||
$error_message = _("Wrong Password/Username combination. Try again.");
|
$_SESSION["language"] = $_POST["language"]; // Write selected language in session
|
||||||
display_LoginPage($_SESSION['config']); // Username/password invalid. Return to login page.
|
session_register("ldap"); // Register $ldap object in session
|
||||||
|
|
||||||
|
include("./main.php"); // Load main frame
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$error_message = _("Cannot connect to specified LDAP-Server. Try again.");
|
if($ldap->server)
|
||||||
display_LoginPage($_SESSION['config']); // Username/password invalid. Return to login page.
|
{
|
||||||
|
$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.
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue