function imce_user_profile in IMCE 6.2
Same name and namespace in other branches
- 6 imce.module \imce_user_profile()
- 7 imce.module \imce_user_profile()
Get the profile for the user.
3 calls to imce_user_profile()
- imce_access in ./
imce.module - Checks if the user has access to imce.
- imce_initiate_profile in inc/
imce.page.inc - Initiate and return configuration profile for the $user.
- imce_user_page_access in ./
imce.module - Checks access to user/{$account->uid}/imce for the $user.
File
- ./
imce.module, line 157 - Implements the necessary hooks for the file browser to work properly.
Code
function imce_user_profile($user) {
static $ups = array();
if (isset($ups[$user->uid])) {
return $ups[$user->uid];
}
$profiles = variable_get('imce_profiles', array());
if ($user->uid == 1 && isset($profiles[1])) {
return $ups[$user->uid] = $profiles[1];
}
else {
foreach (variable_get('imce_roles_profiles', array()) as $rid => $role) {
if (isset($user->roles[$rid]) && isset($profiles[$role['pid']])) {
return $ups[$user->uid] = $profiles[$role['pid']];
}
}
}
return $ups[$user->uid] = FALSE;
}