<?php require_once('includes/requirecompere.inc.php'); require_once('includes/validation.inc.php'); require_once('includes/message.inc.php'); $mb_id_leader=current_mb_id(); $authcode=TGET('authcode'); $invitecode=TGET('invitecode'); $vcinfo=unserialize(base64_decode($authcode)); $inviteinfostr=base64_decode($invitecode); $inviteinfo=unserialize($inviteinfostr); if (!$vcinfo || !$inviteinfo) { redirect("qx-cmd-team.invite.authenticate.failure.html"); return; } $DBConn->connect(); if (!db_team_is_inviting($DBConn,$inviteinfo['from'],$mb_id_leader)) { redirect("qx-cmd-team.invite.authenticate.failure.html"); return; } if (!validation_use_code($DBConn,$vcinfo['vc_id'],$inviteinfostr,$vcinfo['vc_seed'])) { redirect("qx-cmd-team.invite.authenticate.failure.html"); return; } $DBConn->begin(true); db_update_team_member($DBConn,$inviteinfo['from'],$inviteinfo['to'],'VALID'); $compere=db_load_compere($DBConn,$inviteinfo['to']); $dataset['joiner.cp_name']=$compere['cp_name']; $mail=prepare_email_from_templates('teamjoined.email.subject','teamjoined.email.content',$dataset); send_message( $DBConn, 'INVITE', $inviteinfo['to'], 'COMPERE', $inviteinfo['from'], 'COMPERE', $mail['body'], $mail['subject']); $DBConn->commit(); redirect("qx-cmd-team.invite.authenticate.success.html"); ?>