1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-18 04:12:00 +02:00

Secure-Image is now alphanumeric.

This commit is contained in:
Cameron
2016-02-26 12:36:35 -08:00
parent d295a434c3
commit c2349c6876
3 changed files with 26 additions and 21 deletions

View File

@@ -49,18 +49,19 @@ class secure_image
return call_user_func($user_func);
}
$pref = e107::getPref();
// $pref = e107::getPref();
// $sql = e107::getDb();
mt_srand ((double)microtime() * 1000000);
$maxran = 1000000;
$rand_num = mt_rand(0, $maxran);
$datekey = date("r");
$rcode = hexdec(md5($_SERVER['HTTP_USER_AGENT'] . serialize($pref). $rand_num . $datekey));
$code = substr($rcode, 2, 6);
// mt_srand ((double)microtime() * 1000000);
// $maxran = 1000000;
// $rand_num = mt_rand(0, $maxran);
// $datekey = date("r");
// $rcode = hexdec(md5($_SERVER['HTTP_USER_AGENT'] . serialize($pref). $rand_num . $datekey));
// $code = substr($rcode, 2, 6);
$recnum = $this->random_number;
// $del_time = time()+1200;
// $sql->insert("tmp", "'{$recnum}',{$del_time},'{$code}'");
$code =e107::getUserSession()->generateRandomString('*****');
$_SESSION['secure_img'][$recnum] = $code;