added some config jargon
[glcas.git] / www / index.php
index aa5455c..bf3bc2c 100644 (file)
@@ -22,24 +22,14 @@ 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();
 $glconfig->loadConfig($configpath);
 $webResponder = new GLCASWeb($glconfig);