Umfragen
LDAPauth Class Reference
Inheritance diagram for LDAPauth:
auth

Public Member Functions

 __construct ($server, $port, $root_dn, $username="", $password="")
 connects the object to authentification
 auth ($user, $pass)
 authentificates a user and sets some public variables
 info ($user)
 gets an array of informations about a user
 info_ID ($ID)
 gets an array of informations about a user
 get_all_groups ($whitelist=array())
 gets a list of all groups
 get_all_users_from_grouplist ($groups)
 gets a list of users based on a group list
 get_all_users_from_projectlist ($projects)
 gets a list of users belonging to given projects
 get_gid_to_name_mapping ($whitelist=array())
 gets an mapping array from all groupIDs to groupNames
 get_projects_for_user ($user)
 a list of projects a certain user belongs to

Data Fields

 $userFullName
 users's full name
 $userName
 user's username
 $userGroupID
 user's group ID
 $userDN
 user's DN
 $userID
 user's user ID
 $projects = array()
 user's projects
 $success
 true if success, false if there is a critical error
 $reason
 the reason of the critical error
 $groups
 the group list the user is belonging to

Private Member Functions

 connect ()
 connects to the LDAP server and creates the connection object
 auto_connect ()
 connects if not connected to the ldap server
 get_user_info ($user)
 gets an array of informations about a user
 get_user_info_from_ID ($ID)
 gets an array of informations about a user
 search_for_userdn ($user)
 gets the LDAP DN for a username

Private Attributes

 $ds
 LDAP connection object.
 $server
 LDAP server string (eg. localhost)
 $port
 server port
 $root_dn
 the root DN of the LDAPtree

Detailed Description

Definition at line 90 of file auth.class.php.

Constructor & Destructor Documentation

__construct (   $server,
  $port,
  $location,
  $username = "",
  $password = "" 
)

connects the object to authentification

Parameters
string$serverserver string to connect to (eg. localhost)
string$portserver port to connect to
string$locationdatabase name or LDAP root DN to connect to
string$usernameusername to connect with
string$passwordusernames password
Returns
bool true

Implements auth.

Definition at line 108 of file auth.class.php.

Member Function Documentation

auth (   $user,
  $pass 
)

authentificates a user and sets some public variables

Parameters
string$useruser's username
string$passusers's password
Returns
bool true if authentificated else false

Implements auth.

Definition at line 251 of file auth.class.php.

auto_connect ( )
private

connects if not connected to the ldap server

Returns
LDAP connection Object

Definition at line 135 of file auth.class.php.

connect ( )
private

connects to the LDAP server and creates the connection object

Returns
LDAP connection Object

Definition at line 119 of file auth.class.php.

get_all_groups (   $whitelist = array())

gets a list of all groups

Parameters
array$whitelistwhitelisted groupnames
Returns
array alphabetical sorted with array where index 0 is the groupname and 1 the groupID

Implements auth.

Definition at line 323 of file auth.class.php.

get_all_users_from_grouplist (   $groups)

gets a list of users based on a group list

Parameters
array$groupsgroup names where to get the users from.
Returns
array of arrays indexed by userID

the userinfo arrays returned have following indexes: "fullName", "userName", "groupID", "userID", "givenName" and "surName"

Implements auth.

Definition at line 360 of file auth.class.php.

get_all_users_from_projectlist (   $projects)

gets a list of users belonging to given projects

Parameters
array$projectslist of groupIDs
Returns
array or array

the return array indexes are fullName, userName, groupID, userID, givenName, surName

Definition at line 409 of file auth.class.php.

get_gid_to_name_mapping (   $whitelist = array())

gets an mapping array from all groupIDs to groupNames

Parameters
array$whitelistof allowed groups
Returns
array of groupNames indexed by groupID

Implements auth.

Definition at line 466 of file auth.class.php.

get_projects_for_user (   $user)

a list of projects a certain user belongs to

Parameters
string$userusername
Returns
array of arrays

returns a 0-based indexed array of arrays where the index 0 is the groupName and 1 the groupID

Definition at line 482 of file auth.class.php.

get_user_info (   $user)
private

gets an array of informations about a user

Projects are given by 0-based array of arrays where index 0 is the groupname and 1 the groupID

Parameters
string$userthe username to search about
Returns
array of userinformation

the return array indexes are: "dn","fullName","userName","groupID","userID","projects"

Definition at line 154 of file auth.class.php.

get_user_info_from_ID (   $ID)
private

gets an array of informations about a user

Projects are given by 0-based array of arrays where index 0 is the groupname and 1 the groupID

Parameters
string$IDthe numeric user ID
Returns
array of userinformation

the return array indexes are: "dn","fullName","userName","groupID","userID","projects"

Definition at line 188 of file auth.class.php.

info (   $user)

gets an array of informations about a user

Parameters
string$userthe username to search about
Returns
array of userinformation

the return array indexes are: "fullName","userName","groupID","userID"

Implements auth.

Definition at line 287 of file auth.class.php.

info_ID (   $ID)

gets an array of informations about a user

Parameters
string$userthe username to search about
Returns
array of userinformation

the return array indexes are: "fullName","userName","groupID","userID"

Implements auth.

Definition at line 311 of file auth.class.php.

search_for_userdn (   $user)
private

gets the LDAP DN for a username

Parameters
string$userusername
Returns
bool true on success
Exceptions
whenthe username were not found

fills the following private attributes: userFullName, userName,userGroupID, userID, groups, userDN, userGivenName, userSurName

Definition at line 221 of file auth.class.php.

Field Documentation

$ds
private

LDAP connection object.

Definition at line 91 of file auth.class.php.

$groups

the group list the user is belonging to

Definition at line 105 of file auth.class.php.

$port
private

server port

Definition at line 93 of file auth.class.php.

$projects = array()

user's projects

Definition at line 101 of file auth.class.php.

$reason

the reason of the critical error

Definition at line 104 of file auth.class.php.

$root_dn
private

the root DN of the LDAPtree

Definition at line 94 of file auth.class.php.

$server
private

LDAP server string (eg. localhost)

Definition at line 92 of file auth.class.php.

$success

true if success, false if there is a critical error

Definition at line 103 of file auth.class.php.

$userDN

user's DN

Definition at line 99 of file auth.class.php.

$userFullName

users's full name

Definition at line 96 of file auth.class.php.

$userGroupID

user's group ID

Definition at line 98 of file auth.class.php.

$userID

user's user ID

Definition at line 100 of file auth.class.php.

$userName

user's username

Definition at line 97 of file auth.class.php.


The documentation for this class was generated from the following file: