Jump to content

MySQL help needed


Newbie

Recommended Posts

function server.login( thePlayer, Username, Password ) 
    --// Login the Player 
    if ( thePlayer ~= "" and Username ~= "" and Password ~= "" ) then 
        if ( getElementData( thePlayer, "Connection" ) ~= 1 ) then 
            local accounts = dbQuery( server.connection, "SELECT * FROM hhc_accounts WHERE Accountname = '" .. Username .. "'" ) 
            local result, rows, errormessage = dbPoll( accounts, -1 ) 
             
            if ( rows == 1 ) then 
                for i, row in pairs( result ) do 
                    local pass = string.upper( row['Password'] ) 
                    local salt = row['Salt'] 
                    local gens = md5( md5( salt .. pass .. salt ) ) 
                    local ePass = md5( Password ) 
                    local salted = md5( md5( salt .. ePass .. salt ) ) 
                     
                    if ( gens == salted ) then --bla bla bla  
  

I've set data in dabatase correctly with Accountname "aaa" and Password "aaa"

The password is coded by md5, can someone help me to remove coding and just read the password normally

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...