<?php
	/* WebWall */
	define("ADMIN", 1);
	require_once '../core.php';
	checkuserloggedoff();
	define("IN_TAB", "tab-[3]", true);
	$get["action"] = text_filter($_GET["act"], 1);
	$get["id"] = text_filter($_GET["id"], 1);
	$give["id"] = text_filter($_POST["rank_id"], 1);
	$give["rank"] = text_filter($_POST["rank_type"], 1);

	if($get["action"] == "remove") 
	{ 
		$admin_session->removeHmRank($get["id"]); 
	}
	if($_SERVER['REQUEST_METHOD'] == "POST")
	{ 
		$admin_session->addHmRank($give["id"], $give["rank"]);
	}
	
	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("serializeHmMasters", $admin_session->serializehmmasters(2), true);
		$template_session->setparameter("serializeHmMasters2", $admin_session->serializehmmasters(1), true);
		$template_session->loadhead($template_session->getlangval(334));
		$template_session->loadlogo(); 
		$template_session->loadmenu(); 
		if($engine_session->getuserrights("VIEW_RANKS"))
		{
			$template_session->loadtpl("hm_ranks");
		}
		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();
	}
?>