translation update, minor fixes
This commit is contained in:
parent
00df6d3833
commit
301baa028a
|
@ -47,34 +47,35 @@ class Ldap{
|
||||||
// $config has to be an object of Config (../config/config.php)
|
// $config has to be an object of Config (../config/config.php)
|
||||||
function Ldap($config) {
|
function Ldap($config) {
|
||||||
if (is_object($config)) $this->conf = $config;
|
if (is_object($config)) $this->conf = $config;
|
||||||
else { echo _("Ldap->Ldap failed!"); exit;}
|
else return false;
|
||||||
// construct arrays with known LDAP attributes
|
// construct arrays with known LDAP attributes
|
||||||
$this->ldapUserAttributes = array (
|
$this->ldapUserAttributes = array (
|
||||||
"uid" => _("User ID"),
|
"uid" => _("User ID"),
|
||||||
"uidNumber" => _("UID Number"),
|
"uidNumber" => _("UID number"),
|
||||||
"gidNumber" => _("GID Number"),
|
"gidNumber" => _("GID number"),
|
||||||
"cn" => _("User Name"),
|
"cn" => _("Username"),
|
||||||
"host" => _("Allowed Hosts"),
|
"host" => _("Allowed hosts"),
|
||||||
"givenName" => _("First Name"),
|
"givenName" => _("First name"),
|
||||||
"sn" => _("Last Name"),
|
"sn" => _("Last name"),
|
||||||
"homeDirectory" => _("Home Directory"),
|
"homeDirectory" => _("Home directory"),
|
||||||
"loginShell" => _("Login Shell"),
|
"loginShell" => _("Login shell"),
|
||||||
"mail" => _("E-Mail"),
|
"mail" => _("E-Mail"),
|
||||||
"gecos" => _("Description")
|
"gecos" => _("Description")
|
||||||
);
|
);
|
||||||
$this->ldapGroupAttributes = array (
|
$this->ldapGroupAttributes = array (
|
||||||
"cn" => _("Group Name"),
|
"cn" => _("Group name"),
|
||||||
"gidNumber" => _("GID Number"),
|
"gidNumber" => _("GID number"),
|
||||||
"memberUID" => _("Group Members"),
|
"memberUID" => _("Group members"),
|
||||||
"member" => _("Group Member DNs"),
|
"member" => _("Group member DNs"),
|
||||||
"description" => _("Group Description")
|
"description" => _("Group description")
|
||||||
);
|
);
|
||||||
$this->ldapHostAttributes = array (
|
$this->ldapHostAttributes = array (
|
||||||
"uid" => _("Host Username"),
|
"uid" => _("Host username"),
|
||||||
"cn" => _("Host Name"),
|
"cn" => _("Host name"),
|
||||||
"rid" => _("RID (Windows UID)"),
|
"rid" => _("RID (Windows UID)"),
|
||||||
"description" => _("Host Description")
|
"description" => _("Host description")
|
||||||
);
|
);
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// connects to the server using the given username and password
|
// connects to the server using the given username and password
|
||||||
|
@ -85,15 +86,10 @@ class Ldap{
|
||||||
@$this->close();
|
@$this->close();
|
||||||
// do not allow anonymous bind
|
// do not allow anonymous bind
|
||||||
if ((!$user)||($user == "")||(!$passwd)) {
|
if ((!$user)||($user == "")||(!$passwd)) {
|
||||||
echo ("<html><head><title></title>");
|
return false;
|
||||||
echo ("<link rel=\"stylesheet\" type=\"text/css\" href=\"../style/layout.css\"></head><body>");
|
|
||||||
StatusMessage("ERROR", "", _("No username was specified or password is empty!"));
|
|
||||||
echo ("<br><br><a href=\"login.php\">" . _("Back to Login") . "</a></body></html>");
|
|
||||||
exit;
|
|
||||||
}
|
}
|
||||||
// save password und username encrypted
|
// save password und username encrypted
|
||||||
$this->encrypt($user, $passwd);
|
$this->encrypt($user, $passwd);
|
||||||
|
|
||||||
$this->server = @ldap_connect($this->conf->get_ServerURL());
|
$this->server = @ldap_connect($this->conf->get_ServerURL());
|
||||||
if ($this->server) {
|
if ($this->server) {
|
||||||
// use LDAPv3
|
// use LDAPv3
|
||||||
|
@ -108,7 +104,7 @@ class Ldap{
|
||||||
|
|
||||||
// closes connection to server
|
// closes connection to server
|
||||||
function close() {
|
function close() {
|
||||||
ldap_close($this->server);
|
if (isset($this->server)) ldap_close($this->server);
|
||||||
}
|
}
|
||||||
|
|
||||||
// searches LDAP for a specific user name
|
// searches LDAP for a specific user name
|
||||||
|
|
Loading…
Reference in New Issue