<?php

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

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

	if (code1_check($_POST['code'], get_code1($_SESSION['user_acc']))) {
		log_info($_SERVER['REMOTE_ADDR'], $_SESSION['user_login'], $_SESSION['user_acc'], 'Transfer attempt correct '.CODE1_NAME.'');
		redirect('authorizing.php');
	}
	else {
		redirect('authorize.php?error=' . urlencode('Invalid '.CODE1_NAME.''));
	}
}

?>