summaryrefslogtreecommitdiffstats
path: root/lib/kolab_api_controller.php
diff options
context:
space:
mode:
authorAleksander Machniak <machniak@kolabsys.com>2012-03-14 14:33:50 +0100
committerAleksander Machniak <machniak@kolabsys.com>2012-03-14 14:33:50 +0100
commit5b95b56165eddd823b5e3d8e5ee1489d4aa43c5c (patch)
tree162d4beb9614d112d21d653c5401785c8785d824 /lib/kolab_api_controller.php
parenta38db93d5516f75d77a0f5cb432fdff148c64ce3 (diff)
downloadwebadmin-5b95b56165eddd823b5e3d8e5ee1489d4aa43c5c.tar.gz
Fix service method existance check - exclude private methods
Diffstat (limited to 'lib/kolab_api_controller.php')
-rw-r--r--lib/kolab_api_controller.php7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/kolab_api_controller.php b/lib/kolab_api_controller.php
index c0e36b6..b216a0e 100644
--- a/lib/kolab_api_controller.php
+++ b/lib/kolab_api_controller.php
@@ -148,10 +148,13 @@ class kolab_api_controller
// call service method
$service_handler = $this->get_service($service);
- if (method_exists($service_handler, $method)) {
+ // get only public methods
+ $service_methods = get_class_methods($service_handler);
+
+ if (in_array($method, $service_methods)) {
$result = $service_handler->$method($_GET, $postdata);
}
- else if (method_exists($service_handler, $service . "_" . $method)) {
+ else if (in_array($service . "_" . $method, $service_methods)) {
$call_method = $service . "_" . $method;
$result = $service_handler->$call_method($_GET, $postdata);
}