]>
Commit | Line | Data |
---|---|---|
e0d91d84 | 1 | <?php |
3f363052 AD |
2 | set_include_path(get_include_path() . PATH_SEPARATOR . "include"); |
3 | ||
e0d91d84 AD |
4 | /* remove ill effects of magic quotes */ |
5 | ||
6 | if (get_magic_quotes_gpc()) { | |
7 | function stripslashes_deep($value) { | |
8 | $value = is_array($value) ? | |
9 | array_map('stripslashes_deep', $value) : stripslashes($value); | |
10 | return $value; | |
11 | } | |
12 | ||
13 | $_POST = array_map('stripslashes_deep', $_POST); | |
14 | $_GET = array_map('stripslashes_deep', $_GET); | |
15 | $_COOKIE = array_map('stripslashes_deep', $_COOKIE); | |
16 | $_REQUEST = array_map('stripslashes_deep', $_REQUEST); | |
17 | } | |
18 | ||
e0d91d84 | 19 | require_once "functions.php"; |
5f0a3741 | 20 | require_once "sessions.php"; |
e0d91d84 AD |
21 | require_once "sanity_check.php"; |
22 | require_once "config.php"; | |
23 | require_once "db.php"; | |
24 | require_once "db-prefs.php"; | |
25 | ||
26 | no_cache_incantation(); | |
27 | ||
28 | startup_gettext(); | |
29 | ||
30 | $script_started = getmicrotime(); | |
31 | ||
32 | $link = db_connect(DB_HOST, DB_USER, DB_PASS, DB_NAME); | |
33 | ||
5f0a3741 AD |
34 | if (!init_connection($link)) return; |
35 | ||
36 | if (ENABLE_GZIP_OUTPUT) { | |
37 | ob_start("ob_gzhandler"); | |
e0d91d84 AD |
38 | } |
39 | ||
5f0a3741 AD |
40 | function __autoload($class) { |
41 | $file = "classes/".strtolower(basename($class)).".php"; | |
42 | if (file_exists($file)) { | |
43 | require $file; | |
44 | } | |
45 | } | |
e0d91d84 | 46 | |
5f0a3741 | 47 | $method = $_REQUEST["op"]; |
e0d91d84 | 48 | |
5f0a3741 | 49 | $handler = new Public_Handler($link, $_REQUEST); |
e0d91d84 | 50 | |
de8260cb AD |
51 | if ($handler->before($method)) { |
52 | if ($method && method_exists($handler, $method)) { | |
53 | $handler->$method(); | |
54 | } else if (method_exists($handler, 'index')) { | |
55 | $handler->index(); | |
5f0a3741 | 56 | } |
de8260cb AD |
57 | $handler->after(); |
58 | return; | |
e0d91d84 AD |
59 | } |
60 | ||
5f0a3741 AD |
61 | header("Content-Type: text/plain"); |
62 | print json_encode(array("error" => array("code" => 7))); | |
e0d91d84 AD |
63 | |
64 | // We close the connection to database. | |
65 | db_close($link); | |
66 | ?> |