<?php
session_start();
require("../functions.php");
$config = loadConfig();
if(o_login_check($_SESSION['user'],$_SESSION['admin_pass'])) {
	$opbconf = explode(', ',file_get_contents('opbconf.txt'));
	$http_query = http_build_query(array('host'=>$_SERVER['SERVER_NAME'],'ctkey'=>openssl_encrypt($opbconf[0],'AES-256-CBC',$opbconf[0]),'date'=>$_SESSION['opb_date']));
	$stream = stream_context_create(array('http'=>array('method'=>'POST','user_agent'=>'Opolytics Backup API Bot 1.0','content'=>$http_query,'header'=>'Content-type: application/x-www-form-urlencoded')));
	echo file_get_contents('https://opolytics.de.cool/opb/request.php',false,$stream);
	echo ' Request Completed.';
}
?>