Merge branch 'fixes' into main/rendor-staging
[ryzomcore.git] / web / public_php / ams / inc / plugins.php
blob99a7ed0e7bb52cab84bdb30f5770f1dc24b7df7f
1 <?php
3 /**
4 * function plugins to get
5 * plugins from the Database using pagination object
7 * @author shubham meena mentored by Matthew Lagoe
8 */
10 function plugins()
12 if ( Ticket_User :: isMod( unserialize( $_SESSION['ticket_user'] ) ) ) {
14 $pagination = new Pagination( "SELECT * FROM plugins", "lib", 5, "Plugincache" );
15 $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" ) );
16 $pageResult['links'] = $pagination -> getLinks( 5 );
17 $pageResult['lastPage'] = $pagination -> getLast();
18 $pageResult['currentPage'] = $pagination -> getCurrent();
20 global $INGAME_WEBPATH;
21 $pageResult['ingame_webpath'] = $INGAME_WEBPATH;
23 // check if shard is online
24 try {
25 $dbs = new DBLayer( "shard" );
26 $pageResult['shard'] = "online";
28 catch( PDOException $e ) {
29 $pageResult['shard'] = "offline";
31 return( $pageResult );
32 } else {
33 // ERROR: No access!
34 $_SESSION['error_code'] = "403";
35 header("Cache-Control: max-age=1");
36 header( "Location: index.php?page=error" );
37 throw new SystemExit();