Generate a random string as invite code
parent
8c7a31d88a
commit
57ff06d418
|
@ -31,7 +31,7 @@
|
||||||
$validator = new FormValidator(array()); // Needed only for CSRF token validation
|
$validator = new FormValidator(array()); // Needed only for CSRF token validation
|
||||||
|
|
||||||
if($validator->isValid($_POST)) {
|
if($validator->isValid($_POST)) {
|
||||||
$inviteID = md5(time().$_SESSION['UUID'].rand(11111, 9999999));
|
$inviteID = bin2hex(random_bytes(16));
|
||||||
$link = "https://".$_SERVER['SERVER_NAME']."/index.php?page=register&code=".$inviteID;
|
$link = "https://".$_SERVER['SERVER_NAME']."/index.php?page=register&code=".$inviteID;
|
||||||
|
|
||||||
$statement = $RUNTIME['PDO']->prepare('INSERT INTO `InviteCodes` (`InviteCode`) VALUES (:InviteCode)');
|
$statement = $RUNTIME['PDO']->prepare('INSERT INTO `InviteCodes` (`InviteCode`) VALUES (:InviteCode)');
|
||||||
|
|
Loading…
Reference in New Issue