public.php 1023 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <?php
  2. set_include_path(dirname(__FILE__) ."/include" . PATH_SEPARATOR .
  3. get_include_path());
  4. require_once "autoload.php";
  5. require_once "sessions.php";
  6. require_once "functions.php";
  7. require_once "sanity_check.php";
  8. require_once "config.php";
  9. require_once "db.php";
  10. require_once "db-prefs.php";
  11. startup_gettext();
  12. $script_started = microtime(true);
  13. if (!init_plugins()) return;
  14. if (ENABLE_GZIP_OUTPUT && function_exists("ob_gzhandler")) {
  15. ob_start("ob_gzhandler");
  16. }
  17. $method = $_REQUEST["op"];
  18. $override = PluginHost::getInstance()->lookup_handler("public", $method);
  19. if ($override) {
  20. $handler = $override;
  21. } else {
  22. $handler = new Handler_Public($_REQUEST);
  23. }
  24. if (implements_interface($handler, "IHandler") && $handler->before($method)) {
  25. if ($method && method_exists($handler, $method)) {
  26. $handler->$method();
  27. } else if (method_exists($handler, 'index')) {
  28. $handler->index();
  29. }
  30. $handler->after();
  31. return;
  32. }
  33. header("Content-Type: text/plain");
  34. print error_json(13);
  35. ?>