Initialized repository
[simplecm.git] / index.php
blob27c3376ef297a01f267d79322298f6cb500e59a5
1 <?php
3 session_start(); // Start a new session if not already started.
5 /* Set an Init class enviroment variable */
7 /* Check Configuration */
8 Check_Config();
10 /* Made it this far, include the configuration file. */
11 include ("include/config-global.php");
13 if (isset($DB_PASSWD))
15 $db_cnct = mysql_connect($DB_HOST, $DB_USERNAME, $DB_PASSWD);
16 mysql_select_db($DB_DBNAME, $db_cnct);
19 else
21 die("Fatal Error: Variable DB_PASSWD not defined in ./include/config-global.php!");
23 if(file_exists("include/ActivePlugins")){
24 include "content/plugins.php";
26 if (!mysql_error())
28 /* Everything seems to be just fine, load the content template */
29 include("content/layout.php");
31 mysql_close(); // Close connection to mysql.
32 exit(); // All done.
35 else
37 echo mysql_error();
40 function Check_Config()
42 if (!file_exists("include/config-global.php")) {
43 die("Fatal Error: Configuration file missing - ./include/config-global.php <br> Cannot proceed.");