Benim giriş çalışmıyor gelmek nedenle ben bunu PHP ve JavaScript kullanarak duyuyorum.
PHP:
$users = sql("SELECT * FROM USERS WHERE SITE_ID='${CONFIG["ID"]}'");
if($_REQUEST["logindata"]){
$logindata = $_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;
}
JavaScript:
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))
});
}),
$. SHA1 fonksiyonu, tek bir dize verilir ise bunun bir sha1 ve iki eğer bir hmac_sha1 sonuç verecektir.