<?php
	/* WebWall */
	define("ADMIN", 1);
	require_once '../core.php';
	checkuserloggedoff();
	define("IN_TAB", "tab-[7]", true);
	$page = text_filter($_GET["page"], 1);
	$squery = text_filter(ucfirst(strtolower($_GET["squery"])), 1);
	if($page == "") $page = 0;

	if($_SERVER['REQUEST_METHOD'] == "POST" && $engine_session->getuserrights("ADM"))
	{ 
		$enabled = text_filter($_POST["enabled"], 1);
		$mode = text_filter($_POST["mode"], 1);
		$apiusername = text_filter($_POST["apiusername"], 1);
		$apipassword = text_filter($_POST["apipassword"], 1);
		$apisignature = text_filter($_POST["apisignature"], 1);
		$currencycode = text_filter($_POST["currencycode"], 1);
		$price = $_POST["price"];
		$admin_session->updatepaypalsettings($enabled, $mode, $apiusername, $apipassword, $apisignature, $currencycode, $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->setparameter("serializeHmPayments", $admin_session->serializehmpayments($page, $squery), true);
		$template_session->loadhead($template_session->getlangval(892));
		$template_session->loadlogo(); 
		$template_session->loadmenu(); 
		if($engine_session->getuserrights("VIEW_RANKS"))
		{
			$template_session->loadtpl("payments");
		}
		else
		{
			$template_session->loadtpl("hm_permission");
		}
		$template_session->addline("</div>");
		$template_session->addline("</div>"); 
		$template_session->loadtpl("footer");
		$template_session->loadend();
	}
	else
	{
		$engine_session->headerin();
	}
?>