You are here

function pm_block_user_block_submit in Privatemsg 6.2

Same name and namespace in other branches
  1. 7.2 pm_block_user/pm_block_user.pages.inc \pm_block_user_block_submit()
  2. 7 pm_block_user/pm_block_user.pages.inc \pm_block_user_block_submit()

Submit callback for block user form.

1 string reference to 'pm_block_user_block_submit'
pm_block_user_list in pm_block_user/pm_block_user.pages.inc
Formbuilder function to build a simple form to block users.

File

pm_block_user/pm_block_user.pages.inc, line 172
User menu callbacks for pm_block_user.module.

Code

function pm_block_user_block_submit($form, &$form_state) {
  global $user;
  foreach ($form_state['valid_accounts'] as $account) {
    db_query('INSERT INTO {pm_block_user} (author, recipient) VALUES (%d, %d)', $account->uid, $user->uid);
    drupal_set_message(t('!author has been blocked from sending you any further messages.', array(
      '!author' => theme('username', $account),
    )));
  }
}