Register for your free account! | Forgot your password?

You last visited: Today at 20:13

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



[Tyler & Bane release]Email

Discussion on [Tyler & Bane release]Email within the Shaiya PServer Development forum part of the Shaiya Private Server category.

Reply
 
Old   #1
 
RebeccaBlack's Avatar
 
elite*gold: 0
Join Date: Sep 2010
Posts: 520
Received Thanks: 1,286
[Dev Team Release]Email Registration

Registration modified to verify a person's email. Requires PHPMailer (Included)

You will need to change mail.php for your smtp server, possibly verify.php for your queries, and db.config.php for your database info. The rest is up to you :P


*Edit*
I uploaded a different Registration, this one is more of a "personal" one, which has jQuery to verify all fields are entered, and to check if the username already exists beforehand. It also has more commenting throughout the scripts to help explain, seeing as my previous didn't.

Listed below are things you will need to look for in the files.

Register.php

Verify.php

db.php

db.config.php

recaptchalib.config.php

recaptchalib.php

verifyuser.php

mail.php

To make it require email to log in to the server is up to you. If you look at the files, I used the UseQueue column. To make sure no one can login without verifying, I changed the Login Procedure (usp_Try_GameLogin_Taiwan), to include something like this:
*Note* This is NOT the full login procedure, it's merely a snippet. I am just showing you how I did made email verification a need for login. This also does not have the dupe fix, as it is just my test server.

As for the two .js files, those are for the register.php; They verify that all fields have been entered, and assist with the check for correct username.

Credits to:
Abrasive - For the registration script itself
Bane - For helping me finish
Attached Files
File Type: rar Old-Register.rar (112.9 KB, 287 views)
File Type: rar New-Registration.rar (144.0 KB, 694 views)
RebeccaBlack is offline  
Thanks
25 Users
Old 03/17/2011, 07:04   #2
 
Bаne's Avatar
 
elite*gold: 0
Join Date: Mar 2010
Posts: 2,334
Received Thanks: 1,777
Nom everyone enjoy this!! also if all fails you will need to add 2 new colums in the user master table.

-This was a dev team release BTW.-
Bаne is offline  
Old 03/17/2011, 10:36   #3
 
[GM]Recover's Avatar
 
elite*gold: 0
Join Date: Jan 2011
Posts: 279
Received Thanks: 164
thanks bane i just started this
[GM]Recover is offline  
Old 03/17/2011, 11:40   #4
 
topazee's Avatar
 
elite*gold: 0
Join Date: Jan 2011
Posts: 120
Received Thanks: 74
thanks you
topazee is offline  
Old 03/17/2011, 15:14   #5
 
ProfNerwosol's Avatar
 
elite*gold: 0
Join Date: Oct 2009
Posts: 449
Received Thanks: 644
Quote:
Originally Posted by [GM]Bane View Post
Nom everyone enjoy this!! also if all fails you will need to add 2 new colums in the user master table.
Not really. The database already has everything you need to enable email activation.
ProfNerwosol is offline  
Old 03/17/2011, 17:22   #6
 
Bаne's Avatar
 
elite*gold: 0
Join Date: Mar 2010
Posts: 2,334
Received Thanks: 1,777
Quote:
Originally Posted by ProfNerwosol View Post
Not really. The database already has everything you need to enable email activation.
Mech realy? We added a whole two new column for this lol..
Bаne is offline  
Old 03/18/2011, 11:02   #7
 
elite*gold: 0
Join Date: Feb 2008
Posts: 2
Received Thanks: 1
after configured everything i found out that you can still login even without verification through your email
kissangel is offline  
Old 03/18/2011, 11:56   #8
 
RebeccaBlack's Avatar
 
elite*gold: 0
Join Date: Sep 2010
Posts: 520
Received Thanks: 1,286
That is true. That is why I said the rest is up to you.

You need to change the queries a bit, as well as change your login procedure.

Changing the queries in them, you need to have the "verify" half of verify.php to let's say... update Users_Master and change UseQueue to 1, whereas the registering half changes it to 0.

Then alter your login procedure, if UseQueue is 0 Set Status=-2 else Set Status=0
RebeccaBlack is offline  
Old 03/18/2011, 18:34   #9
 
elite*gold: 0
Join Date: Jun 2009
Posts: 11
Received Thanks: 0
i get this when try to register an account :/
Quote:
Warning: mssql_query() [function.mssql-query]: message: Cannot insert the value NULL into column 'UserUID', table 'PS_UserData.dbo.Users_Master'; column does not allow nulls. INSERT fails. (severity 16) in H:\xampp\htdocs\Nova pasta\verify.php on line 67

Warning: mssql_query() [function.mssql-query]: Query failed in H:\xampp\htdocs\Nova pasta\verify.php on line 67

Warning: mssql_query() [function.mssql-query]: message: Cannot insert the value NULL into column 'UserUID', table 'PS_UserData.dbo.Users_Detail'; column does not allow nulls. INSERT fails. (severity 16) in H:\xampp\htdocs\Nova pasta\verify.php on line 72

Warning: mssql_query() [function.mssql-query]: Query failed in H:\xampp\htdocs\Nova pasta\verify.php on line 72

Fatal error: Uncaught exception 'phpmailerException' with message 'Invalid address: REPLY EMAIL' in H:\xampp\htdocs\Nova pasta\PHPMailer\class.phpmailer.php:462 Stack trace: #0 H:\xampp\htdocs\Nova pasta\PHPMailer\class.phpmailer.php(440): PHPMailer->AddAnAddress('ReplyTo', 'REPLY EMAIL', 'YOUR NAME') #1 H:\xampp\htdocs\Nova pasta\mail.php(15): PHPMailer->AddReplyTo('REPLY EMAIL', 'YOUR NAME') #2 H:\xampp\htdocs\Nova pasta\verify.php(78): require('H:\xampp\htdocs...') #3 {main} thrown in H:\xampp\htdocs\Nova pasta\PHPMailer\class.phpmailer.php on line 462
xdye is offline  
Old 03/18/2011, 19:04   #10
 
abrasive's Avatar
 
elite*gold: 0
Join Date: Oct 2009
Posts: 262
Received Thanks: 809
Quote:
Originally Posted by xdye View Post
i get this when try to register an account :/
Code:
Cannot insert the value NULL into column 'UserUID'
The solution for that error is the same as in this post (post #67):
abrasive is offline  
Thanks
1 User
Old 03/18/2011, 19:09   #11
 
RebeccaBlack's Avatar
 
elite*gold: 0
Join Date: Sep 2010
Posts: 520
Received Thanks: 1,286
Quote:
Originally Posted by xdye View Post
i get this when try to register an account :/
Code:
Fatal error: Uncaught exception 'phpmailerException' with message 'Invalid address: REPLY EMAIL' in H:\xampp\htdocs\Nova pasta\PHPMailer\class.phpmailer.php:462 Stack trace: #0 H:\xampp\htdocs\Nova pasta\PHPMailer\class.phpmailer.php(440): PHPMailer->AddAnAddress('ReplyTo', 'REPLY EMAIL', 'YOUR NAME') #1 H:\xampp\htdocs\Nova pasta\mail.php(15): PHPMailer->AddReplyTo('REPLY EMAIL', 'YOUR NAME') #2 H:\xampp\htdocs\Nova pasta\verify.php(78): require('H:\xampp\htdocs...') #3 {main} thrown in H:\xampp\htdocs\Nova pasta\PHPMailer\class.phpmailer.php on line 462

You didn't edit mail.php to your STMP server.
RebeccaBlack is offline  
Old 03/18/2011, 20:07   #12
 
elite*gold: 0
Join Date: Feb 2008
Posts: 2
Received Thanks: 1
Quote:
Originally Posted by tnelis View Post
That is true. That is why I said the rest is up to you.

You need to change the queries a bit, as well as change your login procedure.

Changing the queries in them, you need to have the "verify" half of verify.php to let's say... update Users_Master and change UseQueue to 1, whereas the registering half changes it to 0.

Then alter your login procedure, if UseQueue is 0 Set Status=-2 else Set Status=0
that's kindda similar to what i did i changed the default status when register withtout verify = -1
Quote:
$sql = "INSERT INTO PS_UserData.dbo.Users_Master
(UserUID,UserID,Pw,JoinDate,Admin,AdminLevel,UseQu eue,Status,Leave,LeaveDate,UserType,Point,UserIp)
VALUES ('{$UserUID}','{$username}','{$password}',GETDATE( ),0,0,0,-1,0,GETDATE(),'N',0,'{$user_ip}')";
btw the script was missing itemUID Newsletter and SMS collum, because those collum cant be leave NULL
Quote:
$usde = "INSERT INTO PS_UserData.dbo.Users_Detail
(UserUID,UserID, PwAnswer, PwQuestion, Email, EmailAuthKey, EmailAuth, AdultAuth, NewsLetter, SMS)
VALUES ('{$UserUID}','{$username}','{$Answer}','{$Questio n}','{$Email}','{$activationKey}',0,0,0,0)";
at the end after verify just add
Quote:
$sql="UPDATE Users_Detail SET EmailAuthKey='Verified', EmailAuth=1 WHERE (UserID = '$row[UserID]')
Update Users_Master SET Status = 0 Where (UserID = '$row[UserID]')";
PS:/ on $activationKey you only need 1 mt_rand();
otherwise it will redirect you to a blank page
BTW is this script safe from SQL injection?
kissangel is offline  
Thanks
1 User
Old 03/19/2011, 00:06   #13
 
-III-'s Avatar
 
elite*gold: 0
Join Date: Mar 2011
Posts: 212
Received Thanks: 264
Quote:
Originally Posted by kissangel View Post
that's kindda similar to what i did i changed the default status when register withtout verify = -1

btw the script was missing itemUID Newsletter and SMS collum, because those collum cant be leave NULL

at the end after verify just add
PS:/ on $activationKey you only need 1 mt_rand();
otherwise it will redirect you to a blank page
BTW is this script safe from SQL injection?
If it is based off of Abrasive's script, yes, it has the escape strings and such for the injection protection.

As per the OP, I haven't checked it out, as I see it as an added and unnecessary step for account creation (provided you are already using a form of spam protection). However, if it is also applied for password changes, this becomes far more useful.

Thank you for the release. I am sure many will find it very useful.

-III-
-III- is offline  
Old 03/19/2011, 09:21   #14
 
RebeccaBlack's Avatar
 
elite*gold: 0
Join Date: Sep 2010
Posts: 520
Received Thanks: 1,286
Quote:
Originally Posted by kissangel View Post
btw the script was missing itemUID Newsletter and SMS collum, because those collum cant be leave NULL

at the end after verify just add
PS:/ on $activationKey you only need 1 mt_rand();
otherwise it will redirect you to a blank page
BTW is this script safe from SQL injection?

I did not account for the original tables at the time. My database tables are slightly editted.

I have erased all unnecessary columns in both tables, so I did not check if the original needed certain tables. As for the activationkey, I changed the column length to varchar(MAX)
RebeccaBlack is offline  
Old 03/24/2011, 16:31   #15
 
RebeccaBlack's Avatar
 
elite*gold: 0
Join Date: Sep 2010
Posts: 520
Received Thanks: 1,286
Updated the OP a bit. Tried to add clearer instructions / better files.

If I ever finish the password change to require email, I'll release it as well.
RebeccaBlack is offline  
Reply


Similar Threads Similar Threads
Help with LOTF and Hamachi ID Tyler.PC
08/23/2008 - CO2 Private Server - 5 Replies
I was messaged recently by Tyler.PC saying that the source I used on here for the lotf guide, will get me sued. He said that the source was copyrighted, and that they are going to have my server shut down, and he is gonna have them sue me for using the guide, and source. Is it possible for them to do this? If so, cant TQ sue everyone on here for using there source's? I know some things are changed, but basically still the same. So if anyone can tell me if this is possible, I would appreciate...



All times are GMT +2. The time now is 20:13.


Powered by vBulletin®
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2024 elitepvpers All Rights Reserved.