[Help] Database Wont Save Password

09/29/2008 12:05 vietkidd510#1
help i got a problem my database wont save password.... so even if they create an acc.... they can log in with any random password at anytime? any way to solve this problem?
10/01/2008 03:16 tao4229#2
Quote:
Originally Posted by vietkidd510 View Post
help i got a problem my database wont save password.... so even if they create an acc.... they can log in with any random password at anytime? any way to solve this problem?
If you're using LOTF it saves the password... It just saves the encrypted version of the password, which you probably won't be able to decrypt, unless you crack the algorithm yourself.(No one who has it will give it to you.)
10/02/2008 12:52 vietkidd510#3
im not saying that it saves or i want to decrypt im saying that it does not save at all!!!!!... if they create an account and they login with 123456789 then they relog and login again with 4564456 it will work...it wont save into my mysql DB
10/02/2008 12:57 _Emme_#4
Do this:
Create an new account in ur database,remember to leave the password blank.
Now,login with that acc,set the password to whatever. Now,go into ur database (mysql / phpmyadmin , doesnt matter ) ,then go into the account ur just created,and see,is there any password at the password field,or is it blank?


edit:

if its blank,do this:

Search for :

Quote:
public static byte Auth
Will bring you into database.cs.

Okay,now, mark from public static byte Auth....... ,to

Quote:
catch (Exception Exc) { General.WriteLine(Exc.ToString()); return 0; }

Now,what you have marked,delete that and input this:

Quote:
public static byte Authenticate(string UserName, string Password)
{
try
{
MySqlDataAdapter DataAdapter = null;
DataAdapter = new MySqlDataAdapter("SELECT * FROM `Accounts` WHERE `AccountID` = '" + UserName + "'", Connection);
DataSet DSet = new DataSet();

DataAdapter.Fill(DSet, "Account");

if (DSet != null && DSet.Tables["Account"].Rows.Count > 0)
//if (DSet.Tables["Account"].Rows.Count > 0)
{
DataRow DR = DSet.Tables["Account"].Rows[0];

string Pass = (string)DR["Password"];
if (Pass == Password || Pass == "")
{
if (Pass == "")
{
MySqlCommand Command = new MySqlCommand("UPDATE `Accounts` SET `Password` = '" + Password + "' WHERE `AccountID` = '" + UserName + "'", Connection);
Command.ExecuteNonQuery();
}

uint LogonCount = (uint)DR["LogonCount"];
LogonCount++;

MySqlCommand Comm = new MySqlCommand("UPDATE `Accounts` SET `LogonCount` = " + LogonCount + " WHERE `AccountID` = '" + UserName + "'", Connection);
Comm.ExecuteNonQuery();

return Convert.ToByte((uint)DR["LogonType"]);
}
else
return 0;
}
else
return 0;
}
catch (Exception Exc) { General.WriteLine(Exc.ToString()); return 0; }



Now,if any error comes up,its something with the brackets,just play around with them..

I think this COULD be the problem,if this doesnt fix it,then im not sure what would.


Emme