|
|
|
@ -491,4 +491,34 @@ class PluginHost {
|
|
|
|
|
function get_owner_uid() {
|
|
|
|
|
return $this->owner_uid;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// handled by classes/pluginhandler.php, requires valid session
|
|
|
|
|
function get_method_url($sender, $method, $params) {
|
|
|
|
|
return get_self_url_prefix() . "/backend.php?" .
|
|
|
|
|
http_build_query(
|
|
|
|
|
array_merge(
|
|
|
|
|
[
|
|
|
|
|
"op" => "pluginhandler",
|
|
|
|
|
"plugin" => strtolower(get_class($sender)),
|
|
|
|
|
"pmethod" => $method
|
|
|
|
|
],
|
|
|
|
|
$params));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// WARNING: endpoint in public.php, exposed to unauthenticated users
|
|
|
|
|
function get_public_method_url($sender, $method, $params) {
|
|
|
|
|
if ($sender->is_public_method($method)) {
|
|
|
|
|
return get_self_url_prefix() . "/public.php?" .
|
|
|
|
|
http_build_query(
|
|
|
|
|
array_merge(
|
|
|
|
|
[
|
|
|
|
|
"op" => "pluginhandler",
|
|
|
|
|
"plugin" => strtolower(get_class($sender)),
|
|
|
|
|
"pmethod" => $method
|
|
|
|
|
],
|
|
|
|
|
$params));
|
|
|
|
|
} else {
|
|
|
|
|
user_error("get_public_method_url: requested method '$method' of '" . get_class($sender) . "' is private.");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|