-
Notifications
You must be signed in to change notification settings - Fork 11
/
index.php
29 lines (23 loc) · 870 Bytes
/
index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<?php
namespace ExternalModules;
require_once dirname(__FILE__) . '/classes/ExternalModules.php';
$id = $_GET['id'];
$page = $_GET['page'];
$pid = @$_GET['pid'];
$prefix = ExternalModules::getPrefixForID($id);
if(empty($prefix)){
die("A module with id $id could not be found!");
}
$version = ExternalModules::getGlobalSetting($prefix, ExternalModules::KEY_VERSION);
if(empty($version)){
die("The requested module is currently disabled globally.");
}
$enabled = ExternalModules::getProjectSetting($prefix, $pid, ExternalModules::KEY_ENABLED);
if(!$enabled){
die("The requested module is currently disabled on this project.");
}
$pagePath = ExternalModules::$MODULES_PATH . ExternalModules::getModuleDirectoryName($prefix, $version) . "/$page.php";
if(!file_exists($pagePath)){
die("The specified page does not exist for this module.");
}
require_once $pagePath;