added arrays with known LDAP attributes

This commit is contained in:
Roland Gruber 2003-04-01 14:17:32 +00:00
parent cc756735cb
commit 9a2a7e5db6
1 changed files with 47 additions and 2 deletions

View File

@ -38,12 +38,42 @@ class Ldap{
// LDAP username and password used for bind // LDAP username and password used for bind
var $username; var $username;
var $password; var $password;
// Arrays that contain LDAP attributes and their descriptions which are translated
var $ldapUserAttributes;
var $ldapGroupAttributes;
var $ldapHostAttributes;
// constructor // constructor
// $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 { echo _("Ldap->Ldap failed!"); exit;}
// 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"),
"mail" => _("E-Mail"),
"gecos" => _("description")
);
$this->ldapGroupAttributes = array (
"cn" => _("Group Name"),
"gidNumber" => _("GID Number"),
"memberUID" => _("Group Members"),
"member" => _("Group Member DNs")
);
$this->ldapHostAttributes = array (
"UID" => _("Host Username"),
"cn" => _("Host Name"),
"rid" => _("Windows UID")
);
} }
// returns an array of strings with the DN entries of all users // returns an array of strings with the DN entries of all users
@ -172,7 +202,22 @@ class Ldap{
$this->password="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"; $this->password="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";
} }
// returns an array that contains LDAP attribute names and their description
function attributeUserArray() {
return $this->ldapUserAttributes;
}
// returns an array that contains LDAP attribute names and their description
function attributeGroupArray() {
return $this->ldapGroupAttributes;
}
// returns an array that contains LDAP attribute names and their description
function attributeHostArray() {
return $this->ldapHostAttributes;
}
} }
?> ?>