EDIT
Error with the registration has been repaired.
Issue - Proper success handling has been repaired.
This release is a registration script I made just for the community. Usage is the same as other registration scripts with some minor differences. This script uses a table to store extra data about the player that can be used in other areas such as a forums. now lets get down to business.
1. Features- Inline live validation of Display Names and Usernames
- Account security enhanced with special characters.
- Custom Shaiya Captcha built just for this release.
- Ajax loading of all elements to smooth out the user experience.
- Password Recovery via Display Name and Username with recovery question.
- Live form validation
- Password Encryption
A. Inline live validation of Display Names and Usernames
This feature uses ajax to check if the defined Username or Display Name already exists. The field will highlight red to show unusable names.
Account security enhanced with special characters
To make things harder for those out there that like to brute force logins, I have added support for these special characters.
EXAMPLE This.Is-Valid_
Custom Shaiya Captcha built just for this release.
Included is a custom captcha built to run on lapis identification to bring a nice true Shaiya feel to the human validation.
Ajax loading of all elements to smooth out the user experience.
Using Ajax allows instant alteration of elements in the page without reloading the content completely. This allows responses from the server to be displayed in the modal popup included in this release as the return message container.
Password Recovery via Display Name and Username with recovery question.
Simple, easy, and fast, the incorporated password recovery makes it easy for returning players or current players to regain access to their accounts.
Live form validation
Not only does this instantly check if names are usable but it also displays a red border around all inputs until the input is considered to be valid for use. As an added bonus there has been added a bit of script to prevent the usage of unwanted characters in the input fields. This is of course enforced on the server end as well by way of a custom function to allow certain special characters along with the default alphanumeric characters.
Password Encryption
Password encrypting and decrypting is also provided with this release using PHP's built-in encryption.
2. Screenshots
Here are a couple screenshots showing the default Shaiya theme and the base registration without a theme.
Themed
Basic
3. Setup and Configuration
Usage is very simple and should not take long to setup.
1. Run the provided SQL script to create the table used to store the extra data for the player (Users_Info).
2. Open the file
scripts/dbConn.php and edit your DB login information. Notice there is a check in the top of the page. This little security trick will error the page if a visitor attempts to view it directly.
NOTE If
is used on your server then no edits are needed AT ALL. The script should just work instantly.
3. Open the file
scripts/config_questions.php. This file contains the questions used for the registration and password recovery. Edit these as you will but remember, once used you should not change them, add to them but never change them once used. This will prevent confusion should a player be asked the wrong question to recover a password due to the change.
4. Theme
The Shaiya theme in this can be changed easily by altering the file
css/default.theme.css to use any images or CSS you wish. Its recommended you do not alter
css/styles.css or
css/captcha.css unless you know what your doing to avoid damaging the core framework.
Thats it. Very simple. In the zip file are a themed and un-themed index page and an example of the iframes with sizes to help speed up the setup.
*EDIT* For IIS Users there is a small edit needed. IIS doesn't allow direct variable calls using ...
In order to use this script with IIS, open the index.php page in any editor, navigate down to line number 39 and replace the call for the select box options with this code...
HTML Code:
<?php for($i=0;$i<count($questions);$i++){ ?><option value="<?php echo($i+1);?>"><?php echo $questions[$i];?></option><?php }?>
That should resolve missing questions in the select box for IIS and legacy Xampp(1.7.5 and lower).
5. New Server Installation
The script contains the ability to generate accounts both with or without the UserUID column set to auto increment. If your seeing an error where RowID does not allow NULLS this means your UserUID column is not set to auto increment. This is resolved 1 of 2 ways. Set it in SQL or simply change 1 value in the
scripts\registration.php file. I will not tell you how to set a column to auto increment as this is not an SQL server release. I will however show you how to set this registration to use either method.
Method A.
UserUID Auto Increments
Users_Master has the UserUID set to auto increment.
Method B.
Default OS table configuration
Users_Master has the RowID set to auto increment.
Locate this block in scripts\registration.php....
PHP Code:
$_SESSION['UserUID_AutoIncremented']=true;
//$_SESSION['UserUID_AutoIncremented']=false;
and change it to this ...
PHP Code:
//$_SESSION['UserUID_AutoIncremented']=true;
$_SESSION['UserUID_AutoIncremented']=false;
*NOTE* - If your UserUID column is set to auto increment, RowID column must either be set to accept NULL or removed completely.
6. Troubleshooting
The only visible error is an alert message posted to the user showing all posted variables. This error is the result of the main processing form not having the requirements completed.
Code:
Server reply error
http://yourdomain.com/path/to/file/register.php
post
display_name=Test.Display&user=username&pass=password&pass_val=password &email=email%40smth.com&pass_question=1&pass_quest ion_answer=black&captcha=3&command=register
If the above error is present, you will need to check your connection setup as outlined above (
scripts/dbConn.php) or you need to run the SQL script included to create the needed table for the extra data stored. The possible php errors would be the following.
1. PHP DB Connection Error :
Code:
Warning: odbc_connect() [function.odbc-connect]: SQL error: [Microsoft][ODBC SQL Server Driver][SQL Server]Login failed for user '*** SQL Login ***'., SQL state 28000 in SQLConnect in scripts/dbConn.php on line XX Could Not Connect to ODBC Database!
When using this script without my release you must change the entire connection variable and not the array key.
$dbUser = $_SERVER['DB_USER']
should be
$dbUser = 'YourUsernameHere'
NOT
$dbUser = $_SERVER['YourUsernameHere'].
2. Missing SQL Resource Error : *this is hidden due to the nature of php functions.
Code:
SQL error or missing database
To resolve this repeated error I have created these 2 schema creation scripts to insure the database configuration matches the needs of the script.
Method A
Users_Master_UserUID_AutoIncremented.sql
Method B
Users_Master_Default.sql
This is a failsafe to anyone having issues getting this running on a new server.
1st - Delete your Users_Master table.
2nd - Run the schema script you set the php to use in the method setup.
REQUEST - In order to use this i simply request the header remain intact in the javascript file. This was made entirely for this community and I hope you all enjoy it.
*NOTE* - Setup in part or whole of this script is the responsibility of the user. Posts requesting how to configure a web server or how to install this script will not be humored as all details needed for usage are contained here.
This also does not include email verification as a requirement altho it can be added easily. I chose not to include it because its not easily configured and almost all domains are marked for spam within a few weeks of using email verification.
Sale of this script is forbidden. If you wish to sell my scripts you are also willing to pay for the right to sell them. By selling my scripts you are agreeing to pay a fee set by me for each sale.