<?php
ob_start();
if(!(is_readable(realpath(dirname(__FILE__).'/../').'/include/includesroutines.inc'))) {
	die('Error - Could not open or read file '.realpath(dirname(__FILE__).'/../').'/include/includesroutines.inc');
} else {
	include_once(realpath(dirname(__FILE__).'/../').'/include/includesroutines.inc');

}
$cn = db_connect();

if (isset($_REQUEST['idbranch'])) {
	$idbranch = $_REQUEST['idbranch'];
	$skbranch = db_getSKBranch($cn,$idbranch);	
} else if (isset($_REQUEST['skbranch'])) {
	$skbranch = $_REQUEST['skbranch'];
	$idbranch = db_getIDBranch($cn, $skbranch );	
} else {
	$skbranch = db_getMainSKBranch($cn);
	$idbranch = db_getMainIDBranch($cn);	
}

if (getSetting('portal','useRights',0) == 1 && IsUserLogin() && isset($_REQUEST['oguid'])){
		$usrarr = GetUserIDs();
		db_resetForumMessagesSawDate($cn, $_REQUEST['oguid'], $usrarr[0], $skbranch);
} else {
	echo"[{}]";
	ob_end_flush();
	exit;
}
?>