Mysidia Adoptables Support Forum  

Home Community Mys-Script Creative Off-Topic
Go Back   Mysidia Adoptables Support Forum > Mysidia Adoptables > Addons and Modifications > Addons/Mods Graveyard

Notices

Closed Thread
 
Thread Tools Display Modes
  #1  
Old 04-04-2009, 05:53 PM
kisazeky kisazeky is offline
Member
 
Join Date: Mar 2009
Posts: 44
Credits: 22,737
kisazeky
Default Prevent people making multiple accounts

This is hard to believe, but some people are desperate as to keep registering accounts to level up their adoptables. Let's make this method of leveling up not worth it.

Step 1:

Run this query
PHP Code:
ALTER TABLE users ADD (ip VARCHAR(30NOT NULL DEFAULT "0"
Step 2:

Open register2.php

Find
PHP Code:
// Connect to our database 
Above this line, put

PHP Code:
$ip $_SERVER['REMOTE_ADDR']; 
$ip preg_replace("/[^a-zA-Z0-9@._-]/"""$ip); 
Step 3:

Still in register2.php, find this code:

PHP Code:
//Check that username does not already exist

$query "SELECT * FROM users WHERE username = '$username'";
$result = @mysql_query($query);
$num = @mysql_numrows($result);

//Loop out code
$i=0;
while (
$i 1) {

$luser=@mysql_result($result,$i,"username");


$i++;
}

$luser strtolower($luser);
$u2 $str strtolower($username);

if(
$luser == $u2){
$template replace(':ARTICLETITLE:','Error',$template);
$template replace(':ARTICLECONTENT:','Your username has been taken.  Please <a href="register.php">go back</a> and select a different username.',$template);
echo 
$template;
die();


Below all of that, put

PHP Code:
// Check that user is not making multiple accounts

$query "SELECT * FROM users WHERE ip = '$ip'";
$result = @mysql_query($query);
$num = @mysql_numrows($result);

//Loop out code
$i=0;
while (
$i 1) {

$ip2=@mysql_result($result,$i,"ip");


$i++;
}

if(
$ip == $ip2){
$template replace(':ARTICLETITLE:','Error',$template);
$template replace(':ARTICLECONTENT:','You are not allowed to make multiple accounts.',$template);
echo 
$template;
die();

Step 4:

Find this line

PHP Code:
//All checks pass, create the user 
Insert below it:

PHP Code:
$pass1 md5($pass1); //MD5 the password
mysql_query("INSERT INTO users VALUES ('', '$username', '$pass1','$email','free', '$ip')"); 
Note: if you have installed my currency mod, you'll want to insert this instead:

PHP Code:
$pass1 md5($pass1); //MD5 the password
mysql_query("INSERT INTO users VALUES ('', '$username', '$pass1','$email','free', '0', '$ip')"); 
  #2  
Old 04-04-2009, 06:30 PM
Ashje Ashje is offline
Member
 
Join Date: Jan 2009
Posts: 179
Credits: 12,738
Ashje
Default RE: Prevent people making multiple accounts

Awesome, trying it now.

EDIT:

Works perfectly but Members registered before the mod was installed have an IP "0" so they can still make double accounts. With sites like Arvyre, which already has over 4000 members, this is useless.
  #3  
Old 04-04-2009, 06:47 PM
kisazeky kisazeky is offline
Member
 
Join Date: Mar 2009
Posts: 44
Credits: 22,737
kisazeky
Default RE: Prevent people making multiple accounts

I am not sure if exceptions can be made, honestly
  #4  
Old 04-04-2009, 08:57 PM
BMR777 BMR777 is offline
Member
 
Join Date: Jan 2011
Posts: 1,122
Gender: Male
Credits: 13,690
BMR777 is on a distinguished road
Default RE: Prevent people making multiple accounts

This is a bad idea because of legitimate users sharing IP addresses, such as Dial Up Users and DSL users who get a new IP each time they connect, users in public places such as schools and countries where the IP address pool for all users is limited or the same, such as Turkey where everyone shares about 20 IP addresses. :)
  #5  
Old 04-06-2009, 01:27 PM
eaglelegend eaglelegend is offline
Member
 
Join Date: Mar 2009
Posts: 45
Credits: 5,042
eaglelegend
Default RE: Prevent people making multiple accounts

Point taken Brandon, but, what if you have a limit, say you cant register with the same IP address for say 30 mins, just to be safe say.
  #6  
Old 04-06-2009, 08:57 PM
kisazeky kisazeky is offline
Member
 
Join Date: Mar 2009
Posts: 44
Credits: 22,737
kisazeky
Default RE: Prevent people making multiple accounts

Good idea but I don't know how to do time in php.

For now I'm letting people ask for exceptions in my forums.
  #7  
Old 04-24-2009, 02:44 AM
Blue Icebox Blue Icebox is offline
Member
 
Join Date: Jan 2009
Posts: 45
Credits: 5,980
Blue Icebox
Default RE: Prevent people making multiple accounts

Well... since brandon made the 24 hours limit adoptable part... go to that section and change a little to fit the requirements! :D
Closed Thread


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
Can't login, errors prevent it RandomFrog Questions and Supports 7 10-04-2014 11:23 PM
Hi People Taintedkitten Newcomer Center 3 01-06-2013 06:06 PM
Accounts Nieth Questions and Supports 4 12-12-2012 01:44 PM
Prevent Refresh PTGigi Suggestions and Feature Requests 9 01-28-2011 05:12 PM
Multiple multiple outcomes..? Quillink Suggestions and Feature Requests 5 05-31-2009 08:14 AM


All times are GMT -5. The time now is 11:19 AM.

Currently Active Users: 1184 (0 members and 1184 guests)
Threads: 4,081, Posts: 32,032, 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