<?php
	/* WebWall */
	define("ADMIN", 1);
	require_once '../core.php';
	checkuserloggedoff();
	define("IN_TAB", "tab-[6]", true);
	$get["action"] = text_filter($_GET["act"], 1);
	$get["id"] = text_filter($_GET["id"], 1);
	$get["type"] = text_filter($_GET["type"], 1);
	$name = text_filter($_POST["name"], 1);
	$photo_file = $_FILES["photo"];

	if($get["action"] == "remove") 
	{ 
		$admin_session->removegift($get["id"],$get["type"]); 
	}

	if($_SERVER['REQUEST_METHOD'] == "POST")
	{ 
		$admin_session->addgift($name, $photo_file); 
	}

	if($engine_session->getuserrights("ADM") || $engine_session->getuserrights("MOD") && $engine_session->getuserrights("FREE_HM_ACCESS"))
	{
		$template_session->setparameter("serializeHmTabs", $admin_session->serializehmtabs(''.IN_TAB.''), true);
		$template_session->setparameter("serializeHmGifts", $admin_session->serializehmgifts(), true);
		$template_session->loadhead($template_session->getlangval(817));
		$template_session->loadlogo(); 
		$template_session->loadmenu(); 
		if($engine_session->getuserrights("VIEW_RANKS"))
		{
			$template_session->loadtpl("hm_gifts");
		}
		else
		{
			$template_session->loadtpl("hm_permission");
		}
		$template_session->addline('<div id="footerspace"></div>');
		$template_session->addline("</div>");
		$template_session->addline("</div>"); 
		$template_session->loadtpl("footer");
		$template_session->loadend();
	}
	else
	{
		$engine_session->headerin();
	}
?>