- Joined
- Dec 13, 2007
- Messages
- 613
- Reaction score
- 161
Below you`ll find the Login API , it will stop users from logging in with any password (merely just a fix), also the password is stored in MD5 form in Passphrase field in DNMembership.Accounts
Also here is a small script that i used in website for account creation.
I don't see very much development around here ,developers get out of your caves and share with the community.
PHP:
<?php
define(DB_HOST, "127.0.0.1");
define(DB_USER, "DragonNest");
define(DB_PASSWORD, "dbUserPassHere");
$id = $_POST['id'];
$pass = $_POST['password'];
if(isset($id) && isset($pass)) {
mssql_connect(DB_HOST,DB_USER,DB_PASSWORD);
mssql_select_db("DNMembership"); //ip .. others
$exists = mssql_query("Select AccountID from Accounts where AccountName='$id'");
if(mssql_num_rows($exists) > 0)
{
$login = mssql_query("Select AccountID from Accounts where AccountName='$id' and Passphrase=0x$pass");
if(mssql_num_rows($login) > 0) {
echo "S000"; //all ok
}else{
echo "E203"; //incorrect password
}
}else{
echo "E202"; //account does not exist
}
}
?>
Also here is a small script that i used in website for account creation.
PHP:
$SQL->select("DNMembership");
$SQL->query("insert into dbo.Accounts (AccountName,Passphrase,AccountLevelCode,SecondAuthFailCount,SecondAuthCode,SecondAuthLockFlag,CharacterCreateLimit,CharacterMaxCount,RegisterDate,PublisherCode) values ('$user',CONVERT(BINARY(20),HashBytes('MD5', '$pass'),2),0,0,1,'false',4,8,GETDATE(),0)");
I don't see very much development around here ,developers get out of your caves and share with the community.