mirror of
https://github.com/OPSnet/Gazelle.git
synced 2026-10-22 01:03:21 -04:00
18 lines
347 B
PHP
18 lines
347 B
PHP
<?php
|
|
authorize();
|
|
|
|
$inviteKey = trim($_GET['invite']);
|
|
$userId = $DB->scalar("
|
|
SELECT InviterID FROM invites WHERE InviteKey = ?
|
|
", $inviteKey
|
|
);
|
|
if (is_null($userId)) {
|
|
error(404);
|
|
}
|
|
if ($userId != $Viewer->id()) {
|
|
error(403);
|
|
}
|
|
|
|
(new Gazelle\User($userId))->removeInvite($inviteKey);
|
|
header('Location: user.php?action=invite');
|