pluginhandler.php 463 B

123456789101112131415161718192021222324
  1. <?php
  2. class PluginHandler extends Handler_Protected {
  3. function csrf_ignore($method) {
  4. return true;
  5. }
  6. function catchall($method) {
  7. global $pluginhost;
  8. $plugin = $pluginhost->get_plugin($_REQUEST["plugin"]);
  9. if ($plugin) {
  10. if (method_exists($plugin, $method)) {
  11. $plugin->$method();
  12. } else {
  13. print json_encode(array("error" => "METHOD_NOT_FOUND"));
  14. }
  15. } else {
  16. print json_encode(array("error" => "PLUGIN_NOT_FOUND"));
  17. }
  18. }
  19. }
  20. ?>