<?php

	include("../core/config.php");
	if($user->signed) redirect('../');
	//Proccess Activation
	if(count($_GET["ac"])){
		//Activate User
		$activated = $user->activate($_GET["ac"]);
		if(!$activated){
			$_SESSION['ErrorMsgs'] = $user->error();
			$_SESSION["regData"] = $_GET;
			redirect($user->page_rel_path . "?page=login");		
		}else{
			$_SESSION['NoteMsgs'][] = "Activation Successful";
			$_SESSION['NoteMsgs'][] = "You may login now!";		
			redirect($user->page_rel_path . "?page=login");
		}
		
	}
	else{
		redirect();
	}

?>
