<?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');

}
session_write_close();

$cn = db_connect();
if (isset($_REQUEST['hash'])) {
	$hash = $_REQUEST['hash'];
} else {
	$hash = '-';
}

if (!isset($_REQUEST['skpollingobject']) || !isset($_REQUEST['skpolltype']) || !is_numeric($_REQUEST['skpollingobject']) || !is_numeric($_REQUEST['skpolltype']) || !isset($_REQUEST['status']) || !is_numeric($_REQUEST['status']) ) {
	ob_end_flush();
	exit;
} else if ($_REQUEST['status'] != db_getPollObjectStatus($cn, $_REQUEST['skpollingobject'], $_REQUEST['skpolltype'])){
	getResource("message.portalwaschangestatus");
	ob_end_flush();
	exit;
}
?>