|
|
@ -140,7 +140,8 @@ function msgEncode($cmd, $id, $fields, $user) |
|
|
|
|
|
|
|
|
|
|
|
$now = time(); |
|
|
|
$now = time(); |
|
|
|
$t = $now % 10000; |
|
|
|
$t = $now % 10000; |
|
|
|
$msg = $cmd . $send_sep . $id.$t . $send_sep; |
|
|
|
$cs = intval(floor(microtime(true) * 100) % 100); |
|
|
|
|
|
|
|
$msg = $cmd . $send_sep . $id.$t.'x'.$cs . $send_sep; |
|
|
|
foreach ($fields as $name => $value) |
|
|
|
foreach ($fields as $name => $value) |
|
|
|
$msg .= $name . $val_sep . $value . $fld_sep; |
|
|
|
$msg .= $name . $val_sep . $value . $fld_sep; |
|
|
|
$msg .= 'createcode' . $val_sep . 'php' . $fld_sep; |
|
|
|
$msg .= 'createcode' . $val_sep . 'php' . $fld_sep; |
|
|
@ -175,6 +176,8 @@ function homeInfo($user) |
|
|
|
function checkPass($user, $pass, $twofa) |
|
|
|
function checkPass($user, $pass, $twofa) |
|
|
|
{ |
|
|
|
{ |
|
|
|
$passhash = myhash($pass); |
|
|
|
$passhash = myhash($pass); |
|
|
|
|
|
|
|
if (!nuem($twofa)) |
|
|
|
|
|
|
|
$twofa = trim($twofa); |
|
|
|
if (nuem($twofa)) |
|
|
|
if (nuem($twofa)) |
|
|
|
$twofa = 0; |
|
|
|
$twofa = 0; |
|
|
|
$flds = array('username' => $user, 'passwordhash' => $passhash, |
|
|
|
$flds = array('username' => $user, 'passwordhash' => $passhash, |
|
|
@ -190,6 +193,8 @@ function setPass($user, $oldpass, $newpass, $twofa) |
|
|
|
{ |
|
|
|
{ |
|
|
|
$oldhash = myhash($oldpass); |
|
|
|
$oldhash = myhash($oldpass); |
|
|
|
$newhash = myhash($newpass); |
|
|
|
$newhash = myhash($newpass); |
|
|
|
|
|
|
|
if (!nuem($twofa)) |
|
|
|
|
|
|
|
$twofa = trim($twofa); |
|
|
|
if (nuem($twofa)) |
|
|
|
if (nuem($twofa)) |
|
|
|
$twofa = 0; |
|
|
|
$twofa = 0; |
|
|
|
$flds = array('username' => $user, 'oldhash' => $oldhash, |
|
|
|
$flds = array('username' => $user, 'oldhash' => $oldhash, |
|
|
@ -204,6 +209,8 @@ function setPass($user, $oldpass, $newpass, $twofa) |
|
|
|
function resetPass($user, $newpass, $twofa) |
|
|
|
function resetPass($user, $newpass, $twofa) |
|
|
|
{ |
|
|
|
{ |
|
|
|
$newhash = myhash($newpass); |
|
|
|
$newhash = myhash($newpass); |
|
|
|
|
|
|
|
if (!nuem($twofa)) |
|
|
|
|
|
|
|
$twofa = trim($twofa); |
|
|
|
if (nuem($twofa)) |
|
|
|
if (nuem($twofa)) |
|
|
|
$twofa = 0; |
|
|
|
$twofa = 0; |
|
|
|
$flds = array('username' => $user, 'newhash' => $newhash, '2fa' => $twofa); |
|
|
|
$flds = array('username' => $user, 'newhash' => $newhash, '2fa' => $twofa); |
|
|
|