connection errors are handled by login.php

This commit is contained in:
Roland Gruber 2003-03-16 10:32:45 +00:00
parent 5f662c7d6f
commit 60c2e7db96
1 changed files with 3 additions and 11 deletions

View File

@ -95,22 +95,14 @@ class Ldap{
echo _("No username was specified!");
exit;
}
if ($this->conf->get_SSL() == "True") $this->server = ldap_connect("ldaps://" . $this->conf->get_Host(), $this->conf->get_Port());
else $this->server = ldap_connect("ldap://" . $this->conf->get_Host(), $this->conf->get_Port());
if ($this->conf->get_SSL() == "True") $this->server = @ldap_connect("ldaps://" . $this->conf->get_Host(), $this->conf->get_Port());
else $this->server = @ldap_connect("ldap://" . $this->conf->get_Host(), $this->conf->get_Port());
if ($this->server) {
$bind = ldap_bind($this->server, $user, $passwd);
$bind = @ldap_bind($this->server, $user, $passwd);
if ($bind) {
// return server handle
return $this->server;
}
else {
echo _("Unable to bind to Server!");
exit;
}
}
else {
echo _("Unable to connect to Server!");
exit;
}
}