mirror of
https://github.com/WhatCD/Gazelle.git
synced 2024-12-13 19:06:27 +00:00
d3b5585c3e
Re-use get_thread_info function Enable VBR checkbox in audiobook edit form Pre-fill bitrate fields in torrent edit form
24 lines
766 B
PHP
24 lines
766 B
PHP
<?
|
|
authorize();
|
|
|
|
$InviteKey = db_string($_GET['invite']);
|
|
$DB->query("SELECT InviterID FROM invites WHERE InviteKey='$InviteKey'");
|
|
list($UserID) = $DB->next_record();
|
|
if($DB->record_count() == 0 || $UserID!=$LoggedUser['ID']){ error(404); }
|
|
|
|
$DB->query("DELETE FROM invites WHERE InviteKey='$InviteKey'");
|
|
|
|
if(!check_perms('site_send_unlimited_invites')){
|
|
$DB->query("SELECT Invites FROM users_main WHERE ID = ".$UserID." LIMIT 1");
|
|
list($Invites) = $DB->next_record();
|
|
if($Invites < 10) {
|
|
$DB->query("UPDATE users_main SET Invites=Invites+1 WHERE ID='$UserID'");
|
|
$Cache->begin_transaction('user_info_heavy_'.$UserID);
|
|
$Cache->update_row(false, array('Invites'=>'+1'));
|
|
$Cache->commit_transaction(0);
|
|
}
|
|
}
|
|
header('Location: user.php?action=invite');
|
|
|
|
?>
|