X-Git-Url: http://git.pjr.cc/?a=blobdiff_plain;f=www%2Findex.php;h=621c61d1326445a321290343a909b35a363b7fa9;hb=HEAD;hp=aa5455cdcc95f5a34109e99b130804b8f378c85b;hpb=ac6a7aa8e9f814a71f1c759c8ec2c83882cc1240;p=glcas.git diff --git a/www/index.php b/www/index.php index aa5455c..621c61d 100644 --- a/www/index.php +++ b/www/index.php @@ -22,30 +22,32 @@ glcas_pluginLoader(); $configpath = ""; // TODO: do this better -if(file_exists($WEB_ROOT_FS."/../var")) { - - // is it there? - if(file_exists($WEB_ROOT_FS."/../var/glcas/webconfig")) { - $configpath = realpath("$WEB_ROOT_FS/../var/glcas/webconfig"); - } else { - // if not, attempt to create - if(!file_exists($WEB_ROOT_FS."/../var/glcas")) { - mkdir($WEB_ROOT_FS."/../var/glcas"); - } - // success! - touch("$WEB_ROOT_FS/../var/glcas/webconfig"); - $configpath = realpath("$WEB_ROOT_FS/../var/glcas/webconfig"); - } -} - +$configpath = glcas_getWebConfigPath(); header("Accept-Ranges: bytes"); +if($configpath == false) { + glcas_startInstaller(); + return; +} + $glconfig = new GLCASConfig(); +global $glconfig; $glconfig->loadConfig($configpath); + +// the global action handler +if(isset($_REQUEST["glcasbasesendmsg"])) { + GLCASAddMessage($_REQUEST["msglev"], $_REQUEST["message"]); + header("Location: ".$_SERVER["HTTP_REFERER"]); + return; +} + +// step up to the web responder $webResponder = new GLCASWeb($glconfig); $webResponder->go($URL_HANDLERS); + + /* echo "
";
 echo "BASEURL: $BASE_URL\n";