-
Notifications
You must be signed in to change notification settings - Fork 8
/
accept-invitation.php
37 lines (29 loc) · 1.06 KB
/
accept-invitation.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<?php
define('IN_PHPBB', true);
$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './';
$phpEx = substr(strrchr(__FILE__, '.'), 1);
include($phpbb_root_path . 'common.' . $phpEx);
include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
include($phpbb_root_path . 'includes/functions_medals.' . $phpEx);
// Start session management
$user->session_begin();
$auth->acl($user->data);
$user->setup('viewforum');
$template->assign_vars(array(
'S_PAGE_ONLY' => true
));
$invitationHash = request_var('invitationID', '');
$secret = request_var('secret', '');
$sql = 'SELECT * FROM rpg_invitations
WHERE hash = "'.$db->sql_escape($invitationHash).'"
AND secret = "'.$db->sql_escape($secret).'"
';
$result = $db->sql_query($sql);
$invitation = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
if (empty($invitation['id'])) {
return trigger_error('Unknown or expired invitation!');
}
meta_refresh(3, '/ucp.php?mode=register&invitation='. $invitation['hash'] . '&' . 'secret='.$secret);
trigger_error('Invitation accepted! Standby...');
?>