summaryrefslogtreecommitdiffstats
path: root/functions.php
diff options
context:
space:
mode:
authorArun Persaud <arun@nubati.net>2007-07-28 10:04:38 -0700
committerArun Persaud <arun@nubati.net>2007-07-28 10:04:38 -0700
commitb29ab3c07ebe1667e852457f22f6f51193970c1b (patch)
tree9cd98a598f715fd843dbc886b9e98265b865eeec /functions.php
parent2d479ce92aaf3d20001637df61b957995f722419 (diff)
downloade-DoKo-b29ab3c07ebe1667e852457f22f6f51193970c1b.tar.gz
e-DoKo-b29ab3c07ebe1667e852457f22f6f51193970c1b.tar.bz2
e-DoKo-b29ab3c07ebe1667e852457f22f6f51193970c1b.zip
CLEANUP: working on database now a config.php option
moved error checking into a function and made working on the database a config.php option
Diffstat (limited to 'functions.php')
-rw-r--r--functions.php49
1 files changed, 49 insertions, 0 deletions
diff --git a/functions.php b/functions.php
index af34345..6fe8137 100644
--- a/functions.php
+++ b/functions.php
@@ -1,5 +1,54 @@
<?php
+function config_check()
+{
+ global $EmailName,$EMAIL_REPLY,$ADMIN_NAME,$ADMIN_EMAIL,$DB_work;
+
+ /* check if some variables are set in the config file, else set defaults */
+ if(!isset($EmailName))
+ $EmailName="[DoKo] ";
+ if(isset($EMAIL_REPLY))
+ {
+ ini_set("sendmail_from",$EMAIL_REPLY);
+ }
+ if(!isset($ADMIN_NAME))
+ {
+ output_header();
+ echo "<h1>Setup not completed</h1>";
+ echo "You need to set \$ADMIN_NAME in config.php.";
+ output_footer();
+ exit();
+ }
+ if(!isset($ADMIN_EMAIL))
+ {
+ output_header();
+ echo "<h1>Setup not completed</h1>";
+ echo "You need to set \$ADMIN_EMAIL in config.php. ".
+ "If something goes wrong an email will be send to this address.";
+ output_footer();
+ exit();
+ }
+ if(!isset($DB_work))
+ {
+ output_header();
+ echo "<h1>Setup not completed</h1>";
+ echo "You need to set \$DB_work in config.php. ".
+ "If this is set to 1, the game will be suspended and one can work safely on the database.".
+ "The default should be 0 for the game to work.";
+ output_footer();
+ exit();
+ }
+ if($DB_work)
+ {
+ output_header();
+ echo "Working on the database...please check back later.";
+ output_footer();
+ exit();
+ }
+
+ return;
+}
+
function mymail($To,$Subject,$message,$header="")
{
global $debug;