protected function LdapServer::initDerivedProperties in Lightweight Directory Access Protocol (LDAP) 8.2
Same name and namespace in other branches
- 7.2 ldap_servers/LdapServer.class.php \LdapServer::initDerivedProperties()
this method sets properties that don't directly map from db record. it is split out so it can be shared with ldapServerTest.class.php
2 calls to LdapServer::initDerivedProperties()
- LdapServer::__construct in ldap_servers/
LdapServer.class.php - Constructor Method
- LdapServerTest::__construct in ldap_test/
LdapServerTest.class.php - Constructor Method
File
- ldap_servers/
LdapServer.class.php, line 184 - Defines server classes and related functions.
Class
- LdapServer
- LDAP Server Class
Code
protected function initDerivedProperties($bindpw) {
// get this->basedn in array format
if (!$this->basedn) {
$this->basedn = array();
}
elseif (is_array($this->basedn)) {
// do nothing
}
else {
$basedn_unserialized = @unserialize($this->basedn);
if (is_array($basedn_unserialized)) {
$this->basedn = $basedn_unserialized;
}
else {
$this->basedn = array();
$token = is_scalar($basedn_unserialized) ? $basedn_unserialized : print_r($basedn_unserialized, TRUE);
debug("basednb desearialization error" . $token);
watchdog('ldap_server', 'Failed to deserialize LdapServer::basedn of !basedn', array(
'!basedn' => $token,
), WATCHDOG_ERROR);
}
}
if ($bindpw) {
$this->bindpw = ldap_servers_decrypt($bindpw);
}
$this->paginationEnabled = (bool) (ldap_servers_php_supports_pagination() && $this->searchPagination);
$this->queriableWithoutUserCredentials = (bool) ($this->bind_method == LDAP_SERVERS_BIND_METHOD_SERVICE_ACCT || $this->bind_method == LDAP_SERVERS_BIND_METHOD_ANON_USER);
$this->editPath = !$this->sid ? '' : 'admin/config/people/ldap/servers/edit/' . $this->sid;
$this->groupGroupEntryMembershipsConfigured = $this->groupMembershipsAttrMatchingUserAttr && $this->groupMembershipsAttr;
$this->groupUserMembershipsConfigured = $this->groupUserMembershipsAttrExists && $this->groupUserMembershipsAttr;
}