MyBB Community Forums

Full Version: [D] Unlift Ban problems
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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:
	$lift_link = "<div class=\"float_right\"><a href=\"modcp.php?action=liftban&amp;uid={$user['uid]}&amp;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&amp;uid={$uid}&amp;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.
And QA checked the fix? Just making sure really. May I ask what change was made?
That doesn't display the fix and changing that query will NOT fix the problem. You have to change something else.
(2009-04-05, 08:09 PM)labrocca Wrote: [ -> ]And QA checked the fix?
Yes.
(2009-04-05, 08:09 PM)labrocca Wrote: [ -> ]May I ask what change was made?
Open the file modcp.php and search for:
SELECT b.*, u.username
Replace with:
SELECT b.*, u.username, u.uid
Search for:
$lang->ban_user = $lang->edit_ban; // Swap over lang variables
Above add:
$user = get_user($banned['uid']);
Thanks.