summaryrefslogtreecommitdiff
path: root/classes/pluginhandler.php
blob: 69030516523a2a88914c64a2d74aa2b68b006524 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
<?php
class PluginHandler extends Handler_Protected {
	function csrf_ignore($method) {
		return true;
	}

	function catchall($method) {
		$plugin = PluginHost::getInstance()->get_plugin($_REQUEST["plugin"]);

		if ($plugin) {
			if (method_exists($plugin, $method)) {
				$plugin->$method();
			} else {
				print json_encode(array("error" => "METHOD_NOT_FOUND"));
			}
		} else {
			print json_encode(array("error" => "PLUGIN_NOT_FOUND"));
		}
	}
}

?>