21.06.2011, 17:08
Hello my system is a little bit unsafe for those who have the FTP.
They can read passwords.
This is the register hash, dini_Set(file,"Password",params); but how to make it a hashed pass in the .ini?
And when im logging in:
Thanks for helping.
They can read passwords.
This is the register hash, dini_Set(file,"Password",params); but how to make it a hashed pass in the .ini?
And when im logging in:
Код:
dcmd_login(playerid,params[]) { new file[256],n[MAX_PLAYER_NAME]; GetPlayerName(playerid,n,MAX_PLAYER_NAME); format(file,sizeof(file),"gio_admin/Users/%s.sav",n); if(!dini_Exists(file)) return SendClientMessage(playerid,YELLOW,"You are not registered! Please /register"); if(PInfo[playerid][Logged] == 1) return SendClientMessage(playerid,LIGHTBLUE,"You are already logged in!"); if(PInfo[playerid][Regged] == 0) return SendClientMessage(playerid,ORANGE,"You are not registered! Please /register"); if(strlen(params)) { new pass[256]; pass = dini_Get(file,"Password"); if(dini_Exists(file)) { if(strcmp(params,pass,false) != 0) { SendClientMessage(playerid,YELLOW,"Wrong Password!"); } else { dini_IntSet(file,"Logged",1); PInfo[playerid][Logged] = 1; PInfo[playerid][Level] = dini_Int(file,"Level"); SendClientMessage(playerid,YELLOW,"You have now logged in!"); return 1; } } } else { SendClientMessage(playerid,GREY,"USAGE: /login <Password>"); return 1; } return 1; }