Download & Extend

user with userid=1 can't ban users

Project:abuse
Version:6.x-1.1-alpha1
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed (fixed)

Issue Summary

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);
}

Comments

#1

Version:5.x-1.0-beta» 6.x-1.1-alpha1
Status:active» needs review

Here are patches for all branches.

AttachmentSize
abuse.admin_.inc-270062-1_D6_1.patch 793 bytes
abuse.module-270062-1_D5_2.patch 684 bytes
abuse.module-270062-1_D5.patch 672 bytes

#2

Status:needs review» fixed

should have been fixed.
Thanks!

#3

Status:fixed» closed (fixed)

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