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

40 lines
1.3 KiB
PHP
Raw Normal View History

<?php
/**
* 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
*/
function plugins()
{
if ( Ticket_User :: isMod( unserialize( $_SESSION['ticket_user'] ) ) ) {
2014-09-03 05:06:43 +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
global $INGAME_WEBPATH;
$pageResult['ingame_webpath'] = $INGAME_WEBPATH;
2014-09-03 05:06:43 +00:00
// check if shard is online
try {
$dbs = new DBLayer( "shard" );
$pageResult['shard'] = "online";
2014-09-03 05:06:43 +00:00
}
catch( PDOException $e ) {
$pageResult['shard'] = "offline";
2014-09-03 05:06:43 +00:00
}
return( $pageResult );
} else {
// ERROR: No access!
$_SESSION['error_code'] = "403";
header( "Location: index.php?page=error" );
2014-09-03 05:06:43 +00:00
die();
}
}