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)
|
||||
function Ldap($config) {
|
||||
if (is_object($config)) $this->conf = $config;
|
||||
else { echo _("Ldap->Ldap failed!"); exit;}
|
||||
else return false;
|
||||
// construct arrays with known LDAP attributes
|
||||
$this->ldapUserAttributes = array (
|
||||
"uid" => _("User ID"),
|
||||
"uidNumber" => _("UID Number"),
|
||||
"gidNumber" => _("GID Number"),
|
||||
"cn" => _("User Name"),
|
||||
"host" => _("Allowed Hosts"),
|
||||
"givenName" => _("First Name"),
|
||||
"sn" => _("Last Name"),
|
||||
"homeDirectory" => _("Home Directory"),
|
||||
"loginShell" => _("Login Shell"),
|
||||
"uidNumber" => _("UID number"),
|
||||
"gidNumber" => _("GID number"),
|
||||
"cn" => _("Username"),
|
||||
"host" => _("Allowed hosts"),
|
||||
"givenName" => _("First name"),
|
||||
"sn" => _("Last name"),
|
||||
"homeDirectory" => _("Home directory"),
|
||||
"loginShell" => _("Login shell"),
|
||||
"mail" => _("E-Mail"),
|
||||
"gecos" => _("Description")
|
||||
);
|
||||
$this->ldapGroupAttributes = array (
|
||||
"cn" => _("Group Name"),
|
||||
"gidNumber" => _("GID Number"),
|
||||
"memberUID" => _("Group Members"),
|
||||
"member" => _("Group Member DNs"),
|
||||
"description" => _("Group Description")
|
||||
"cn" => _("Group name"),
|
||||
"gidNumber" => _("GID number"),
|
||||
"memberUID" => _("Group members"),
|
||||
"member" => _("Group member DNs"),
|
||||
"description" => _("Group description")
|
||||
);
|
||||
$this->ldapHostAttributes = array (
|
||||
"uid" => _("Host Username"),
|
||||
"cn" => _("Host Name"),
|
||||
"uid" => _("Host username"),
|
||||
"cn" => _("Host name"),
|
||||
"rid" => _("RID (Windows UID)"),
|
||||
"description" => _("Host Description")
|
||||
"description" => _("Host description")
|
||||
);
|
||||
return true;
|
||||
}
|
||||
|
||||
// connects to the server using the given username and password
|
||||
|
@ -85,15 +86,10 @@ class Ldap{
|
|||
@$this->close();
|
||||
// do not allow anonymous bind
|
||||
if ((!$user)||($user == "")||(!$passwd)) {
|
||||
echo ("<html><head><title></title>");
|
||||
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;
|
||||
return false;
|
||||
}
|
||||
// save password und username encrypted
|
||||
$this->encrypt($user, $passwd);
|
||||
|
||||
$this->server = @ldap_connect($this->conf->get_ServerURL());
|
||||
if ($this->server) {
|
||||
// use LDAPv3
|
||||
|
@ -108,7 +104,7 @@ class Ldap{
|
|||
|
||||
// closes connection to server
|
||||
function close() {
|
||||
ldap_close($this->server);
|
||||
if (isset($this->server)) ldap_close($this->server);
|
||||
}
|
||||
|
||||
// searches LDAP for a specific user name
|
||||
|
|
Loading…
Reference in New Issue