Commit 69371c3a authored by GROSS-AMBLARD David's avatar GROSS-AMBLARD David
Browse files

Adding a checker for a correct config.php file

parent b359f7fe
...@@ -4,9 +4,7 @@ ...@@ -4,9 +4,7 @@
* *
*/ */
require("config.php");
/** /**
* If global constant DEBUG is true, echoes the parameter string. In any case, log the message. * If global constant DEBUG is true, echoes the parameter string. In any case, log the message.
* @param String The debug message to print/log. * @param String The debug message to print/log.
......
...@@ -12,6 +12,13 @@ ...@@ -12,6 +12,13 @@
* MAIN: the main part of the Web page * MAIN: the main part of the Web page
*/ */
if (file_exists("config.php"))
require("config.php");
else {
die("Headwork is not properly installed yet. Set a config.php file (use the config.php.example template).");
}
require("HWlib.php"); require("HWlib.php");
require("HTML.php"); require("HTML.php");
require("profile.php"); require("profile.php");
...@@ -186,13 +193,8 @@ switch ($mode) { ...@@ -186,13 +193,8 @@ switch ($mode) {
} }
if (isset($_SESSION['username'])) { if (isset($_SESSION['username']))
debug("logged");
@$var = array("ID" => $_SESSION['username']); @$var = array("ID" => $_SESSION['username']);
} else {
debug("unlogged");
}
require("template-main.php"); require("template-main.php");
...@@ -208,7 +210,7 @@ catch (Exception $e){ // global exception handler ...@@ -208,7 +210,7 @@ catch (Exception $e){ // global exception handler
<h2>Details</h2> <h2>Details</h2>
<p>$message</p> <p>$message</p>
<code>"; <code>";
print_r($e->getTrace()); if(DEBUG) print_r($e->getTrace());
echo " echo "
</code> </code>
</div>"; </div>";
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment