• Unfortunately, we have experienced significant hard drive damage that requires urgent maintenance and rebuilding. The forum will be a state of read only until we install our new drives and rebuild all the configurations needed. Please follow our Facebook page for updates, we will be back up shortly! (The forum could go offline at any given time due to the nature of the failed drives whilst awaiting the upgrades.) When you see an Incapsula error, you know we are in the process of migration.

[Share] Ran CP Add-on (Activation Page)

Junior Spellweaver
Joined
Jan 1, 2008
Messages
170
Reaction score
0
I noticed that most of our ran private servers are not open for registration 24/7 and others are closed and you need to request it to be open just to register 1 account. Their main reason is probably to avoid spamming of accounts in their database so to prevent lag. Now this adds more work for admin and gm's of private servers if every minute they open their registration page so to grant the request of their player.

Now, with this Activation Page, you can now open your registration permanently.

To add this on your ran cp, follow this steps: (Note: use the files i've provided to avoid some errors)

1. Open your SQL server management. (I use SQL 2k5, don't know if this works for other sql)
2. Add this table under RanUser>dbo.UserInfo


Column Name: ActivationDate
Data Type: datetime
Allow Nulls: Yes

Next...

Column Name: ActivationCode
Data Type: varchar(21)
Allow Nulls: No

ScreenShot:
Ultimate Ran - [Share] Ran CP Add-on (Activation Page) - RaGEZONE Forums


3. Now, were still on sql server management. Create a new query and paste this scripts:

USE [RanUser]
GO

SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TRIGGER [dbo].[Delete_Inactive] ON [dbo].[UserInfo]
after update
as
BEGIN

DELETE FROM UserInfo
WHERE UserAvailable = 0 and
DATEDIFF(day,[UserInfo].ActivationDate, GETDATE()) >= 2

END
This script will delete the account which are not activated within 2 days. To change the day, edit the red text. This script has two requirements before it automatically execute, first is UserAvailable and second is the ActivationDate. If one of this two requirements were not met, the script won't execute. ALTER TRIGGER for those who have this trigger before.

Now another script is this:

USE RanUser

set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
GO

CREATE TRIGGER [dbo].[Account_Activated] ON [dbo].[UserInfo]
after update
as
BEGIN

Update [UserInfo] set [UserInfo].ActivationDate=Null
From UserInfo
Where UserAvailable = 1

End
About this script. This makes safe your UserInfo database. The action of this script is once the account is activated, ActivationDate will be set to Null making the first script invalid since it won't meet its requirements.

4. Add this to your query.php

DEFINE("SELECT_USER_FULLINFO1", "SELECT UserName, UserPass, UserPass2, UserLoginState, UserEmail, UserNum, UserPoint, ActivationCode FROM UserInfo WHERE UserName = '%s' ");

DEFINE("UPDATE_ACCOUNT","UPDATE UserInfo SET UserAvailable = '%s' WHERE UserName = '%s' ");

Since we don't have the same tables in our dbo.UserInfo, add this at the end of your INSERT_USERAUTH

(ActivationDate, ActivationCode)
VALUES (getdate(),'%s')");

It should look like this:

DEFINE("INSERT_USERAUTH", "INSERT INTO UserInfo (UserName, UserID, UserPass, UserPass2, UserType, UserAvailable, CreateDate, ChaRemain, ChaTestRemain, UserEmail, UserPoint, WebLoginState, ActivationDate, ActivationCode)
VALUES ('%s','%s','%s','%s','1','0',getdate(),'2','2','%s','0','1',getdate(),'%s')");
The red text are the one we insert.

5. Now is to download my files which contain the ff:

config.php (or you can use your old config.php no problem with that)
index.php
activateaccount.php
register.php
login.php

put index.php and config.php to your
C:\Program Files\Abyss Web Server\htdocs\ran

and put activateaccount.php register.php and login.php to your
C:\Program Files\Abyss Web Server\htdocs\ran\page

i've also included the buttons just paste them to
C:\Program Files\Abyss Web Server\htdocs\ran\img

6. Your finish, try to browse your activateaccount.php


That's all and thank you...

Addition:
If you wanna send their account info upon finish registration.. Open register.php find and replace this lines:

echo "<div align=center><font color=green size=2><strong>Account has been created sucessfully under the ff info:<br><br>
<font color=orange size=2><strong>UserName :</strong></font> <font color=red size=2><strong>$account</strong></font><br>
<font color=orange size=2><strong>Password :</strong></font> <font color=red size=2><strong>$password</strong></font><br>
<font color=orange size=2><strong>Password #2 :</strong></font> <font color=red size=2><strong>$sandi</strong></font><br>
<font color=orange size=2><strong>Email :</strong></font> <font color=red size=2><strong>$email</strong></font><br><br>
Please save your account info for future use.</strong></font><br><br></div>";
with this one:

if($CONFIG['email']==0) {
echo "<font color=green size=2><strong>Your password has been reseted to...</strong></font><br><font color=green size=2>{$newpassword}</font><br><br>";
} elseif($CONFIG['email']==1) {
sendemail($CONFIG['emailsmtp'], $CONFIG['emailuser'], $CONFIG['emailpass'], $CONFIG['emailaddress'], $CONFIG['servername'], "Lost Password", $useremail, $account, $newpassword, $ssn, "<strong>Your password has been reseted and sent to your email.</strong>");
}
and open your config.php and find this line:

$CONFIG['email'] = "1"; //1=send 0=not send
 

Attachments

You must be registered for see attachments list
Last edited:
Junior Spellweaver
Joined
Nov 28, 2004
Messages
131
Reaction score
1
thanks sir UltimateRan this is very useful to avoid account spamming on my server, im gonna try this...

btw for those who want to setup SMTP check this:
 
Junior Spellweaver
Joined
Jan 1, 2008
Messages
170
Reaction score
0
thanks sir UltimateRan this is very useful to avoid account spamming on my server, im gonna try this...

btw for those who want to setup SMTP check this:

no problem.. please post for comments and some errors so i can fix them..
 
Elite Diviner
Joined
Jul 5, 2007
Messages
496
Reaction score
0
Wow, thanks for sharing dude, gonna try this.
 
Junior Spellweaver
Joined
Jan 3, 2008
Messages
182
Reaction score
179
what i use for my smtp server is postcastserver. I use this for my helpdesk.
 
Newbie Spellweaver
Joined
Feb 4, 2007
Messages
88
Reaction score
0
no problem.. have you tried it? is it working?

i know 1 error you will encounter.. the INSERT_USERAUTH query.. we don't have same tables in our dbo.UserInfo
can u make mirror link, becouse my isp is mediafire suck
 
Junior Spellweaver
Joined
Jan 1, 2008
Messages
170
Reaction score
0
don't know what hosting site is good.. i always use mediafire.. tell me where to upload and i'll upload it there
 
Experienced Elementalist
Joined
Apr 6, 2007
Messages
248
Reaction score
1
ouch it's good but i dont know how to use...the outlook express....the link that ultimate ran has given in a guide on how to use gmail as an smtp host....hmmmmm, i think that guide is not for a beginner in outlook express it's just a guide on using the gmail accnts on it...hayz.............i gotta sent those verification's via manual..T_T
 
Junior Spellweaver
Joined
Aug 13, 2007
Messages
163
Reaction score
16
when i use this my ran cp error. i log in my rancp then message box appear then say no such account.
then i look in my database my character was deleted in charinfo table T_T and all my players went to rancp was also deleted T_T how can i avoid this error T_T pls need your fast reply!
 
Banned
Banned
Joined
Apr 2, 2007
Messages
863
Reaction score
14
Waiting for positive response before it goes to sticky threads.
 
Junior Spellweaver
Joined
Jan 1, 2008
Messages
170
Reaction score
0
when i use this my ran cp error. i log in my rancp then message box appear then say no such account.
then i look in my database my character was deleted in charinfo table T_T and all my players went to rancp was also deleted T_T how can i avoid this error T_T pls need your fast reply!

just use the files i've provided.. backup first yours and paste overwrite.. you have that error because we have different tables in dbo.UserInfo or edit your query.php find INSERT_USERAUTH then at the end add this:

ActivationCode
'%s'
 
Last edited:
Banned
Banned
Joined
Apr 2, 2007
Messages
863
Reaction score
14
Thread Starter if you want to add something.. just edit the first post.. to make the guide complete.. members might ignore that post and ask some redundant questions.
 
Junior Spellweaver
Joined
Aug 13, 2007
Messages
163
Reaction score
16
Back
Top