-
Notifications
You must be signed in to change notification settings - Fork 3
/
index.php
47 lines (37 loc) · 1.06 KB
/
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<?php
session_start(); // Start a new session if not already started.
/* Set an Init class enviroment variable */
/* Check Configuration */
Check_Config();
/* Made it this far, include the configuration file. */
include ("include/config-global.php");
if (isset($DB_PASSWD))
{
$db_cnct = mysql_connect($DB_HOST, $DB_USERNAME, $DB_PASSWD);
mysql_select_db($DB_DBNAME, $db_cnct);
}
else
{
die("Fatal Error: Variable DB_PASSWD not defined in ./include/config-global.php!");
}
if(file_exists("include/ActivePlugins")){
include "content/plugins.php";
}
if (!mysql_error())
{
/* Everything seems to be just fine, load the content template */
include("content/layout.php");
mysql_close(); // Close connection to mysql.
exit(); // All done.
}
else
{
echo mysql_error();
}
function Check_Config()
{
if (!file_exists("include/config-global.php")) {
die("Fatal Error: Configuration file missing - ./include/config-global.php <br> Cannot proceed.");
}
}
?>