I have users.ini with all users passwords are md5 encrypted.
I edited the admin.sma and implement the md5 password check. But there is an error that i couldn't fix.
On the getAccess function i changed the code like below:
Code:
if (index != -1) {
// i added
new hash[34]
md5(password, hash)
log_amx("Login: ^"%s %s %s^"",hash,password,g_aPassword[index])
//
if (g_aFlags[index] & FLAG_NOPASS){
result |= 8
new sflags[32]
get_flags(g_aAccess[index],sflags,31)
set_user_flags(id,g_aAccess[index])
log_amx("Login: ^"%s<%d><%s><>^" became an admin (account ^"%s^") (access ^"%s^") (address ^"%s^")",
name,get_user_userid(id),authid,g_aName[index] ,sflags,ip)
}
// i changed
else if (equal(hash,g_aPassword[index])) {
//
result |= 12
set_user_flags(id,g_aAccess[index])
new sflags[32]
get_flags(g_aAccess[index],sflags,31)
log_amx("Login: ^"%s<%d><%s><>^" became an admin (account ^"%s^") (access ^"%s^") (address ^"%s^")",
name,get_user_userid(id),authid,g_aName[index] ,sflags,ip)
}
When i tried to connect, on the server console the password fron csusers.ini, the password given and the md5 password is written on the console.
The line written on console is:
Code:
L 09/15/2004 - 23:08:26: [admin.amxx] Login: "a029d0df84eb5549c641e04a9ef389e5 mypass a029d0df84eb5549c641e04a9ef389e"
The first field is md5 of the given password, the second one is the password given and the third one is the password from csusers.ini. The problem is that the third one is 1 character short. I tried some fix on the code but i couldn't fix the error.
Where can be the problem?
Thanks