You are here

function tinybrowser_get_user_profile in TinyBrowser 7

Get the profile for the user

2 calls to tinybrowser_get_user_profile()
config_tinybrowser.php in tinybrowser/config_tinybrowser.php
tinybrowser_user_page_access in ./tinybrowser.userpage.inc
Check if the tinybrowser is available at user account page

File

./tinybrowser.module, line 1049

Code

function tinybrowser_get_user_profile($user) {
  $profiles = variable_get('tinybrowser_profiles', array());
  if ($user->uid == 1 && isset($profiles[1])) {
    return $profiles[1];
  }
  else {
    foreach (variable_get('tinybrowser_roles_profiles', array()) as $rid => $role) {
      if (isset($user->roles[$rid]) && isset($profiles[$role['pid']])) {
        return $profiles[$role['pid']];
      }
    }
  }
  return FALSE;
}