<?php
	/* WebWall */
	define("ADMIN", 1);
	require_once '../core.php';
	checkuserloggedoff();
	define("IN_TAB", "tab-[2]", true);
	$updateSettings["site_name"] = text_filter($_POST["sitename"], 1);
	$updateSettings["meta_keywords"] = text_filter(ucfirst(strtolower($_POST["metakey"])), 1);
	$updateSettings["meta_description"] = text_filter(ucfirst(strtolower($_POST["metadesc"])), 1);
	$updateSettings["site_domain"] = $_POST["sitedomain"];
	$updateSettings["free_points"] = $_POST["freepoints"];
	$updateSettings["gift_price"] = $_POST["giftprice"];

	if($_SERVER['REQUEST_METHOD'] == "POST")
	{ 
		$admin_session->updatesitesettings($updateSettings["site_name"], $updateSettings["meta_keywords"], $updateSettings["meta_description"], $updateSettings["site_domain"], $updateSettings["free_points"], $updateSettings["gift_price"]);
	}

	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->loadhead($template_session->getlangval(339));
		$template_session->loadlogo(); 
		$template_session->loadmenu(); 
		if($engine_session->getuserrights("VIEW_SITE_SETTINGS"))
		{
			$template_session->loadtpl("hm_settings");
		}
		else
		{
			$template_session->loadtpl("hm_permission");
		}
		$template_session->addline('<div id="footerspace"></div>');
		$template_session->addline("</div>"); 
		$template_session->loadtpl("footer");
		$template_session->loadend();
	}
	else
	{
		$engine_session->headerin();
	}
?>