khanat-opennel-code/code/web/public_php/ams/inc/plugins.php

40 lines
1.3 KiB
PHP
Raw Normal View History

2014-06-01 19:35:37 +00:00
<?php
/**
2014-06-11 06:22:57 +00:00
* function plugins to get
* plugins from the Database using pagination object
2014-09-03 05:06:43 +00:00
*
* @author shubham meena mentored by Matthew Lagoe
2014-06-01 19:35:37 +00:00
*/
function plugins()
2014-06-11 06:22:57 +00:00
{
if ( Ticket_User :: isMod( unserialize( $_SESSION['ticket_user'] ) ) ) {
2014-09-03 05:06:43 +00:00
2014-06-11 06:22:57 +00:00
$pagination = new Pagination( "SELECT * FROM plugins", "lib", 5, "Plugincache" );
$pageResult['plug'] = Gui_Elements :: make_table( $pagination -> getElements(), Array( "getId", "getPluginName", "getPluginType", "getPluginPermission", "getPluginStatus", "getPluginInfo" ), Array( "id", "plugin_name", "plugin_type", "plugin_permission", "plugin_status", "plugin_info" ) );
$pageResult['links'] = $pagination -> getLinks( 5 );
$pageResult['lastPage'] = $pagination -> getLast();
$pageResult['currentPage'] = $pagination -> getCurrent();
2014-09-03 05:06:43 +00:00
2014-06-11 06:22:57 +00:00
global $INGAME_WEBPATH;
$pageResult['ingame_webpath'] = $INGAME_WEBPATH;
2014-09-03 05:06:43 +00:00
2014-06-11 06:22:57 +00:00
// check if shard is online
try {
$dbs = new DBLayer( "shard" );
$pageResult['shard'] = "online";
2014-09-03 05:06:43 +00:00
}
2014-06-11 06:22:57 +00:00
catch( PDOException $e ) {
2014-06-01 19:35:37 +00:00
$pageResult['shard'] = "offline";
2014-09-03 05:06:43 +00:00
}
2014-06-11 06:22:57 +00:00
return( $pageResult );
} else {
// ERROR: No access!
2014-06-01 19:35:37 +00:00
$_SESSION['error_code'] = "403";
2014-06-11 06:22:57 +00:00
header( "Location: index.php?page=error" );
2014-09-03 05:06:43 +00:00
die();
}
2014-06-01 19:35:37 +00:00
}