2009-04-05, 07:53 PM
To repeat:
1. Go to the profile of a banned member.
2. Click "Ban this user in Mod CP"
3. Click "Lift Ban" (top right bar)
4. Error is "You have selected an invalid ban."
The uid is empty in the link.
FIX:
In modcp.php
Find:
Change to:
The reason this doesn't work is is because $user['uid'] is not defined by a previous get_user statement as it's part of a the function:
Because it's not a new ban...it doesn't use the get_user.
http://community.mybboard.net/thread-432...#pid295118
I just found that...and well adding a u.uid to the query doesn't fix the problem so I am hoping that something like my fix was placed and that any fix was tested. Feel free to mark as duplicate if indeed this was correctly fixed. That query isn't the problem. It's the get_user.
1. Go to the profile of a banned member.
2. Click "Ban this user in Mod CP"
3. Click "Lift Ban" (top right bar)
4. Error is "You have selected an invalid ban."
The uid is empty in the link.
FIX:
In modcp.php
Find:
$lift_link = "<div class=\"float_right\"><a href=\"modcp.php?action=liftban&uid={$user['uid]}&my_post_key={$mybb->post_code}\">{$lang->lift_ban}</a></div>";
Change to:
$uid= intval($mybb->input['uid']);
$lift_link = "<div class=\"float_right\"><a href=\"modcp.php?action=liftban&uid={$uid}&my_post_key={$mybb->post_code}\">{$lang->lift_ban}</a></div>";
The reason this doesn't work is is because $user['uid'] is not defined by a previous get_user statement as it's part of a the function:
// New ban!
if(!$banuser_username)
{
if($mybb->input['uid'])
{
$user = get_user($mybb->input['uid']);
$username = $user['username'];
}
else
Because it's not a new ban...it doesn't use the get_user.
http://community.mybboard.net/thread-432...#pid295118
I just found that...and well adding a u.uid to the query doesn't fix the problem so I am hoping that something like my fix was placed and that any fix was tested. Feel free to mark as duplicate if indeed this was correctly fixed. That query isn't the problem. It's the get_user.