Collaboration diagram for ilLDAPServer:Public Member Functions | |
| __construct ($a_server_id=0) | |
| getServerId () | |
| toggleActive ($a_status) | |
| isActive () | |
| getUrl () | |
| setUrl ($a_url) | |
| getUrlString () | |
| doConnectionCheck () | |
| Check ldap connection and do a fallback to the next server if no connection is possible. | |
| getName () | |
| setName ($a_name) | |
| getVersion () | |
| setVersion ($a_version) | |
| getBaseDN () | |
| setBaseDN ($a_base_dn) | |
| isActiveReferrer () | |
| toggleReferrer ($a_status) | |
| isActiveTLS () | |
| toggleTLS ($a_status) | |
| getBindingType () | |
| setBindingType ($a_type) | |
| getBindUser () | |
| setBindUser ($a_user) | |
| getBindPassword () | |
| setBindPassword ($a_password) | |
| getSearchBase () | |
| setSearchBase ($a_search_base) | |
| getUserAttribute () | |
| setUserAttribute ($a_user_attr) | |
| getFilter () | |
| setFilter ($a_filter) | |
| getGroupDN () | |
| setGroupDN ($a_value) | |
| getGroupFilter () | |
| setGroupFilter ($a_value) | |
| getGroupMember () | |
| setGroupMember ($a_value) | |
| getGroupName () | |
| setGroupName ($a_value) | |
| getGroupNames () | |
| Get group names as array. | |
| getGroupAttribute () | |
| setGroupAttribute ($a_value) | |
| toggleMembershipOptional ($a_status) | |
| isMembershipOptional () | |
| setGroupUserFilter ($a_filter) | |
| getGroupUserFilter () | |
| enabledGroupMemberIsDN () | |
| enableGroupMemberIsDN ($a_value) | |
| setGroupScope ($a_value) | |
| getGroupScope () | |
| setUserScope ($a_value) | |
| getUserScope () | |
| enabledSyncOnLogin () | |
| enableSyncOnLogin ($a_value) | |
| enabledSyncPerCron () | |
| enableSyncPerCron ($a_value) | |
| setGlobalRole ($a_role) | |
| getRoleBindDN () | |
| setRoleBindDN ($a_value) | |
| getRoleBindPassword () | |
| setRoleBindPassword ($a_value) | |
| enabledRoleSynchronization () | |
| enableRoleSynchronization ($a_value) | |
| enableAccountMigration ($a_status) | |
| Enable account migration. | |
| isAccountMigrationEnabled () | |
| enabled account migration | |
| validate () | |
| Validate user input. | |
| create () | |
| update () | |
| toPearAuthArray () | |
| Creates an array of options compatible to PEAR Auth. | |
Static Public Member Functions | |
| static | _getActiveServerList () |
| Get active server list. | |
| static | _getCronServerIds () |
| Get list of acticve servers with option 'SyncCron'. | |
| static | _getRoleSyncServerIds () |
| Check whether there if there is an active server with option role_sync_active. | |
| static | _getPasswordServers () |
| Checks whether password synchronistation is enabled for an user. | |
| static | _getFirstActiveServer () |
| Get first active server. | |
| static | _getServerList () |
| Get list of all configured servers. | |
| static | _getFirstServer () |
Data Fields | |
| const | DEBUG = false |
| const | DEFAULT_VERSION = 3 |
Private Member Functions | |
| prepareFilter ($a_filter) | |
| Create brackets for filters if they do not exist. | |
| getPearAtributeArray () | |
| Get attribute array for pear auth data. | |
| read () | |
| Read server settings. | |
Private Attributes | |
| $server_id = null | |
| $fallback_urls = array() | |
Definition at line 44 of file class.ilLDAPServer.php.
| ilLDAPServer::__construct | ( | $ | a_server_id = 0 |
) |
| static ilLDAPServer::_getActiveServerList | ( | ) | [static] |
Get active server list.
Definition at line 68 of file class.ilLDAPServer.php.
References $res.
Referenced by ilAuthUtils::_getActiveAuthModes(), _getFirstActiveServer(), _getPasswordServers(), ilAuthUtils::_hasMultipleAuthenticationMethods(), ilAuthUtils::_isExternalAccountEnabled(), and ilObjAuthSettingsGUI::authSettingsObject().
{
global $ilDB;
$query = "SELECT server_id FROM ldap_server_settings ".
"WHERE active = 1 ".
"ORDER BY name ";
$res = $ilDB->query($query);
while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
{
$server_ids[] = $row->server_id;
}
return $server_ids ? $server_ids : array();
}
Here is the caller graph for this function:| static ilLDAPServer::_getCronServerIds | ( | ) | [static] |
Get list of acticve servers with option 'SyncCron'.
Definition at line 88 of file class.ilLDAPServer.php.
References $res.
Referenced by ilLDAPCronSynchronization::start().
{
global $ilDB;
$query = "SELECT server_id FROM ldap_server_settings ".
"WHERE active = 1 ".
"AND sync_per_cron = 1 ".
"ORDER BY name";
$res = $ilDB->query($query);
while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
{
$server_ids[] = $row->server_id;
}
return $server_ids ? $server_ids : array();
}
Here is the caller graph for this function:| static ilLDAPServer::_getFirstActiveServer | ( | ) | [static] |
Get first active server.
Definition at line 145 of file class.ilLDAPServer.php.
References _getActiveServerList().
Referenced by ilAuthUtils::_getMultipleAuthModeOptions(), ilLDAPSettingsGUI::addRoleAssignment(), ilAuthLDAP::initServer(), ilObjAuthSettingsGUI::loginInfoObject(), and ilAuthModeDetermination::read().
{
$servers = ilLDAPServer::_getActiveServerList();
if(count($servers))
{
return $servers[0];
}
return 0;
}
Here is the call graph for this function:
Here is the caller graph for this function:| static ilLDAPServer::_getFirstServer | ( | ) | [static] |
Definition at line 178 of file class.ilLDAPServer.php.
References _getServerList().
Referenced by ilLDAPSettingsGUI::initServer().
{
$servers = ilLDAPServer::_getServerList();
if(count($servers))
{
return $servers[0];
}
return 0;
}
Here is the call graph for this function:
Here is the caller graph for this function:| static ilLDAPServer::_getPasswordServers | ( | ) | [static] |
Checks whether password synchronistation is enabled for an user.
public
| int | user_id |
Definition at line 134 of file class.ilLDAPServer.php.
References _getActiveServerList().
{
return ilLDAPServer::_getActiveServerList();
}
Here is the call graph for this function:| static ilLDAPServer::_getRoleSyncServerIds | ( | ) | [static] |
Check whether there if there is an active server with option role_sync_active.
public
Definition at line 112 of file class.ilLDAPServer.php.
References $res.
Referenced by ilLDAPRoleGroupMapping::initServers().
{
global $ilDB;
$query = "SELECT server_id FROM ldap_server_settings ".
"WHERE active = 1 ".
"AND role_sync_active = 1 ";
$res = $ilDB->query($query);
while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
{
$server_ids[] = $row->server_id;
}
return $server_ids ? $server_ids : array();
}
Here is the caller graph for this function:| static ilLDAPServer::_getServerList | ( | ) | [static] |
Get list of all configured servers.
Definition at line 160 of file class.ilLDAPServer.php.
References $res.
Referenced by _getFirstServer(), and ilLDAPSettingsGUI::setSubTabs().
{
global $ilDB;
$query = "SELECT server_id FROM ldap_server_settings ORDER BY name";
$res = $ilDB->query($query);
while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
{
$server_ids[] = $row->server_id;
}
return $server_ids ? $server_ids : array();
}
Here is the caller graph for this function:| ilLDAPServer::create | ( | ) |
Definition at line 573 of file class.ilLDAPServer.php.
References enabledGroupMemberIsDN(), enabledRoleSynchronization(), enabledSyncOnLogin(), enabledSyncPerCron(), getBaseDN(), getBindingType(), getBindPassword(), getBindUser(), getFilter(), getGroupAttribute(), getGroupDN(), getGroupFilter(), getGroupMember(), getGroupName(), getGroupScope(), getGroupUserFilter(), getName(), getRoleBindDN(), getRoleBindPassword(), getSearchBase(), getUrlString(), getUserAttribute(), getUserScope(), getVersion(), isActive(), isActiveReferrer(), isActiveTLS(), and isMembershipOptional().
{
$query = "INSERT INTO ldap_server_settings SET ".
"active = ".$this->db->quote($this->isActive()).", ".
"name = ".$this->db->quote($this->getName()).", ".
"url = ".$this->db->quote($this->getUrlString()).", ".
"version = ".$this->db->quote($this->getVersion()).", ".
"base_dn = ".$this->db->quote($this->getBaseDN()).", ".
"referrals = ".$this->db->quote($this->isActiveReferrer()).", ".
"tls = ".$this->db->quote($this->isActiveTLS()).", ".
"bind_type = ".$this->db->quote($this->getBindingType()).", ".
"bind_user = ".$this->db->quote($this->getBindUser()).", ".
"bind_pass = ".$this->db->quote($this->getBindPassword()).", ".
"search_base = ".$this->db->quote($this->getSearchBase()).", ".
"user_scope = ".$this->db->quote($this->getUserScope()).", ".
"user_attribute = ".$this->db->quote($this->getUserAttribute()).", ".
"filter = ".$this->db->quote($this->getFilter())." ";
"group_dn = ".$this->db->quote($this->getGroupDN()).", ".
"group_scope = ".$this->db->quote($this->getGroupScope()).", ".
"group_filter = ".$this->db->quote($this->getGroupFilter()).", ".
"group_member = ".$this->db->quote($this->getGroupMember()).", ".
"group_memberisdn =".$this->db->quote((int) $this->enabledGroupMemberIsDN()).", ".
"group_name = ".$this->db->quote($this->getGroupName()).", ".
"group_attribute = ".$this->db->quote($this->getGroupAttribute()).", ".
"group_optional = ".$this->db->quote((int) $this->isMembershipOptional()).", ".
"group_user_filter = ".$this->db->quote($this->getGroupUserFilter()).", ".
"sync_on_login = ".$this->db->quote($this->enabledSyncOnLogin() ? 1 : 0).", ".
"sync_per_cron = ".$this->db->quote($this->enabledSyncPerCron() ? 1 : 0).", ".
"role_sync_active = ".$this->db->quote($this->enabledRoleSynchronization()).", ".
"role_bind_dn = ".$this->db->quote($this->getRoleBindDN()).", ".
"role_bind_pass = ".$this->db->quote($this->getRoleBindPassword())." ";
$this->db->query($query);
return $this->db->getLastInsertId();
}
Here is the call graph for this function:| ilLDAPServer::doConnectionCheck | ( | ) |
Check ldap connection and do a fallback to the next server if no connection is possible.
public
Definition at line 241 of file class.ilLDAPServer.php.
References $ilLog.
{
global $ilLog;
include_once('Services/LDAP/classes/class.ilLDAPQuery.php');
foreach(array_merge(array(0 => $this->url),$this->fallback_urls) as $url)
{
try
{
// Need to do a full bind, since openldap return valid connection links for invalid hosts
$query = new ilLDAPQuery($this,$url);
$query->bind();
$this->url = $url;
$ilLog->write(__METHOD__.': Using url: '.$url.'.');
return true;
}
catch(ilLDAPQueryException $exc)
{
$ilLog->write(__METHOD__.': Cannot connect to LDAP server: '.$url.'. Trying fallback...');
}
}
$ilLog->write(__METHOD__.': No valid LDAP server found.');
return false;
}
| ilLDAPServer::enableAccountMigration | ( | $ | a_status | ) |
Enable account migration.
public
| bool | status |
Definition at line 520 of file class.ilLDAPServer.php.
{
$this->account_migration = $a_status;
}
| ilLDAPServer::enabledGroupMemberIsDN | ( | ) |
Definition at line 444 of file class.ilLDAPServer.php.
Referenced by create(), toPearAuthArray(), and update().
{
return (bool) $this->memberisdn;
}
Here is the caller graph for this function:| ilLDAPServer::enabledRoleSynchronization | ( | ) |
Definition at line 504 of file class.ilLDAPServer.php.
Referenced by create(), and update().
{
return $this->role_sync_active;
}
Here is the caller graph for this function:| ilLDAPServer::enabledSyncOnLogin | ( | ) |
Definition at line 468 of file class.ilLDAPServer.php.
Referenced by create(), getPearAtributeArray(), update(), and validate().
{
return $this->sync_on_login;
}
Here is the caller graph for this function:| ilLDAPServer::enabledSyncPerCron | ( | ) |
Definition at line 476 of file class.ilLDAPServer.php.
Referenced by create(), update(), and validate().
{
return $this->sync_per_cron;
}
Here is the caller graph for this function:| ilLDAPServer::enableGroupMemberIsDN | ( | $ | a_value | ) |
Definition at line 448 of file class.ilLDAPServer.php.
Referenced by read().
{
$this->memberisdn = (bool) $a_value;
}
Here is the caller graph for this function:| ilLDAPServer::enableRoleSynchronization | ( | $ | a_value | ) |
Definition at line 508 of file class.ilLDAPServer.php.
Referenced by read().
{
$this->role_sync_active = $a_value;
}
Here is the caller graph for this function:| ilLDAPServer::enableSyncOnLogin | ( | $ | a_value | ) |
Definition at line 472 of file class.ilLDAPServer.php.
Referenced by read().
{
$this->sync_on_login = (int) $a_value;
}
Here is the caller graph for this function:| ilLDAPServer::enableSyncPerCron | ( | $ | a_value | ) |
Definition at line 480 of file class.ilLDAPServer.php.
Referenced by read().
{
$this->sync_per_cron = (int) $a_value;
}
Here is the caller graph for this function:| ilLDAPServer::getBaseDN | ( | ) |
Definition at line 284 of file class.ilLDAPServer.php.
Referenced by create(), toPearAuthArray(), update(), and validate().
{
return $this->base_dn;
}
Here is the caller graph for this function:| ilLDAPServer::getBindingType | ( | ) |
Definition at line 308 of file class.ilLDAPServer.php.
Referenced by create(), toPearAuthArray(), update(), and validate().
{
return $this->binding_type;
}
Here is the caller graph for this function:| ilLDAPServer::getBindPassword | ( | ) |
Definition at line 331 of file class.ilLDAPServer.php.
Referenced by create(), toPearAuthArray(), update(), and validate().
{
return $this->bind_password;
}
Here is the caller graph for this function:| ilLDAPServer::getBindUser | ( | ) |
Definition at line 323 of file class.ilLDAPServer.php.
Referenced by create(), toPearAuthArray(), update(), and validate().
{
return $this->bind_user;
}
Here is the caller graph for this function:| ilLDAPServer::getFilter | ( | ) |
Definition at line 355 of file class.ilLDAPServer.php.
References prepareFilter().
Referenced by create(), toPearAuthArray(), and update().
{
return $this->prepareFilter($this->filter);
}
Here is the call graph for this function:
Here is the caller graph for this function:| ilLDAPServer::getGroupAttribute | ( | ) |
Definition at line 418 of file class.ilLDAPServer.php.
Referenced by create(), toPearAuthArray(), and update().
{
return $this->group_attribute;
}
Here is the caller graph for this function:| ilLDAPServer::getGroupDN | ( | ) |
Definition at line 363 of file class.ilLDAPServer.php.
Referenced by create(), toPearAuthArray(), and update().
{
return $this->group_dn;
}
Here is the caller graph for this function:| ilLDAPServer::getGroupFilter | ( | ) |
Definition at line 371 of file class.ilLDAPServer.php.
References prepareFilter().
Referenced by create(), toPearAuthArray(), and update().
{
return $this->prepareFilter($this->group_filter);
}
Here is the call graph for this function:
Here is the caller graph for this function:| ilLDAPServer::getGroupMember | ( | ) |
Definition at line 379 of file class.ilLDAPServer.php.
Referenced by create(), toPearAuthArray(), and update().
{
return $this->group_member;
}
Here is the caller graph for this function:| ilLDAPServer::getGroupName | ( | ) |
Definition at line 387 of file class.ilLDAPServer.php.
Referenced by create(), getGroupNames(), toPearAuthArray(), and update().
{
return $this->group_name;
}
Here is the caller graph for this function:| ilLDAPServer::getGroupNames | ( | ) |
Get group names as array.
public
Definition at line 402 of file class.ilLDAPServer.php.
References getGroupName().
{
$names = explode(',',$this->getGroupName());
if(!is_array($names))
{
return array();
}
foreach($names as $name)
{
$new_names[] = trim($name);
}
return $new_names;
}
Here is the call graph for this function:| ilLDAPServer::getGroupScope | ( | ) |
Definition at line 456 of file class.ilLDAPServer.php.
Referenced by create(), toPearAuthArray(), and update().
{
return $this->group_scope;
}
Here is the caller graph for this function:| ilLDAPServer::getGroupUserFilter | ( | ) |
Definition at line 439 of file class.ilLDAPServer.php.
Referenced by create(), and update().
{
return $this->group_user_filter;
}
Here is the caller graph for this function:| ilLDAPServer::getName | ( | ) |
Definition at line 268 of file class.ilLDAPServer.php.
Referenced by create(), update(), and validate().
{
return $this->name;
}
Here is the caller graph for this function:| ilLDAPServer::getPearAtributeArray | ( | ) | [private] |
Get attribute array for pear auth data.
private
Definition at line 748 of file class.ilLDAPServer.php.
References ilLDAPRoleAssignments::_getDistinctAttributeNamesByServerId(), ilLDAPAttributeMapping::_getInstanceByServerId(), enabledSyncOnLogin(), getServerId(), and getUserAttribute().
Referenced by toPearAuthArray().
{
if($this->enabledSyncOnLogin())
{
include_once('Services/LDAP/classes/class.ilLDAPAttributeMapping.php');
include_once('Services/LDAP/classes/class.ilLDAPRoleAssignments.php');
$mapping = ilLDAPAttributeMapping::_getInstanceByServerId($this->getServerId());
return array_merge(array($this->getUserAttribute()),
$mapping->getFields(),
array('dn'),
ilLDAPRoleAssignments::_getDistinctAttributeNamesByServerId($this->getServerId()));
}
else
{
return array($this->getUserAttribute());
}
}
Here is the call graph for this function:
Here is the caller graph for this function:| ilLDAPServer::getRoleBindDN | ( | ) |
Definition at line 488 of file class.ilLDAPServer.php.
Referenced by create(), and update().
{
return $this->role_bind_dn;
}
Here is the caller graph for this function:| ilLDAPServer::getRoleBindPassword | ( | ) |
Definition at line 496 of file class.ilLDAPServer.php.
Referenced by create(), and update().
{
return $this->role_bind_pass;
}
Here is the caller graph for this function:| ilLDAPServer::getSearchBase | ( | ) |
Definition at line 339 of file class.ilLDAPServer.php.
Referenced by create(), toPearAuthArray(), and update().
{
return $this->search_base;
}
Here is the caller graph for this function:| ilLDAPServer::getServerId | ( | ) |
Definition at line 190 of file class.ilLDAPServer.php.
Referenced by ilLDAPRoleAssignments::_getInstanceByServer(), getPearAtributeArray(), and update().
{
return $this->server_id;
}
Here is the caller graph for this function:| ilLDAPServer::getUrl | ( | ) |
Definition at line 204 of file class.ilLDAPServer.php.
Referenced by ilLDAPQuery::__construct(), toPearAuthArray(), and validate().
{
return $this->url;
}
Here is the caller graph for this function:| ilLDAPServer::getUrlString | ( | ) |
Definition at line 229 of file class.ilLDAPServer.php.
Referenced by create(), and update().
{
return $this->url_string;
}
Here is the caller graph for this function:| ilLDAPServer::getUserAttribute | ( | ) |
Definition at line 347 of file class.ilLDAPServer.php.
Referenced by create(), getPearAtributeArray(), toPearAuthArray(), update(), and validate().
{
return $this->user_attribute;
}
Here is the caller graph for this function:| ilLDAPServer::getUserScope | ( | ) |
Definition at line 464 of file class.ilLDAPServer.php.
Referenced by create(), toPearAuthArray(), and update().
{
return $this->user_scope;
}
Here is the caller graph for this function:| ilLDAPServer::getVersion | ( | ) |
Definition at line 276 of file class.ilLDAPServer.php.
Referenced by create(), toPearAuthArray(), update(), and validate().
{
return $this->version ? $this->version : self::DEFAULT_VERSION;
}
Here is the caller graph for this function:| ilLDAPServer::isAccountMigrationEnabled | ( | ) |
enabled account migration
public
Definition at line 531 of file class.ilLDAPServer.php.
{
return $this->account_migration ? true : false;
}
| ilLDAPServer::isActive | ( | ) |
Definition at line 200 of file class.ilLDAPServer.php.
Referenced by create(), and update().
{
return $this->active;
}
Here is the caller graph for this function:| ilLDAPServer::isActiveReferrer | ( | ) |
Definition at line 292 of file class.ilLDAPServer.php.
Referenced by create(), toPearAuthArray(), and update().
{
return $this->referrals ? true : false;
}
Here is the caller graph for this function:| ilLDAPServer::isActiveTLS | ( | ) |
Definition at line 300 of file class.ilLDAPServer.php.
Referenced by create(), toPearAuthArray(), update(), and validate().
{
return $this->tls ? true : false;
}
Here is the caller graph for this function:| ilLDAPServer::isMembershipOptional | ( | ) |
Definition at line 431 of file class.ilLDAPServer.php.
Referenced by create(), and update().
{
return (bool) $this->group_optional;
}
Here is the caller graph for this function:| ilLDAPServer::prepareFilter | ( | $ | a_filter | ) | [private] |
Create brackets for filters if they do not exist.
private
| string | filter |
Definition at line 721 of file class.ilLDAPServer.php.
Referenced by getFilter(), and getGroupFilter().
{
$filter = trim($a_filter);
if(!strlen($filter))
{
return $filter;
}
if(strpos($filter,'(') !== 0)
{
$filter = ('('.$filter);
}
if(substr($filter,-1) != ')')
{
$filter = ($filter.')');
}
return $filter;
}
Here is the caller graph for this function:| ilLDAPServer::read | ( | ) | [private] |
Read server settings.
Definition at line 772 of file class.ilLDAPServer.php.
References $res, enableGroupMemberIsDN(), enableRoleSynchronization(), enableSyncOnLogin(), enableSyncPerCron(), setBaseDN(), setBindingType(), setBindPassword(), setBindUser(), setFilter(), setGroupAttribute(), setGroupDN(), setGroupFilter(), setGroupMember(), setGroupName(), setGroupScope(), setGroupUserFilter(), setName(), setRoleBindDN(), setRoleBindPassword(), setSearchBase(), setUrl(), setUserAttribute(), setUserScope(), setVersion(), toggleActive(), toggleMembershipOptional(), toggleReferrer(), and toggleTLS().
Referenced by __construct().
{
if(!$this->server_id)
{
return true;
}
$query = "SELECT * FROM ldap_server_settings WHERE server_id = ".$this->db->quote($this->server_id)."";
# var_dump("<pre>",$query,"</pre>");
$res = $this->db->query($query);
while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
{
$this->toggleActive($row->active);
$this->setName($row->name);
$this->setUrl($row->url);
$this->setVersion($row->version);
$this->setBaseDN($row->base_dn);
$this->toggleReferrer($row->referrals);
$this->toggleTLS($row->tls);
$this->setBindingType($row->bind_type);
$this->setBindUser($row->bind_user);
$this->setBindPassword($row->bind_pass);
$this->setSearchBase($row->search_base);
$this->setUserScope($row->user_scope);
$this->setUserAttribute($row->user_attribute);
$this->setFilter($row->filter);
$this->setGroupDN($row->group_dn);
$this->setGroupScope($row->group_scope);
$this->setGroupFilter($row->group_filter);
$this->setGroupMember($row->group_member);
$this->setGroupAttribute($row->group_attribute);
$this->toggleMembershipOptional($row->group_optional);
$this->setGroupUserFilter($row->group_user_filter);
$this->enableGroupMemberIsDN($row->group_memberisdn);
$this->setGroupName($row->group_name);
$this->enableSyncOnLogin($row->sync_on_login);
$this->enableSyncPerCron($row->sync_per_cron);
$this->enableRoleSynchronization($row->role_sync_active);
$this->setRoleBindDN($row->role_bind_dn);
$this->setRoleBindPassword($row->role_bind_pass);
}
}
Here is the call graph for this function:
Here is the caller graph for this function:| ilLDAPServer::setBaseDN | ( | $ | a_base_dn | ) |
Definition at line 288 of file class.ilLDAPServer.php.
Referenced by read().
{
$this->base_dn = $a_base_dn;
}
Here is the caller graph for this function:| ilLDAPServer::setBindingType | ( | $ | a_type | ) |
Definition at line 312 of file class.ilLDAPServer.php.
Referenced by read().
{
if($a_type == IL_LDAP_BIND_USER)
{
$this->binding_type = IL_LDAP_BIND_USER;
}
else
{
$this->binding_type = IL_LDAP_BIND_ANONYMOUS;
}
}
Here is the caller graph for this function:| ilLDAPServer::setBindPassword | ( | $ | a_password | ) |
Definition at line 335 of file class.ilLDAPServer.php.
Referenced by read().
{
$this->bind_password = $a_password;
}
Here is the caller graph for this function:| ilLDAPServer::setBindUser | ( | $ | a_user | ) |
Definition at line 327 of file class.ilLDAPServer.php.
Referenced by read().
{
$this->bind_user = $a_user;
}
Here is the caller graph for this function:| ilLDAPServer::setFilter | ( | $ | a_filter | ) |
Definition at line 359 of file class.ilLDAPServer.php.
Referenced by read().
{
$this->filter = $a_filter;
}
Here is the caller graph for this function:| ilLDAPServer::setGlobalRole | ( | $ | a_role | ) |
Definition at line 484 of file class.ilLDAPServer.php.
{
$this->global_role = $a_role;
}
| ilLDAPServer::setGroupAttribute | ( | $ | a_value | ) |
Definition at line 422 of file class.ilLDAPServer.php.
Referenced by read().
{
$this->group_attribute = $a_value;
}
Here is the caller graph for this function:| ilLDAPServer::setGroupDN | ( | $ | a_value | ) |
Definition at line 367 of file class.ilLDAPServer.php.
Referenced by read().
{
$this->group_dn = $a_value;
}
Here is the caller graph for this function:| ilLDAPServer::setGroupFilter | ( | $ | a_value | ) |
Definition at line 375 of file class.ilLDAPServer.php.
Referenced by read().
{
$this->group_filter = $a_value;
}
Here is the caller graph for this function:| ilLDAPServer::setGroupMember | ( | $ | a_value | ) |
Definition at line 383 of file class.ilLDAPServer.php.
Referenced by read().
{
$this->group_member = $a_value;
}
Here is the caller graph for this function:| ilLDAPServer::setGroupName | ( | $ | a_value | ) |
Definition at line 391 of file class.ilLDAPServer.php.
Referenced by read().
{
$this->group_name = $a_value;
}
Here is the caller graph for this function:| ilLDAPServer::setGroupScope | ( | $ | a_value | ) |
Definition at line 452 of file class.ilLDAPServer.php.
Referenced by read().
{
$this->group_scope = $a_value;
}
Here is the caller graph for this function:| ilLDAPServer::setGroupUserFilter | ( | $ | a_filter | ) |
Definition at line 435 of file class.ilLDAPServer.php.
Referenced by read().
{
$this->group_user_filter = $a_filter;
}
Here is the caller graph for this function:| ilLDAPServer::setName | ( | $ | a_name | ) |
Definition at line 272 of file class.ilLDAPServer.php.
Referenced by read().
{
$this->name = $a_name;
}
Here is the caller graph for this function:| ilLDAPServer::setRoleBindDN | ( | $ | a_value | ) |
Definition at line 492 of file class.ilLDAPServer.php.
Referenced by read().
{
$this->role_bind_dn = $a_value;
}
Here is the caller graph for this function:| ilLDAPServer::setRoleBindPassword | ( | $ | a_value | ) |
Definition at line 500 of file class.ilLDAPServer.php.
Referenced by read().
{
$this->role_bind_pass = $a_value;
}
Here is the caller graph for this function:| ilLDAPServer::setSearchBase | ( | $ | a_search_base | ) |
Definition at line 343 of file class.ilLDAPServer.php.
Referenced by read().
{
$this->search_base = $a_search_base;
}
Here is the caller graph for this function:| ilLDAPServer::setUrl | ( | $ | a_url | ) |
Definition at line 208 of file class.ilLDAPServer.php.
Referenced by read().
{
$this->url_string = $a_url;
// Maybe there are more than one url's (comma seperated).
$urls = explode(',',$a_url);
$counter = 0;
foreach($urls as $url)
{
$url = trim($url);
if(!$counter++)
{
$this->url = $url;
}
else
{
$this->fallback_urls[] = $url;
}
}
}
Here is the caller graph for this function:| ilLDAPServer::setUserAttribute | ( | $ | a_user_attr | ) |
Definition at line 351 of file class.ilLDAPServer.php.
Referenced by read().
{
$this->user_attribute = $a_user_attr;
}
Here is the caller graph for this function:| ilLDAPServer::setUserScope | ( | $ | a_value | ) |
Definition at line 460 of file class.ilLDAPServer.php.
Referenced by read().
{
$this->user_scope = $a_value;
}
Here is the caller graph for this function:| ilLDAPServer::setVersion | ( | $ | a_version | ) |
Definition at line 280 of file class.ilLDAPServer.php.
Referenced by read().
{
$this->version = $a_version;
}
Here is the caller graph for this function:| ilLDAPServer::toggleActive | ( | $ | a_status | ) |
Definition at line 196 of file class.ilLDAPServer.php.
Referenced by read().
{
$this->active = $a_status;
}
Here is the caller graph for this function:| ilLDAPServer::toggleMembershipOptional | ( | $ | a_status | ) |
Definition at line 427 of file class.ilLDAPServer.php.
Referenced by read().
{
$this->group_optional = (bool) $a_status;
}
Here is the caller graph for this function:| ilLDAPServer::toggleReferrer | ( | $ | a_status | ) |
Definition at line 296 of file class.ilLDAPServer.php.
Referenced by read().
{
$this->referrals = $a_status;
}
Here is the caller graph for this function:| ilLDAPServer::toggleTLS | ( | $ | a_status | ) |
Definition at line 304 of file class.ilLDAPServer.php.
Referenced by read().
{
$this->tls = $a_status;
}
Here is the caller graph for this function:| ilLDAPServer::toPearAuthArray | ( | ) |
Creates an array of options compatible to PEAR Auth.
Definition at line 654 of file class.ilLDAPServer.php.
References enabledGroupMemberIsDN(), getBaseDN(), getBindingType(), getBindPassword(), getBindUser(), getFilter(), getGroupAttribute(), getGroupDN(), getGroupFilter(), getGroupMember(), getGroupName(), getGroupScope(), getPearAtributeArray(), getSearchBase(), getUrl(), getUserAttribute(), getUserScope(), getVersion(), isActiveReferrer(), and isActiveTLS().
{
$options = array(
'url' => $this->getUrl(),
'version' => (int) $this->getVersion(),
'referrals' => (bool) $this->isActiveReferrer());
if($this->getBindingType() == IL_LDAP_BIND_USER)
{
$options['binddn'] = $this->getBindUser();
$options['bindpw'] = $this->getBindPassword();
}
$options['basedn'] = $this->getBaseDN();
$options['start_tls'] = (bool) $this->isActiveTLS();
$options['userdn'] = $this->getSearchBase();
switch($this->getUserScope())
{
case IL_LDAP_SCOPE_ONE:
$options['userscope'] = 'one';
break;
default:
$options['userscope'] = 'sub';
break;
}
$options['userattr'] = $this->getUserAttribute();
$options['userfilter'] = $this->getFilter();
$options['attributes'] = $this->getPearAtributeArray();
$options['debug'] = self::DEBUG;
if(@include_once('Log.php'))
{
if(@include_once('Log/observer.php'))
{
$options['enableLogging'] = true;
}
}
switch($this->getGroupScope())
{
case IL_LDAP_SCOPE_BASE:
$options['groupscope'] = 'base';
break;
case IL_LDAP_SCOPE_ONE:
$options['groupscope'] = 'one';
break;
default:
$options['groupscope'] = 'sub';
break;
}
$options['groupdn'] = $this->getGroupDN();
$options['groupattr'] = $this->getGroupAttribute();
$options['groupfilter'] = $this->getGroupFilter();
$options['memberattr'] = $this->getGroupMember();
$options['memberisdn'] = $this->enabledGroupMemberIsDN();
$options['group'] = $this->getGroupName();
return $options;
}
Here is the call graph for this function:| ilLDAPServer::update | ( | ) |
Definition at line 612 of file class.ilLDAPServer.php.
References enabledGroupMemberIsDN(), enabledRoleSynchronization(), enabledSyncOnLogin(), enabledSyncPerCron(), getBaseDN(), getBindingType(), getBindPassword(), getBindUser(), getFilter(), getGroupAttribute(), getGroupDN(), getGroupFilter(), getGroupMember(), getGroupName(), getGroupScope(), getGroupUserFilter(), getName(), getRoleBindDN(), getRoleBindPassword(), getSearchBase(), getServerId(), getUrlString(), getUserAttribute(), getUserScope(), getVersion(), isActive(), isActiveReferrer(), isActiveTLS(), and isMembershipOptional().
{
$query = "UPDATE ldap_server_settings SET ".
"active = ".$this->db->quote($this->isActive()).", ".
"name = ".$this->db->quote($this->getName()).", ".
"url = ".$this->db->quote($this->getUrlString()).", ".
"version = ".$this->db->quote($this->getVersion()).", ".
"base_dn = ".$this->db->quote($this->getBaseDN()).", ".
"referrals = ".$this->db->quote($this->isActiveReferrer()).", ".
"tls = ".$this->db->quote($this->isActiveTLS()).", ".
"bind_type = ".$this->db->quote($this->getBindingType()).", ".
"bind_user = ".$this->db->quote($this->getBindUser()).", ".
"bind_pass = ".$this->db->quote($this->getBindPassword()).", ".
"search_base = ".$this->db->quote($this->getSearchBase()).", ".
"user_scope = ".$this->db->quote($this->getUserScope()).", ".
"user_attribute = ".$this->db->quote($this->getUserAttribute()).", ".
"filter = ".$this->db->quote($this->getFilter()).", ".
"group_dn = ".$this->db->quote($this->getGroupDN()).", ".
"group_scope = ".$this->db->quote($this->getGroupScope()).", ".
"group_filter = ".$this->db->quote($this->getGroupFilter()).", ".
"group_member = ".$this->db->quote($this->getGroupMember()).", ".
"group_memberisdn =".$this->db->quote((int) $this->enabledGroupMemberIsDN()).", ".
"group_name = ".$this->db->quote($this->getGroupName()).", ".
"group_attribute = ".$this->db->quote($this->getGroupAttribute()).", ".
"group_optional = ".$this->db->quote((int) $this->isMembershipOptional()).", ".
"group_user_filter = ".$this->db->quote($this->getGroupUserFilter()).", ".
"sync_on_login = ".$this->db->quote($this->enabledSyncOnLogin() ? 1 : 0).", ".
"sync_per_cron = ".$this->db->quote($this->enabledSyncPerCron() ? 1 : 0).", ".
"role_sync_active = ".$this->db->quote($this->enabledRoleSynchronization()).", ".
"role_bind_dn = ".$this->db->quote($this->getRoleBindDN()).", ".
"role_bind_pass = ".$this->db->quote($this->getRoleBindPassword())." ".
"WHERE server_id = ".$this->db->quote($this->getServerId());
$this->db->query($query);
return true;
}
Here is the call graph for this function:| ilLDAPServer::validate | ( | ) |
Validate user input.
| @return | boolean |
Definition at line 542 of file class.ilLDAPServer.php.
References $ilErr, enabledSyncOnLogin(), enabledSyncPerCron(), getBaseDN(), getBindingType(), getBindPassword(), getBindUser(), getName(), getUrl(), getUserAttribute(), getVersion(), and isActiveTLS().
{
global $ilErr;
$ilErr->setMessage('');
if(!strlen($this->getName()) ||
!strlen($this->getUrl()) ||
!strlen($this->getBaseDN()) ||
!strlen($this->getUserAttribute()))
{
$ilErr->setMessage($this->lng->txt('fill_out_all_required_fields'));
}
if($this->getBindingType() == IL_LDAP_BIND_USER
&& (!strlen($this->getBindUser()) || !strlen($this->getBindPassword())))
{
$ilErr->appendMessage($this->lng->txt('ldap_missing_bind_user'));
}
if(($this->enabledSyncPerCron() or $this->enabledSyncOnLogin()) and !$this->global_role)
{
$ilErr->appendMessage($this->lng->txt('ldap_missing_role_assignment'));
}
if($this->getVersion() == 2 and $this->isActiveTLS())
{
$ilErr->appendMessage($this->lng->txt('ldap_tls_conflict'));
}
return strlen($ilErr->getMessage()) ? false : true;
}
Here is the call graph for this function:ilLDAPServer::$fallback_urls = array() [private] |
Definition at line 50 of file class.ilLDAPServer.php.
ilLDAPServer::$server_id = null [private] |
Definition at line 49 of file class.ilLDAPServer.php.
| const ilLDAPServer::DEBUG = false |
Definition at line 46 of file class.ilLDAPServer.php.
| const ilLDAPServer::DEFAULT_VERSION = 3 |
Definition at line 47 of file class.ilLDAPServer.php.
1.7.1