Files
ops-Gazelle/sections/user/delete_invite.php
T

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');