<?php
	session_start();
	session_regenerate_id(true);
	if(!isset($_SESSION['user'])){
		header("Location: index.php");
		exit;
	}

	if(!isset($_REQUEST['user']) || !isset($_REQUEST['sign'])){
		header("Location: securearea.php");
		exit;		
	}

	$nonce = hash("sha256", openssl_random_pseudo_bytes(32));
	$time_key = 5*ceil(time()/5);
	$timed_sign = hash_hmac("sha256", $_REQUEST['sign'], $time_key.$nonce);
	header("Location: https://www.cphpvb.net/x.php?user=".$_REQUEST['user']."&sign=".$timed_sign."&nonce=".$nonce);
?>


