started work on the adhoc file component
[glcas.git] / libglcas / web.php
index f2182f3..433b764 100644 (file)
@@ -36,6 +36,7 @@ function GLCASMenuBuilder()
        ?>
 <a href="<?php echo $BASE_URL ?>">Home</a>
 <a href="<?php echo $BASE_URL."/admin/"?>">Admin</a>
+<a href="<?php echo $BASE_URL."/adhoc/"?>">Adhoc</a>
        <?php
 }
 
@@ -140,6 +141,23 @@ function glcas_isRemoteDir($url)
        return false;
 }
 
+function glcas_fileExists($url)
+{
+       $fp = fopen($url, "r");
+       //error_og("did file_get_contents on $url");
+       $retval = false;
+       foreach($http_response_header as $key => $val) {
+               //error_log("got header of $key for $val");
+               if(preg_match("/.*HTTP\/.*200.*/", $val)) {
+                       //echo "is true\n";
+                       
+                       $retval = true;
+               }
+       }
+       fclose($fp);
+       return $retval;
+}
+
 function glcas_startInstaller()
 {
        global $WEB_ROOT_FS, $BASE_URL;