function ldapdata_user_categories in LDAP integration 5
Same name and namespace in other branches
- 5.2 ldapdata.module \ldapdata_user_categories()
Implements hook_categories();
1 call to ldapdata_user_categories()
- ldapdata_user in ./
ldapdata.module - Implements hook_user()
File
- ./
ldapdata.module, line 398
Code
function ldapdata_user_categories(&$user) {
$ret = null;
// we do this as opposed to calling _ldapdata_ldap_info() to save on the multiple sql queries
$result = db_fetch_array(db_query("SELECT ldapdata_mappings, ldapdata_rwattrs FROM {ldapauth} WHERE name = '%s'", $user->ldap_config));
$mappings = unserialize($result['ldapdata_mappings']);
$mapping_type = $mappings['access'];
$rwattrs = $result['ldapdata_rwattrs'];
if ($mapping_type == LDAP_MAP_ATTRIBUTES && !empty($rwattrs) && arg(2) == 'edit') {
$ret = array(
array(
'name' => LDAP_CATEGORY_USER_DATA,
'title' => LDAP_USER_DATA_EDIT_TAB,
'weight' => 50,
),
);
}
return $ret;
}