You are here

function bueditor_user_eid in BUEditor 5

Return the editor id assigned to the user.

1 call to bueditor_user_eid()
bueditor_user_editor in ./bueditor.module
Return the editor assigned to the user.

File

./bueditor.module, line 563

Code

function bueditor_user_eid($user) {
  if ($user->uid == 1) {
    return variable_get('bueditor_user1', 1);
  }
  $stored = variable_get('bueditor_roles', array());
  if (!$user->uid) {
    return $stored[DRUPAL_ANONYMOUS_RID]['editor'];
  }
  foreach ($stored as $rid => $role) {
    if (isset($user->roles[$rid])) {
      return $role['editor'];
    }
  }
}