MyBB Community Forums

Full Version: [F] Admin IP search [C-Rcpalace]
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
It doesn't work right...it never has since 1.4x move.

The partial search doesn't work at all as far as I can tell.
Yep, I have reported this many times.
Last time I have, Ryan has warned me through PM to do not lie/FUD, and now I do not post any bug in order not to be banned.

Is this normal ?
Forgive me if my english is not very correct and maybe appear some misunderstandings of the words.

I confirm labrocca's issue.
same here, the mod cp ip search does but not the admin cp?
To be clear it's from the User Search form. There was an issue before with the options links for "search all posts with this IP" or whatever that option is...but the User Search form with IP searching gives poor results. The partial doesn't work period. I can't get any results from it.

Can I ask what the longipaddress is being used for since the regular IP is still listed? Is ipaddress going to be depricated at some point? Seems having both is useless but it would be best imho to just have straight forward regular IP and that's for a number of reasons. Such as export sql searching or from phpmyadmin. Having to convert a known ip to the longipaddress format seems...well...the long way to do things.
(2008-12-11, 01:40 PM)mihails_univers Wrote: [ -> ]Yep, I have reported this many times.
Last time I have, Ryan has warned me through PM to do not lie/FUD, and now I do not post any bug in order not to be banned.

Is this normal ?
Forgive me if my english is not very correct and maybe appear some misunderstandings of the words.

I confirm labrocca's issue.

Ryan Gordon Wrote:
(2008-11-27, 01:44 PM)mihails_univers Wrote: [ -> ]I have reported the ADminCP search by IP bug from the beggining of 1.4, and till 1.4.4 every release it's written that was fixed, but in real it is not.

You even confirmed the bug fix for your second report, posted by Zinga Burga (Yumi). If you still have an issue make a support thread. If it turns out to still be a problem it will be reported as a bug and a developer will look into it. Once that happens SQA will test the fix if they can. If you want to test the fix too then request it.

Also, you only reported the problem twice. We've had a total of 4 releases. Last time I checked 2 was less then 4.

Ryan
(2008-12-11, 01:40 PM)mihails_univers Wrote: [ -> ]Yep, I have reported this many times.
Last time I have, Ryan has warned me through PM to do not lie/FUD, and now I do not post any bug in order not to be banned.

Is this normal ?
Forgive me if my english is not very correct and maybe appear some misunderstandings of the words.

I confirm labrocca's issue.

Okay in admin/modules/user/users.php find:

// IPv6 IP
if(strpos($view['conditions'][$search_field], ":") !== false)
{
	$view['conditions'][$search_field] = str_replace("*", "%", $view['conditions'][$search_field]);
	$ip_sql = "{$search_field} LIKE '".$db->escape_string($view['conditions'][$search_field])."'";
}
else
{
	$ip_range = fetch_longipv4_range($view['conditions'][$search_field]);
	$view['conditions'][$search_field] = str_replace("*", "%", $view['conditions'][$search_field]);
	if(!is_array($ip_range))
	{
		$ip_sql = "long{$search_field}='{$ip_range}'";
	}
	else
	{
		$ip_sql = "long{$search_field} > '{$ip_range[0]}' AND long{$search_field} < '{$ip_range[1]}'";
	}
}

and replace with

// IPv6 IP
if(strpos($view['conditions'][$search_field], ":") !== false)
{
	$view['conditions'][$search_field] = str_replace("*", "%", $view['conditions'][$search_field]);
	$ip_sql = "{$search_field} LIKE '".$db->escape_string($view['conditions'][$search_field])."'";
}
else
{
	$ip_range = fetch_longipv4_range($view['conditions'][$search_field]);
	if(!is_array($ip_range))
	{
		$ip_sql = "long{$search_field}='{$ip_range}'";
	}
	else
	{
		$ip_sql = "long{$search_field} > '{$ip_range[0]}' AND long{$search_field} < '{$ip_range[1]}'";
	}
}

Also find:

// IPv6 IP
if(strpos($view['conditions']['postip'], ":") !== false)
{
	$view['conditions']['postip'] = str_replace("*", "%", $view['conditions']['postip']);
	$ip_sql = "ipaddress LIKE '".$db->escape_string($view['conditions']['postip'])."'";
}
else
{
	$ip_range = fetch_longipv4_range($view['conditions']['postip']);
	$view['conditions']['postip'] = str_replace("*", "%", $view['conditions']['postip']);
	if(!is_array($ip_range))
	{
		$ip_sql = "longipaddress='{$ip_range}'";
	}
	else
	{
		$ip_sql = "longipaddress > '{$ip_range[0]}' AND longipaddress < '{$ip_range[1]}'";
	}
}

and replace with

// IPv6 IP
if(strpos($view['conditions']['postip'], ":") !== false)
{
	$view['conditions']['postip'] = str_replace("*", "%", $view['conditions']['postip']);
	$ip_sql = "ipaddress LIKE '".$db->escape_string($view['conditions']['postip'])."'";
}
else
{
	$ip_range = fetch_longipv4_range($view['conditions']['postip']);
	if(!is_array($ip_range))
	{
		$ip_sql = "longipaddress='{$ip_range}'";
	}
	else
	{
		$ip_sql = "longipaddress > '{$ip_range[0]}' AND longipaddress < '{$ip_range[1]}'";
	}
}

And this time please test it.
I'll be testing this as soon as I have access to my machine.
Best Regards.
Thank you for your bug report.

This bug has been fixed in our internal code repository. Please note that the problem will not be fixed here until these forums are updated.

With regards,
MyBB Group