not entirely sure, think its all the messaging components
[glcas.git] / www / index.php
1 <?php
2
3 $WEB_ROOT_FS = realpath(dirname(__FILE__));
4 $BASE_URL = dirname($_SERVER["PHP_SELF"]);
5
6 global $WEB_ROOT_FS, $URL_HANDLERS, $BASE_URL;
7
8 // add libglcas as if it were a path in ../libglcas
9 if(file_exists("../libglcas")) {
10         $path = realpath($WEB_ROOT_FS."/../");
11         error_log("added glcas path as $path");
12         set_include_path(get_include_path().PATH_SEPARATOR.$path);
13 }
14
15 // include the based library
16 require_once("libglcas/lib.php");
17
18 // load plugins
19 glcas_pluginLoader();
20
21 // find our config
22 $configpath = "";
23
24 // TODO: do this better
25 $configpath = glcas_getWebConfigPath();
26 header("Accept-Ranges: bytes");
27
28 if($configpath == false) {
29         glcas_startInstaller();
30         return;
31 }
32
33 $glconfig = new GLCASConfig();
34 global $glconfig;
35 $glconfig->loadConfig($configpath);
36
37 // the global action handler
38 if(isset($_REQUEST["glcasbasesendmsg"])) {
39         GLCASAddMessage($_REQUEST["msglev"], $_REQUEST["message"]);
40         header("Location: ".$_SERVER["HTTP_REFERER"]);
41         return;
42 }
43
44 // step up to the web responder
45 $webResponder = new GLCASWeb($glconfig);
46 $webResponder->go($URL_HANDLERS);
47
48
49
50
51 /*
52 echo "<pre>";
53 echo "BASEURL: $BASE_URL\n";
54 echo "CUSTOM\n";
55 print_r($_SERVER);
56
57 $vars = get_defined_vars();
58 foreach($vars as $var => $vkey) {
59         echo "VAR $var is:\n";
60         var_dump($$var);
61         echo "\n\n";
62 }
63
64 echo "</pre>";
65 /**/
66
67 ?>