While testing the drupal 5 version of this module, I found some problems (forgotten while backporting I think). Here are some corrections (sorry, for not submitting a patch) :

Line 124

  $roles = user_roles();
  array_unshift($roles, t(' -Select Role- '));

should be (the indexes are messed up if not) :
$roles = array(t(' -Select Role- ')) + user_roles();

Line 240
'access' => array('administer troll'),
should be :
'access' => user_access('administer troll'),

Line 545

 function troll_blacklist_import_url($edit) {
  $url_parts = parse_url($edit['custom_list']);
   $file_parts = pathinfo($url_parts['path']);
  troll_blacklist_parse_save($edit['custom_list'], $file_parts['extension']);
 }

should be :

 function troll_blacklist_import_url($edit) {
  $url_parts = parse_url($edit);
   $file_parts = pathinfo($url_parts['path']);
  troll_blacklist_parse_save($edit, $file_parts['extension']);
 }

To be added (the block user form isn't defined at all):

/**
 * Menu callback: block a user and redirect to search page.
 *
 * @param $uid
 */
function troll_confirm_block_user_form($uid) {
  $account = user_load(array('uid' => $uid));
  if (!$account) {
    drupal_goto('admin/user/troll');
  }
  $form['uid'] = array(
    '#type' => 'value',
    '#value' => $uid,
  );
  $form['#redirect'] = 'admin/user/troll';
  return confirm_form($form, t('Block user %username?', array('%username' => $account->name)), 'admin/user/troll', t('Are you sure you want to block this user?'));
}

function troll_confirm_block_user_form_submit($form_id, $form_values /*$form, &$form_state*/) {
  troll_block_user($form_values['uid']);
}

Comments

deekayen’s picture

Status: Active » Fixed

committed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.