<?php

require_once('config/config.php');
require_once("foo/functions.php");
dbconnect();
session_start();

if ($_SERVER['REQUEST_METHOD'] === 'POST') {

	if (code2_check($_POST['code'], get_code2($_SESSION['user_acc']))) {
		log_info($_SERVER['REMOTE_ADDR'], $_SESSION['user_login'], $_SESSION['user_acc'], 'Transfer attempt correct '.CODE2_NAME.'');
		redirect('verifying.php');
	}
	else {
		redirect('verify.php?error=' . urlencode('Invalid '.CODE2_NAME.''));
	}
}

?>