2013-06-29 04:46:10 +00:00
|
|
|
<?php
|
2013-09-13 22:39:03 +00:00
|
|
|
/**
|
|
|
|
* This function is beign used to load info that's needed for the syncing page.
|
|
|
|
* this function is used for notifying admins that there are unsynced changes, a brief overview of the non syned changes will be shown. The entries are being loaded here
|
|
|
|
* so that they can be passed to the template itself. Only admins can browse this page, others will be redirected to an error page.
|
|
|
|
* @author Daan Janssens, mentored by Matthew Lagoe
|
|
|
|
*/
|
2013-08-05 03:37:18 +00:00
|
|
|
function syncing(){
|
2014-09-03 05:06:43 +00:00
|
|
|
|
2013-09-15 17:44:24 +00:00
|
|
|
if(Ticket_User::isAdmin(unserialize($_SESSION['ticket_user']))){
|
2014-09-03 05:06:43 +00:00
|
|
|
|
2013-09-13 22:39:03 +00:00
|
|
|
//return a paginated version of all unsynced changes.
|
2013-08-05 03:37:18 +00:00
|
|
|
$pagination = new Pagination("SELECT * FROM ams_querycache","lib",5,"Querycache");
|
2013-08-05 03:27:19 +00:00
|
|
|
$pageResult['liblist'] = Gui_Elements::make_table($pagination->getElements() , Array("getSID","getType"), Array("id","type"));
|
|
|
|
$pageResult['links'] = $pagination->getLinks(5);
|
|
|
|
$pageResult['lastPage'] = $pagination->getLast();
|
|
|
|
$pageResult['currentPage'] = $pagination->getCurrent();
|
2014-09-03 05:06:43 +00:00
|
|
|
|
2013-09-15 17:44:24 +00:00
|
|
|
global $INGAME_WEBPATH;
|
|
|
|
$pageResult['ingame_webpath'] = $INGAME_WEBPATH;
|
2014-09-03 05:06:43 +00:00
|
|
|
|
2013-07-03 16:49:23 +00:00
|
|
|
//check if shard is online
|
|
|
|
try{
|
2013-07-10 10:36:14 +00:00
|
|
|
$dbs = new DBLayer("shard");
|
2013-07-03 16:49:23 +00:00
|
|
|
$pageResult['shard'] = "online";
|
|
|
|
}catch(PDOException $e) {
|
|
|
|
$pageResult['shard'] = "offline";
|
2013-06-29 17:05:54 +00:00
|
|
|
}
|
2013-07-03 16:49:23 +00:00
|
|
|
return $pageResult;
|
|
|
|
}else{
|
|
|
|
//ERROR: No access!
|
|
|
|
$_SESSION['error_code'] = "403";
|
2014-09-03 05:36:10 +00:00
|
|
|
header("Cache-Control: max-age=1");
|
2013-07-03 16:49:23 +00:00
|
|
|
header("Location: index.php?page=error");
|
2014-09-03 05:23:39 +00:00
|
|
|
throw new SystemExit();
|
2013-06-29 17:05:54 +00:00
|
|
|
}
|
2014-09-03 05:06:43 +00:00
|
|
|
}
|