kinda stubb'ed the old config out for now and tacked it onto the new
[glcas.git] / libglcas / web.php
index 5dd6f91..96b787e 100644 (file)
@@ -179,6 +179,16 @@ function glcas_startInstaller()
        $gid = $gid_a["name"];
        error_log("user id is $uid, group id is $gid");
        
+       if(isset($_REQUEST["installdir"])) {
+               $c = new GLCASConfig();
+               touch($_REQUEST["installdir"]."/webconfig");
+               $c->loadConfig($_REQUEST["installdir"]."/webconfig");
+               header("Location: index.php");
+               return;
+       }
+       
+       $underroot = realpath($WEB_ROOT_FS."/../");
+       
 ?>
 <html>
 <h1>Welcome to GLCAS</h1>
@@ -190,7 +200,7 @@ now is a place where i can store my config. I search the following directories f
 configuration (webconfig)<br>
 <li> /var/run/glcas/
 <li> /var/lib/glcas/
-<li> <?php echo $WEB_ROOT_FS?>/var/glcas/
+<li> <?php echo $underroot?>/var/glcas/
 <br><br>
 
 As root, you must now create one of these directories and change the ownership of the directory to the web owner.
@@ -201,7 +211,7 @@ Now, tell me where you want me to create the webconfig file:<br>
 <select name="installdir">
 <option value="/var/run/glcas">/var/run/glcas</option>
 <option value="/var/lib/glcas">/var/lib/glcas</option>
-<option value="<?php echo $WEB_ROOT_FS?>/var/glcas/"><?php echo $WEB_ROOT_FS?>/var/glcas/</option>
+<option value="<?php echo $underroot?>/var/glcas/"><?php echo $underroot?>/var/glcas/</option>
 </select>
 <input type="submit" name="Go" value="Go">