mirror of
https://github.com/grocy/grocy.git
synced 2025-10-12 16:44:55 +00:00
Revise session handling to prepare API authentication via token
This commit is contained in:
@@ -61,3 +61,14 @@ function GetClassConstants($className)
|
||||
$r = new ReflectionClass($className);
|
||||
return $r->getConstants();
|
||||
}
|
||||
|
||||
function RandomString($length, $allowedChars = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ')
|
||||
{
|
||||
$randomString = '';
|
||||
for ($i = 0; $i < $length; $i++)
|
||||
{
|
||||
$randomString .= $allowedChars[rand(0, strlen($allowedChars) - 1)];
|
||||
}
|
||||
|
||||
return $randomString;
|
||||
}
|
||||
|
Reference in New Issue
Block a user