1
ghia
Find relationship IP - user on NewBB/CBB
  • 2008/12/5 18:36

  • ghia

  • Community Support Member

  • Posts: 4953

  • Since: 2008/7/3 1


Inspired by a post on XOOPSfr.org where a utility was proposed to find the posts in newbbex done from the same IP address in order to detect eg users with multiple aliases, I adapted it for use with Newbb/CBB and the English language. Save next code in a php file at /modules/newbb/ with a name of your choice, eg. searchip.php .

include '../../mainfile.php';    // placement in modules/newbb
include XOOPS_ROOT_PATH.'/header.php';

global 
$xoopsDB$xoopsConfig;
if (
is_object($xoopsUser))
{
    
$groupsok $xoopsUser->getGroups();
}
else 
{
    
$groupsok=99
}

if (!
in_array("1"$groupsok)) //if member of webmasters group - Adapt to allow other groups
{
    
redirect_header(XOOPS_ROOT_PATH."/index.php",5"You have insufficient rights to view this page.");
    exit();
}
$message_remerciement "";
if (!empty(
$_POST['envoi']))
{
    
$posterip $_POST['posterip'];
    
$nposterip ip2long($posterip);
    if ((
$nposterip != -1) && ($nposterip != FALSE))
    {
        
$sql "select * from `".$xoopsDB->prefix("bb_posts")."` where `poster_ip` = ".$nposterip." ORDER BY `".$xoopsDB->prefix("bb_posts")."`.`post_time` ASC;";
        
$result $xoopsDB->query($sql);
        if (
mysql_num_rows($result) == 0
        {
            
$message_remerciement "No posts found with IP address :".$posterip.".";
        }
        else 
        {
            
$message_remerciement "Found IP address : ".$posterip."";
        }

        while(
$data mysql_fetch_assoc($result))
        {
            
$message_remerciement .= "Used by /userinfo.php?uid=".$data['uid']."" target="_blank">".XoopsUser::getUnameFromId($data['uid'])." in /modules/newbb/viewtopic.php?viewmode=flat&topic_id=".$data['topic_id']."&forum=".$data['forum_id']."" target="_blank">this thread (".date('d/m/Y - H:i:s'$data['post_time']).")";
        }
//end while
        
if (mysql_num_rows($result) == 0
        {
            
$message_remerciement .= "";
        }
    }
//end if
    
else 
    {
        
$message_remerciement "You have to enter a valid IP address.";
    }
}
?>


Search IP in newBB/CBB forum



function verifSelection() 
{
    if (window.document.mail_form.posterip.value == "") 
    {
        alert("Please enter an IP address! eg. 76.54.32.10");
        return false;
    } 
    return true;
} // End of function





['PHP_SELF']?>">Search another IP address.   
/index.php">Back to home.
if ($message_remerciement) {
    echo(
"");
    echo(
stripslashes($message_remerciement));
    include 
XOOPS_ROOT_PATH.'/footer.php';
    echo(
"");
    exit();
}
?>
['PHP_SELF']?>" onsubmit="return verifSelection();">



    
        IP Address 
                  
        
    



include XOOPS_ROOT_PATH.'/footer.php';
?>



2
trabis
Re: Find relationship IP - user on NewBB/CBB
  • 2008/12/6 0:33

  • trabis

  • Core Developer

  • Posts: 2269

  • Since: 2006/9/1 1


Nice tip, thanks for sharing!

Module troubleshooting?
Is more like user troubleshooting!

3
ghia
Re: Find relationship IP - user on NewBB/CBB
  • 2008/12/6 1:52

  • ghia

  • Community Support Member

  • Posts: 4953

  • Since: 2008/7/3 1


Quote:
Module troubleshooting?
Is more like user troubleshooting!

It is!
- it is for troubleshooting ...
- it is for module NewBB/CBB ...
So, it is for this forum ... or not?

Login

Who's Online

343 user(s) are online (242 user(s) are browsing Support Forums)


Members: 0


Guests: 343


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits