You are here

function drupalchat_user_entry_form_submit in DrupalChat 7

Same name and namespace in other branches
  1. 6.2 drupalchat.module \drupalchat_user_entry_form_submit()
  2. 7.2 drupalchat.module \drupalchat_user_entry_form_submit()

File

./drupalchat.module, line 1189
Module code for DrupalChat.

Code

function drupalchat_user_entry_form_submit($form, &$form_state) {
  if (user_access('access drupalchat all logs')) {
    $account = user_load_by_name(check_plain($form_state['values']['name']));
    $_SESSION['drupalchat_switch_user'] = $account->uid;
    drupal_goto('drupalchat/messages');
  }
  else {
    drupal_access_denied();
  }
}