PHP 클래스 AuthLDAP, glpi

상속: extends AuthPluginBase
파일 보기 프로젝트 열기: glpi-project/glpi 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$dohistory From CommonDBTM
$rightname

공개 메소드들

메소드 설명
addTimestampRestrictions ( $begin_date, $end_date )
canCreate ( )
canPurge ( )
cleanDBonPurge ( )
connect ( ) Open LDAP connexion to current serveur
connectToServer ( $host, $port, $login = "", $password = "", $use_tls = false, $deref_options ) : link Connect to a LDAP serveur
date2ldapTimeStamp ( $date ) : ldap Converts a Unix timestamp to an LDAP timestamps
defineTabs ( $options = [] )
displayLdapFilter ( $target, $users = true ) : nothing Display LDAP filter
displaySizeLimitWarning ( $limitexceeded = false )
displayTabContentForItem ( CommonGLPI $item, $tabnum = 1, $withtemplate )
dnExistsInLdap ( $ldap_infos, $user_dn ) : false Check if a user DN exists in a ldap user search result
dropdownGroupSearchType ( array $options )
dropdownUserDeletedActions ( $value )
getAllGroups ( $auths_id, $filter, $filter2, $entity, &$limitexceeded, $order = 'DESC' ) : array Get all LDAP groups from a ldap server which are not already in an entity
getAllReplicateForAMaster ( $master_id ) : array Get all replicate servers for a master one
getAllUsers ( $options = [], &$results, &$limitexceeded ) : array Get the list of LDAP users to add/synchronize
getDefault ( )
getGroupByDn ( $ds, $group_dn ) : group Get infos for groups
getGroupCNByDn ( $ldap_connection, $group_dn ) : the Get the group's cn by giving his DN
getGroupSearchTypeName ( $val = NULL ) : array Get the possible value for contract alert
getGroupsFromLDAP ( $ldap_connection, $config_ldap, $filter, $search_in_groups = true, $groups = [], &$limitexceeded )
getLdapServers ( )
getNumberOfServers ( )
getObjectByDn ( $ds, $condition, $dn, $attrs = [], $clean = true ) Get an object from LDAP by giving his DN
getSearchOptions ( )
getServersWithImportByEmailActive ( ) : array Return all the ldap servers where email field is configured
getSpecificValueToDisplay ( $field, $values, array $options = [] )
getSpecificValueToSelect ( $field, $name = '', $values = '', array $options = [] )
getSyncFields ( array $authtype_array ) : array Get LDAP fields to sync to GLPI data from a glpi_authldaps array
getTabNameForItem ( CommonGLPI $item, $withtemplate )
getTypeName ( $nb )
getUserByDn ( $ds, $user_dn, $attrs, $clean = true )
get_entries_clean ( $link, $result ) : an Get ldap query results and clean them at the same time
importUserFromServers ( $options = [] ) Import a user from ldap Check all the directories. When the user is found, then import it
isLdapPageSizeAvailable ( $config_ldap, $check_config_value = true ) Check if ldap results can be paged or not This functionnality is available for PHP 5.4 and higer
ldapAuth ( $auth, $login, $password, $ldap_method, $user_dn ) : identification Authentify a user by checking a specific directory
ldapChooseDirectory ( $target ) : nothing Form to choose a ldap server
ldapImportGroup ( $group_dn, $options = [] ) : nothing Converts an array of parameters into a query string to be appended to a URL.
ldapImportUserByServerId ( $params = [], $action, $ldap_server, $display = false ) : array Import a user from a specific ldap server
ldapStamp2UnixStamp ( $ldapstamp, $ldap_time_offset ) : unix Converts LDAP timestamps over to Unix timestamps
local_cmp ( $a, $b )
manageValuesInSession ( $options = [], $delete = false )
post_addItem ( )
post_getEmpty ( )
post_updateItem ( $history = 1 )
preconfig ( $type ) : nothing Preconfig datas for standard system
prepareInputForAdd ( $input )
prepareInputForUpdate ( $input )
processMassiveActionsForOneItemtype ( MassiveAction $ma, CommonDBTM $item, array $ids )
searchForUsers ( $ds, $values, $filter, $attrs, &$limitexceeded, &$user_infos, &$ldap_users, $config_ldap )
searchUser ( AuthLDAP $authldap )
searchUserDn ( $ds, $options = [] ) : dn Get dn for a user
showDateRestrictionForm ( $options = [] )
showForm ( $ID, $options = [] ) : Nothing Print the auth ldap form
showFormAdvancedConfig ( )
showFormEntityConfig ( )
showFormGroupsConfig ( )
showFormReplicatesConfig ( )
showFormTestLDAP ( )
showFormUserConfig ( )
showLdapGroups ( $target, $start, $sync, $filter = '', $filter2 = '', $entity, $order = 'DESC' ) : nothing Show LDAP groups to add or synchronise in an entity
showLdapUsers ( ) : nothing Show LDAP users to add or synchronise
showSystemInformations ( $width )
showUserImportForm ( AuthLDAP $authldap )
testLDAPConnection ( $auths_id, $replicate_id ) : boolean Test a LDAP connection
tryLdapAuth ( $auth, $login, $password, $auths_id, $user_dn = false, $break = true ) : identification Try to authentify a user by checking all the directories
tryToConnectToServer ( $ldap_method, $login, $password ) : link Try to connect to a ldap server
unsetUndisclosedFields ( &$fields )
useAuthLdap ( ) : boolean Is the LDAP authentication used ?

비공개 메소드들

메소드 설명
buildLdapFilter ( AuthLdap $authldap )

메소드 상세

addTimestampRestrictions() 정적인 공개 메소드

static public addTimestampRestrictions ( $begin_date, $end_date )
$begin_date datetime begin date to search (NULL if not take into account)
$end_date datetime end date to search (NULL if not take into account)

canCreate() 정적인 공개 메소드

static public canCreate ( )

canPurge() 정적인 공개 메소드

static public canPurge ( )

cleanDBonPurge() 공개 메소드

public cleanDBonPurge ( )

connect() 공개 메소드

Open LDAP connexion to current serveur
public connect ( )

connectToServer() 정적인 공개 메소드

Connect to a LDAP serveur
static public connectToServer ( $host, $port, $login = "", $password = "", $use_tls = false, $deref_options ) : link
$host LDAP host to connect
$port port to use
$login login to use (default '')
$password password to use (default '')
$use_tls use a tls connection ? (false by default)
$deref_options deref options used
리턴 link to the LDAP server : false if connection failed

date2ldapTimeStamp() 정적인 공개 메소드

Converts a Unix timestamp to an LDAP timestamps
static public date2ldapTimeStamp ( $date ) : ldap
$date datetime
리턴 ldap timestamp

defineTabs() 공개 메소드

public defineTabs ( $options = [] )

displayLdapFilter() 정적인 공개 메소드

Display LDAP filter
static public displayLdapFilter ( $target, $users = true ) : nothing
$target target for the form
$users boolean for user ? (true by default)
리턴 nothing

displaySizeLimitWarning() 정적인 공개 메소드

static public displaySizeLimitWarning ( $limitexceeded = false )
$limitexceeded (false by default)

displayTabContentForItem() 정적인 공개 메소드

static public displayTabContentForItem ( CommonGLPI $item, $tabnum = 1, $withtemplate )
$item CommonGLPI

dnExistsInLdap() 정적인 공개 메소드

Check if a user DN exists in a ldap user search result
static public dnExistsInLdap ( $ldap_infos, $user_dn ) : false
$ldap_infos ldap user search result
$user_dn user dn to look for
리턴 false if the user dn doesn't exist, user ldap infos otherwise

dropdownGroupSearchType() 정적인 공개 메소드

static public dropdownGroupSearchType ( array $options )
$options array array

dropdownUserDeletedActions() 정적인 공개 메소드

static public dropdownUserDeletedActions ( $value )
$value (default 0)

getAllGroups() 정적인 공개 메소드

Get all LDAP groups from a ldap server which are not already in an entity
static public getAllGroups ( $auths_id, $filter, $filter2, $entity, &$limitexceeded, $order = 'DESC' ) : array
$auths_id ID of the server to use
$filter ldap filter to use
$filter2 second ldap filter to use if needed
$entity entity to search
$limitexceeded
$order order to use (default DESC)
리턴 array of the groups

getAllReplicateForAMaster() 정적인 공개 메소드

Get all replicate servers for a master one
static public getAllReplicateForAMaster ( $master_id ) : array
$master_id : master ldap server ID
리턴 array of the replicate servers

getAllUsers() 정적인 공개 메소드

Get the list of LDAP users to add/synchronize
static public getAllUsers ( $options = [], &$results, &$limitexceeded ) : array
$options array of possible options: - authldaps_id ID of the server to use - mode user to synchronise or add ? - ldap_filter ldap filter to use - basedn force basedn (default authldaps_id one) - order display order - begin_date begin date to time limit - end_date end date to time limit - script true if called by an external script
리턴 array of the user

getDefault() 정적인 공개 메소드

static public getDefault ( )

getGroupByDn() 정적인 공개 메소드

Get infos for groups
static public getGroupByDn ( $ds, $group_dn ) : group
$ds LDAP link
$group_dn dn of the group
리턴 group infos if found, else false

getGroupCNByDn() 정적인 공개 메소드

Get the group's cn by giving his DN
static public getGroupCNByDn ( $ldap_connection, $group_dn ) : the
$ldap_connection ldap connection to use
$group_dn the group's dn
리턴 the group cn

getGroupSearchTypeName() 정적인 공개 메소드

Get the possible value for contract alert
static public getGroupSearchTypeName ( $val = NULL ) : array
$val if not set, ask for all values, else for 1 value (default NULL)
리턴 array or string

getGroupsFromLDAP() 정적인 공개 메소드

static public getGroupsFromLDAP ( $ldap_connection, $config_ldap, $filter, $search_in_groups = true, $groups = [], &$limitexceeded )
$ldap_connection
$config_ldap
$filter
$search_in_groups (true by default)
$groups array
$limitexceeded

getLdapServers() 정적인 공개 메소드

static public getLdapServers ( )

getNumberOfServers() 정적인 공개 메소드

static public getNumberOfServers ( )

getObjectByDn() 정적인 공개 메소드

Get an object from LDAP by giving his DN
static public getObjectByDn ( $ds, $condition, $dn, $attrs = [], $clean = true )
$dn string DN of the object
$clean (true by default)

getSearchOptions() 공개 메소드

public getSearchOptions ( )

getServersWithImportByEmailActive() 정적인 공개 메소드

Return all the ldap servers where email field is configured
static public getServersWithImportByEmailActive ( ) : array
리턴 array of LDAP server's ID

getSpecificValueToDisplay() 정적인 공개 메소드

static public getSpecificValueToDisplay ( $field, $values, array $options = [] )
$field
$values
$options array array

getSpecificValueToSelect() 정적인 공개 메소드

static public getSpecificValueToSelect ( $field, $name = '', $values = '', array $options = [] )
$field
$name (default '')
$values (default('')
$options array array

getSyncFields() 정적인 공개 메소드

Get LDAP fields to sync to GLPI data from a glpi_authldaps array
static public getSyncFields ( array $authtype_array ) : array
$authtype_array array array Authentication method config array (from table)
리턴 array of "user table field name" => "config value"

getTabNameForItem() 공개 메소드

public getTabNameForItem ( CommonGLPI $item, $withtemplate )
$item CommonGLPI

getTypeName() 정적인 공개 메소드

static public getTypeName ( $nb )

getUserByDn() 정적인 공개 메소드

static public getUserByDn ( $ds, $user_dn, $attrs, $clean = true )
$ds
$user_dn
$attrs
$clean (true by default)

get_entries_clean() 정적인 공개 메소드

Get ldap query results and clean them at the same time
static public get_entries_clean ( $link, $result ) : an
리턴 an array which contains ldap query results

importUserFromServers() 정적인 공개 메소드

Import a user from ldap Check all the directories. When the user is found, then import it
static public importUserFromServers ( $options = [] )
$options array containing condition: array('name'=>'glpi') or array('email' => 'test at test.com')

isLdapPageSizeAvailable() 정적인 공개 메소드

Check if ldap results can be paged or not This functionnality is available for PHP 5.4 and higer
부터: 0.84 return true if maxPageSize can be used, false otherwise
static public isLdapPageSizeAvailable ( $config_ldap, $check_config_value = true )

ldapAuth() 정적인 공개 메소드

Authentify a user by checking a specific directory
static public ldapAuth ( $auth, $login, $password, $ldap_method, $user_dn ) : identification
$auth identification object
$login user login
$password user password
$ldap_method ldap_method array to use
$user_dn user LDAP DN if present
리턴 identification object

ldapChooseDirectory() 정적인 공개 메소드

Form to choose a ldap server
static public ldapChooseDirectory ( $target ) : nothing
$target target page for the form
리턴 nothing

ldapImportGroup() 정적인 공개 메소드

Converts an array of parameters into a query string to be appended to a URL.
static public ldapImportGroup ( $group_dn, $options = [] ) : nothing
$group_dn dn of the group to import
$options array for - authldaps_id - entities_id where group must to be imported - is_recursive
리턴 nothing

ldapImportUserByServerId() 정적인 공개 메소드

Import a user from a specific ldap server
static public ldapImportUserByServerId ( $params = [], $action, $ldap_server, $display = false ) : array
$params array of parameters: method (IDENTIFIER_LOGIN or IDENTIFIER_EMAIL) + value
$action synchoronize (true) or import (false)
$ldap_server ID of the LDAP server to use
$display display message information on redirect (false by default)
리턴 array with state, else false

ldapStamp2UnixStamp() 정적인 공개 메소드

Converts LDAP timestamps over to Unix timestamps
static public ldapStamp2UnixStamp ( $ldapstamp, $ldap_time_offset ) : unix
$ldapstamp LDAP timestamp
$ldap_time_offset time offset (default 0)
리턴 unix timestamp

local_cmp() 공개 메소드

public local_cmp ( $a, $b )

manageValuesInSession() 정적인 공개 메소드

static public manageValuesInSession ( $options = [], $delete = false )
$options array
$delete (false by default)

post_addItem() 공개 메소드

public post_addItem ( )

post_getEmpty() 공개 메소드

public post_getEmpty ( )

post_updateItem() 공개 메소드

public post_updateItem ( $history = 1 )

preconfig() 공개 메소드

Preconfig datas for standard system
public preconfig ( $type ) : nothing
$type type of standard system : AD
리턴 nothing

prepareInputForAdd() 공개 메소드

public prepareInputForAdd ( $input )

prepareInputForUpdate() 공개 메소드

public prepareInputForUpdate ( $input )

processMassiveActionsForOneItemtype() 정적인 공개 메소드

또한 보기: CommonDBTM::processMassiveActionsForOneItemtype()
static public processMassiveActionsForOneItemtype ( MassiveAction $ma, CommonDBTM $item, array $ids )
$ma MassiveAction
$item CommonDBTM
$ids array

searchForUsers() 정적인 공개 메소드

static public searchForUsers ( $ds, $values, $filter, $attrs, &$limitexceeded, &$user_infos, &$ldap_users, $config_ldap )

searchUser() 정적인 공개 메소드

static public searchUser ( AuthLDAP $authldap )
$authldap AuthLDAP AuthLDAP object

searchUserDn() 정적인 공개 메소드

Get dn for a user
static public searchUserDn ( $ds, $options = [] ) : dn
$ds LDAP link
$options array of possible options: - basedn : base dn used to search - login_field : attribute to store login - search_parameters array of search parameters - user_params array of parameters : method (IDENTIFIER_LOGIN or IDENTIFIER_EMAIL) + value - condition : ldap condition used
리턴 dn of the user, else false

showDateRestrictionForm() 정적인 공개 메소드

static public showDateRestrictionForm ( $options = [] )
$options array

showForm() 공개 메소드

Print the auth ldap form
public showForm ( $ID, $options = [] ) : Nothing
$ID integer ID of the item
$options array - target for the form
리턴 Nothing (display)

showFormAdvancedConfig() 공개 메소드

showFormEntityConfig() 공개 메소드

showFormGroupsConfig() 공개 메소드

showFormReplicatesConfig() 공개 메소드

showFormTestLDAP() 공개 메소드

public showFormTestLDAP ( )

showFormUserConfig() 공개 메소드

public showFormUserConfig ( )

showLdapGroups() 정적인 공개 메소드

Show LDAP groups to add or synchronise in an entity
static public showLdapGroups ( $target, $start, $sync, $filter = '', $filter2 = '', $entity, $order = 'DESC' ) : nothing
$target target page for the form
$start where to start the list
$sync synchronise or add ? (default 0)
$filter ldap filter to use (default '')
$filter2 second ldap filter to use (which case ?) (default '')
$entity working entity
$order display order (default DESC)
리턴 nothing

showLdapUsers() 정적인 공개 메소드

Show LDAP users to add or synchronise
static public showLdapUsers ( ) : nothing
리턴 nothing

showSystemInformations() 공개 메소드

public showSystemInformations ( $width )
$width

showUserImportForm() 정적인 공개 메소드

static public showUserImportForm ( AuthLDAP $authldap )
$authldap AuthLDAP AuthLDAP object

testLDAPConnection() 정적인 공개 메소드

Test a LDAP connection
static public testLDAPConnection ( $auths_id, $replicate_id ) : boolean
$auths_id ID of the LDAP server
$replicate_id use a replicate if > 0 (default -1)
리턴 boolean connection succeeded ?

tryLdapAuth() 정적인 공개 메소드

Try to authentify a user by checking all the directories
static public tryLdapAuth ( $auth, $login, $password, $auths_id, $user_dn = false, $break = true ) : identification
$auth identification object
$login user login
$password user password
$auths_id auths_id already used for the user (default 0)
$user_dn user LDAP DN if present (false by default)
$break if user is not found in the first directory, stop searching or try the following ones (true by default)
리턴 identification object

tryToConnectToServer() 정적인 공개 메소드

Try to connect to a ldap server
static public tryToConnectToServer ( $ldap_method, $login, $password ) : link
$ldap_method ldap_method array to use
$login User Login
$password User Password
리턴 link to the LDAP server : false if connection failed

unsetUndisclosedFields() 공개 정적인 메소드

public static unsetUndisclosedFields ( &$fields )

useAuthLdap() 정적인 공개 메소드

Is the LDAP authentication used ?
static public useAuthLdap ( ) : boolean
리턴 boolean

프로퍼티 상세

$dohistory 공개적으로 프로퍼티

From CommonDBTM
public $dohistory

$rightname 정적으로 공개적으로 프로퍼티

static public $rightname