My login will not work and i do not see why? [PLEASE-HELP]

021633

New Member
For come reason my login does not work I am using PHP and JavaScript to do so.PHP:\[code\]$users = sql("SELECT * FROM USERS WHERE SITE_ID='${CONFIG["ID"]}'");if($_REQUEST["logindata"]){ $logindata = http://stackoverflow.com/questions/3848519/$_REQUEST["logindata"]; $now = array_shift(explode(" ",microtime())); if($_REQUEST["time"] < strtotime("+10 sec",$now) && $_REQUEST["time"] > strtotime("-10 sec",$now)) exit(json_encode(array("TYPE"=>"FUNCTION","FUNCTION"=>"(\$login.failed(\"Time out for this request.. (Go away bots)\"))"))); foreach($users as $user){ if(hash_hmac("sha1",$user["LOGIN_SALT"],hash_hmac("sha1",$_SERVER["REMOTE_ADDR"],$_REQUEST["time"])) == $logindata){ $_SESSION = $user; $_SESSION["ACTIVE_IP"] = $IP; sql("UPDATE USERS SET ACTIVE_IP='${IP}' WHERE LOGIN_SALT='${user["LOGIN_SALT"]}'",0); $result = json_encode(array("TYPE"=>"FUNCTION","FUNCTION"=>"(\$login.success())")); } } !$result ? $result = json_encode(array("TYPE"=>"FUNCTION","FUNCTION"=>"(\$login.failed())")) : void;}\[/code\]JavaScript:\[code\] login: (function () { $("#ajax_loading").fadeIn("fast"); $("[type=submit]").fadeOut("fast"); $tmp.time = "" + (new Date()).valueOf(); return $functions.request({ type: "plugin", plugin: "login", time: $tmp.time, logindata: $.sha1($.sha1($.sha1($("#username").val(),$("#password").val()),$client.domain),$.sha1($client.IP,$tmp.time)) }); }),\[/code\]The $.sha1 function, if one string is given it is a sha1 of it and if two it will give a hmac_sha1 result.
 
Back
Top