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