add postData to get data

This commit is contained in:
2024-12-08 15:24:40 +06:00
parent 91e8b21d39
commit ddcb146952
9 changed files with 585 additions and 393 deletions

View File

@ -107,7 +107,7 @@ function getAccess($key)
global $db;
$result=false;
$sql="select main.p_getaccess(:user_id,:key) as acc;";
$sql="select main.get_access(:user_id,:key) as acc;";
$stmt = $db->prepare($sql);
if(isset($_SESSION['USER_ID']))
$stmt->bindValue(':user_id', $_SESSION['USER_ID'], PDO::PARAM_INT);
@ -517,3 +517,11 @@ function cutBeforeFirst(&$sstr,$fstr)
return $sub;
}
}
function getUID()
{
$data = openssl_random_pseudo_bytes(16);
$data[6] = chr(ord($data[6]) & 0x0f | 0x40);
$data[8] = chr(ord($data[8]) & 0x3f | 0x80);
return vsprintf('%s%s-%s-%s-%s-%s%s%s', str_split(bin2hex($data), 4));
}