<?php

$dont_close_session = true;
include_once "../common.inc.php";
AccessCheck();

if ($session->isAdmin()) {
	// we're gonna make a license file for all users and profiles
	setGlobalSetting("SoftwareSubscription", false);
	echo "<br>Your Logaholic Pro subscription has been cancelled.";
} else {
	//we're gonna store this in the users info
	unset($session->metadata["user_ss"]);
	$metadata = json_encode($session->metadata);
	$q = "UPDATE ".TBL_USERS." SET metadata = ? WHERE username = ?";
	$db->Execute($q, array($metadata, $session->username));
	unset($_SESSION['userinfo']);
	session_write_close();
	echo "<br>Your Logaholic Pro subscription has been cancelled.";	
}
?>