Mysidia Adoptables Support Forum  

Home Community Mys-Script Creative Off-Topic
Go Back   Mysidia Adoptables Support Forum > Mysidia Adoptables > Addons and Modifications > Mys v1.2.x Mods

Notices

Reply
 
Thread Tools Display Modes
  #1  
Old 08-21-2011, 02:54 AM
ipengu's Avatar
ipengu ipengu is offline
Member
 
Join Date: Aug 2011
Location: Central NY
Posts: 50
Gender: Male
Credits: 8,830
ipengu is on a distinguished road
Default IP Tracking/Account Limiter

BROKEN AS OF 1.2.3, WORKING ON NEW RELEASE.

So this was the first mod I ever did to this script, simply because I forseen possible abuse (besides fact the donate script is 100% bugged and should be fixed/removed)

MAKE SURE YOU MAKE BACKUPS

To start you need to open phpmyadmin or whatever you use to manage your MySQL database.
Add a new column to YOURPREFIXHERE_users name the column "ip" (Obviously not the " 's only the word ip)

Open: register.php
Find: (Around line 25)
PHP Code:
$hidden $_POST["hidden"]; 
Add After:
PHP Code:
$ip=$_SERVER['REMOTE_ADDR']; 
Find: (Around line 57-66)
PHP Code:
    //Next check that the username does not already exist...

    
$flag 0;
    
$query "SELECT * FROM ".$prefix."users WHERE username = '$username'";
    
$result = @runquery($query);
    
$num = @mysql_numrows($result);

    if(
$num 0){
    
$flag 1;
    } 
Add After:
PHP Code:
    //Let's deny them if they already have an account with their current IP - BETA
    
    
$ipflag 0;
    
$ipquery "SELECT * FROM ".$prefix."users WHERE ip = '$ip'";
    
$ipresult = @runquery($ipquery);
    
$ipnum = @mysql_numrows($ipresult);

    if(
$ipnum 0){
    
$ipflag 1;
    } 
Find: (Around line 112-116)
PHP Code:
    else if($flag 0){

    
//Username already exists
    
$article_title "Your username already exists";
    
$article_content $userexists;    

    } 
Add After:
PHP Code:
    else if($ipflag 0){

    
//ip already exists
    
$article_title "You already have an account";
    
$article_content $ipexists;    

    } 
Find: (Around line 140) NOTE: If you've already done edits to the registration this may not be what you find, that's alright just add , '$ip' to the end of whatever you have as since you just made the ip column it should be the last.
PHP Code:
runquery("INSERT INTO ".$prefix."users VALUES ('', '$username', '$pass1','$email','3','1', '$date', '0', '0' ,'0','0','','','','','', '{$GLOBALS['settings']['startmoney']}','','','$avatar', '', '', '', '0', 'Unknown', '')"); 
Replace with:
PHP Code:
runquery("INSERT INTO ".$prefix."users VALUES ('', '$username', '$pass1','$email','3','1', '$date', '0', '0' ,'0','0','','','','','', '{$GLOBALS['settings']['startmoney']}','','','$avatar', '', '', '', '0', 'Unknown', '', '$ip')"); 
Close + Save register.php

Open: admin.php
Find: (Around line 1570)
PHP Code:
<td width='60'><strong>Usergroup:</strong></td
Add After:
PHP Code:
<td width='60'><strong>IP:</strong></td
Find: (Around line 1611)
PHP Code:
$level=@mysql_result($result,$i,"usergroup"); 
Add After:
PHP Code:
$ip=@mysql_result($result,$i,"ip"); 
Find: (Around line 1619)
PHP Code:
<td><center>".$level."</center></td
Add After:
PHP Code:
<td><center>".$ip."</center></td
Close + Save admin.php

Open: login.php
Find: (Around line 20, still no idea why I did this but eh it's there.)
PHP Code:
$password $_POST["password"]; 
Add After:
PHP Code:
$ip=$_SERVER['REMOTE_ADDR']; 
Find:(Around line 68)
PHP Code:
$lpass=@mysql_result($result,$i,"password"); 
Add After:
PHP Code:
$lip=@mysql_result($result,$i,"ip"); 
Find: (Around line 71 ITS RIGHT AFTER THE LAST EDIT)
PHP Code:
$i++;

Add After:
PHP Code:
if ($lip == ""){
mysql_query("UPDATE ".$prefix."users SET ip='".$ip."' WHERE ip=''");  

Close + Save login.php

Open: lang/lang.php
Find: (Around line 18)
PHP Code:
$userexists "We're sorry, but the username you have selected already exists.  Please <a href='register.php'>go back</a> and choose another username."
Add After:
PHP Code:
$ipexists "We're sorry, but you're only allowed one account, our records show you already have an account.  Please <a href='login.php'>login here</a>."
Close + Save lang/lang.php
__________________
Coder/Marketer/Etc
Super busy, lack of time for computer related things for awhile.

Current Mods:
Slim Profile | Disallow unfreezing adoptable
Longer Shoutbox | IP Tracking/Account Limiter
Colorblast | Flux Series

In the works:
Integrated Forum (Very unlikely to be a free public mod, at first anyways)15%
Better admin control panel (current one is terrible)
Couple Themes
Few other things.

Last edited by ipengu; 08-28-2011 at 08:25 AM.
Reply With Quote
  #2  
Old 08-21-2011, 11:25 AM
Chibi_Chicken Chibi_Chicken is offline
Niwatori Kami
 
Join Date: Jun 2011
Posts: 63
Gender: Unknown/Other
Credits: 6,275
Chibi_Chicken is on a distinguished road
Default

This is very nice, their isn't a lot of tracking (in this script) to tell if any users are trying to break the system.
Reply With Quote
  #3  
Old 08-21-2011, 01:26 PM
Hall of Famer's Avatar
Hall of Famer Hall of Famer is offline
Administrator, Lead Coder
 
Join Date: Dec 2008
Location: South Brunswick
Posts: 4,448
Gender: Male
Credits: 487,026
Hall of Famer is on a distinguished road
Default

This looks like a real awesome mod, thanks for posting it.
__________________


Mysidia Adoptables, a free and ever-improving script for aspiring adoptables/pets site.
Reply With Quote
  #4  
Old 08-21-2011, 04:58 PM
Teshia's Avatar
Teshia Teshia is offline
Art Director &amp; Developer
 
Join Date: Sep 2010
Location: On the Road
Posts: 99
Gender: Female
Credits: 6,436
Teshia
Default

That's brilliant. Is there a way to make it so a certain IP can only have, say 5 accounts instead of one? Some of my users share IPs with their family.

Also, for the part that says "You already have an account" maybe have a link to the 'forgot password' page.

Last edited by Teshia; 08-21-2011 at 05:00 PM.
Reply With Quote
  #5  
Old 08-21-2011, 11:59 PM
ipengu's Avatar
ipengu ipengu is offline
Member
 
Join Date: Aug 2011
Location: Central NY
Posts: 50
Gender: Male
Credits: 8,830
ipengu is on a distinguished road
Default

I've been testing these on low member servers, but I imagine this would have to be re-adapted for a high member volume website, at least a one pass through the database, check for multiple IP's if they exist email user a warning to pick an account to keep (freeze both/all accounts linked to same ip so they cant do sudden transfers and such)
__________________
Coder/Marketer/Etc
Super busy, lack of time for computer related things for awhile.

Current Mods:
Slim Profile | Disallow unfreezing adoptable
Longer Shoutbox | IP Tracking/Account Limiter
Colorblast | Flux Series

In the works:
Integrated Forum (Very unlikely to be a free public mod, at first anyways)15%
Better admin control panel (current one is terrible)
Couple Themes
Few other things.
Reply With Quote
  #6  
Old 08-22-2011, 12:04 AM
ipengu's Avatar
ipengu ipengu is offline
Member
 
Join Date: Aug 2011
Location: Central NY
Posts: 50
Gender: Male
Credits: 8,830
ipengu is on a distinguished road
Default

Also I'm sure its possible by messing with perhaps the ipflag section of register.php

Not 100% positive as I made this.... almost a month or so ago, I was surprised to remember all my edits.
__________________
Coder/Marketer/Etc
Super busy, lack of time for computer related things for awhile.

Current Mods:
Slim Profile | Disallow unfreezing adoptable
Longer Shoutbox | IP Tracking/Account Limiter
Colorblast | Flux Series

In the works:
Integrated Forum (Very unlikely to be a free public mod, at first anyways)15%
Better admin control panel (current one is terrible)
Couple Themes
Few other things.
Reply With Quote
  #7  
Old 10-19-2011, 10:54 PM
kratosvr kratosvr is offline
Member
 
Join Date: Aug 2011
Posts: 21
Gender: Male
Credits: 3,771
kratosvr is on a distinguished road
Default

I do not understand this:
Quote:
To start you need to open phpmyadmin or whatever you use to manage your MySQL database.
Add a new column to YOURPREFIXHERE_users name the column "ip"
What is column ip ? i need help , i no know the columns

Thanks.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Multi Account jcga Questions and Supports 3 11-12-2009 01:39 PM
[Lock Please] Account changes Tequila Questions and Supports 6 08-01-2009 03:27 PM
Change the "My account" button wilfred888 Questions and Supports 1 05-01-2009 02:01 PM
Account managemnt 12345 Questions and Supports 5 03-11-2009 04:27 AM
Add Special Pets to Account Blue Icebox Questions and Supports 4 02-20-2009 11:45 PM


All times are GMT -5. The time now is 05:01 AM.

Currently Active Users: 766 (0 members and 766 guests)
Threads: 4,081, Posts: 32,029, Members: 2,016
Welcome to our newest members, jolob.
BETA





What's New?

What's Hot?

What's Popular?


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
vBCommerce I v2.0.0 Gold ©2010, PixelFX Studios
vBCredits I v2.0.0 Gold ©2010, PixelFX Studios
Emoticons by darkmoon3636