user with userid=1 can't ban users

yangru - June 13, 2008 - 04:18
Project:abuse
Version:5.x-1.0-beta
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:active
Description

I think function abuse_ban should be changed like this to resolve this problem:

function abuse_ban($uid) {
global $user;
if ($uid == 1 || $user->uid == $uid) {//previously if ($user->uid == 1 || $user->uid == $uid)
drupal_set_message(t('You cannot ban '. ($uid == 1 ? 'the administrator' : 'yourself') .'!'));//previously drupal_set_message(t('You cannot ban '. ($user->uid == 1 ? 'the administrator' : 'yourself') .'!'));
drupal_goto('admin/content/abuse');
}
$account = user_load(array('uid' => $uid));
return drupal_get_form('abuse_ban_form', $account);
}

 
 

Drupal is a registered trademark of Dries Buytaert.