summaryrefslogtreecommitdiffstats
path: root/lib/kolab_api_controller.php
diff options
context:
space:
mode:
authorAleksander Machniak <machniak@kolabsys.com>2012-08-07 11:29:56 +0200
committerAleksander Machniak <machniak@kolabsys.com>2012-08-07 11:29:56 +0200
commitc9f97ffed372bfaee1ff3fce3103a5506720efeb (patch)
tree87789eeaf967da2c9e22b9e8b461f7b64bbb3285 /lib/kolab_api_controller.php
parent8d78b0cc783c273b37a2506d5bacb1470511ec66 (diff)
downloadwebadmin-c9f97ffed372bfaee1ff3fce3103a5506720efeb.tar.gz
Add logging class
Diffstat (limited to 'lib/kolab_api_controller.php')
-rw-r--r--lib/kolab_api_controller.php15
1 files changed, 7 insertions, 8 deletions
diff --git a/lib/kolab_api_controller.php b/lib/kolab_api_controller.php
index bdbc707..e0dbf8b 100644
--- a/lib/kolab_api_controller.php
+++ b/lib/kolab_api_controller.php
@@ -79,7 +79,7 @@ class kolab_api_controller
public function add_service($service, $handler)
{
if ($this->services[$service]) {
- //console("Service $service is already registered.");
+ Log::warning("Service $service is already registered");
return false;
}
@@ -91,7 +91,7 @@ class kolab_api_controller
*/
public function get_service($service)
{
- //console("Obtaining service $service");
+ Log::debug("Obtaining service: $service");
// we are the system!
if ($service == 'system') {
@@ -108,8 +108,6 @@ class kolab_api_controller
}
}
- //console("Unknown service $service");
-
throw new Exception("Unknown service", 400);
}
@@ -140,7 +138,7 @@ class kolab_api_controller
$method = $this->request['method'];
$postdata = @json_decode($postdata, true);
- //console("Calling method " . $method . " on service " . $service);
+ Log::debug("Calling $service.$method");
// validate user session
if ($service != 'system' || $method != 'authenticate') {
@@ -188,7 +186,7 @@ class kolab_api_controller
$method = $this->request['method'];
$url = rtrim($url, '/') . '/' . $service . '.' . $method;
- //console("Proxying " . $url);
+ Log::debug("Proxying: $url");
$request = new HTTP_Request2();
$url = new Net_URL2($url);
@@ -272,7 +270,7 @@ class kolab_api_controller
*/
private function authenticate($request, $postdata)
{
- //console("Authenticating with postdata", $postdata);
+ Log::debug("Authenticating with postdata: " . json_encode($postdata));
$valid = false;
@@ -306,7 +304,8 @@ class kolab_api_controller
*/
private function capabilities()
{
- //console("system.capabilities called");
+ Log::debug("system.capabilities called");
+
$auth = Auth::get_instance();
$this->domains = $auth->list_domains();