public function LdapUserConf::isSynched in Lightweight Directory Access Protocol (LDAP) 8.2
Same name and namespace in other branches
- 7.2 ldap_user/LdapUserConf.class.php \LdapUserConf::isSynched()
given configuration of synching, determine is a given synch should occur
Parameters
string $attr_token e.g. [property.mail], [field.ldap_user_puid_property]:
object $ldap_server:
array $prov_events e.g. array(LDAP_USER_EVENT_CREATE_DRUPAL_USER). typically array with 1 element:
scalar $direction LDAP_USER_PROV_DIRECTION_TO_DRUPAL_USER or LDAP_USER_PROV_DIRECTION_TO_LDAP_ENTRY:
2 calls to LdapUserConf::isSynched()
- LdapUserConf::drupalUserToLdapEntry in ldap_user/
LdapUserConf.class.php - populate ldap entry array for provisioning
- LdapUserConf::entryToUserEdit in ldap_user/
LdapUserConf.class.php - populate $user edit array (used in hook_user_save, hook_user_update, etc) ... should not assume all attribues are present in ldap entry
File
- ldap_user/
LdapUserConf.class.php, line 1307
Class
Code
public function isSynched($attr_token, $prov_events, $direction) {
$result = (bool) (isset($this->synchMapping[$direction][$attr_token]['prov_events']) && count(array_intersect($prov_events, $this->synchMapping[$direction][$attr_token]['prov_events'])));
if (!$result) {
if (isset($this->synchMapping[$direction][$attr_token])) {
//debug($this->synchMapping[$direction][$attr_token]);
}
else {
// debug("$attr_token not in ldapUserConf::synchMapping");
}
}
return $result;
}