summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2012-05-15 09:57:31 +0100
committerJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2012-05-15 09:57:31 +0100
commitffe21f242320ea991e5c9f47327d86c16a4fc459 (patch)
tree1e232ded263a12c20e258a0e2f86d48f8993252c
parentf8b2322a55c7cf725c5cf45d47c568ca2cee0c80 (diff)
downloadwebadmin-ffe21f242320ea991e5c9f47327d86c16a4fc459.tar.gz
Disable console() calls
-rw-r--r--lib/api/kolab_api_service_domains.php2
-rw-r--r--lib/api/kolab_api_service_form_value.php6
-rw-r--r--lib/api/kolab_api_service_user.php8
-rw-r--r--lib/client/kolab_client_task_group.php4
-rw-r--r--lib/client/kolab_client_task_role.php2
-rw-r--r--lib/client/kolab_client_task_user.php2
-rw-r--r--lib/functions.php2
-rw-r--r--lib/kolab_api_controller.php7
-rw-r--r--lib/kolab_api_service.php16
-rw-r--r--lib/kolab_client_api.php4
-rw-r--r--lib/kolab_client_task.php33
-rw-r--r--lib/kolab_recipient_policy.php4
12 files changed, 64 insertions, 26 deletions
diff --git a/lib/api/kolab_api_service_domains.php b/lib/api/kolab_api_service_domains.php
index 479d292..439e865 100644
--- a/lib/api/kolab_api_service_domains.php
+++ b/lib/api/kolab_api_service_domains.php
@@ -56,7 +56,7 @@ class kolab_api_service_domains extends kolab_api_service
$auth = Auth::get_instance();
$domains = $auth->list_domains();
- console($domains);
+ //console($domains);
$count = count($domains);
// pagination
diff --git a/lib/api/kolab_api_service_form_value.php b/lib/api/kolab_api_service_form_value.php
index 8af2f8f..3bc008d 100644
--- a/lib/api/kolab_api_service_form_value.php
+++ b/lib/api/kolab_api_service_form_value.php
@@ -442,7 +442,7 @@ class kolab_api_service_form_value extends kolab_api_service
setlocale(LC_ALL, $postdata['preferredlanguage']);
}
/* else {
- console("No locale specified...!");
+ //console("No locale specified...!");
}
*/
@@ -454,7 +454,7 @@ class kolab_api_service_form_value extends kolab_api_service
$auth = Auth::get_instance($_SESSION['user']->get_domain());
$conf = Conf::get_instance();
-
+
$unique_attr = $conf->get('unique_attribute');
if (!$unique_attr) {
$unique_attr = 'nsuniqueid';
@@ -739,7 +739,7 @@ class kolab_api_service_form_value extends kolab_api_service
} elseif (!empty($value['cn'])) {
$list[$idx] = $value['cn'];
} else {
- console("No display name or cn for $idx");
+ //console("No display name or cn for $idx");
}
if (!empty($value['mail'])) {
diff --git a/lib/api/kolab_api_service_user.php b/lib/api/kolab_api_service_user.php
index 8352ae0..f9adbac 100644
--- a/lib/api/kolab_api_service_user.php
+++ b/lib/api/kolab_api_service_user.php
@@ -82,11 +82,11 @@ class kolab_api_service_user extends kolab_api_service
*/
public function user_add($getdata, $postdata)
{
- console("user_add()", $postdata);
+ //console("user_add()", $postdata);
- $user_attributes = $this->parse_input_attributes('user', $postdata);
+ $user_attributes = $this->parse_input_attributes('user', $postdata);
- console("user_add()", $user_attributes);
+ //console("user_add()", $user_attributes);
$auth = Auth::get_instance();
$result = $auth->user_add($user_attributes, $postdata['type_id']);
@@ -171,7 +171,7 @@ class kolab_api_service_user extends kolab_api_service
$result = $auth->user_info($getdata['user']);
// normalize result
- $result = $this->parse_result_attributes('user', $result);
+ $result = $this->parse_result_attributes('user', $result);
if ($result) {
return $result;
diff --git a/lib/client/kolab_client_task_group.php b/lib/client/kolab_client_task_group.php
index 097e150..0c6e3d0 100644
--- a/lib/client/kolab_client_task_group.php
+++ b/lib/client/kolab_client_task_group.php
@@ -271,7 +271,7 @@ class kolab_client_task_group extends kolab_client_task
} elseif (!empty($value['cn'])) {
$list[$idx] = $value['cn'];
} else {
- console("No display name or cn for $idx");
+ //console("No display name or cn for $idx");
}
if (!empty($value['mail'])) {
@@ -298,7 +298,7 @@ class kolab_client_task_group extends kolab_client_task
}
}
- console($_SESSION['group_types']);
+ //console($_SESSION['group_types']);
return $_SESSION['group_types'];
}
diff --git a/lib/client/kolab_client_task_role.php b/lib/client/kolab_client_task_role.php
index 431d9e0..d012abd 100644
--- a/lib/client/kolab_client_task_role.php
+++ b/lib/client/kolab_client_task_role.php
@@ -271,7 +271,7 @@ class kolab_client_task_role extends kolab_client_task
} elseif (!empty($value['cn'])) {
$list[$idx] = $value['cn'];
} else {
- console("No display name or cn for $idx");
+ //console("No display name or cn for $idx");
}
if (!empty($value['mail'])) {
diff --git a/lib/client/kolab_client_task_user.php b/lib/client/kolab_client_task_user.php
index 5287006..f21a041 100644
--- a/lib/client/kolab_client_task_user.php
+++ b/lib/client/kolab_client_task_user.php
@@ -262,6 +262,8 @@ class kolab_client_task_user extends kolab_client_task
// Prepare fields
list($fields, $types, $type) = $this->form_prepare('user', $data, array('userpassword2'));
+ //console("Result from form_prepare", $fields, $types, $type);
+
$add_mode = empty($data['id']);
$accttypes = array();
diff --git a/lib/functions.php b/lib/functions.php
index 4183454..9761358 100644
--- a/lib/functions.php
+++ b/lib/functions.php
@@ -127,7 +127,7 @@ function timer($time = null, $label = '')
{
$now = microtime(true);
if ($time) {
- console(($label ? $label.' ' : '') . sprintf('%.4f', $now - $time));
+ //console(($label ? $label.' ' : '') . sprintf('%.4f', $now - $time));
}
return $now;
}
diff --git a/lib/kolab_api_controller.php b/lib/kolab_api_controller.php
index 5fbe099..e3a5640 100644
--- a/lib/kolab_api_controller.php
+++ b/lib/kolab_api_controller.php
@@ -133,7 +133,7 @@ class kolab_api_controller
$method = $this->request['method'];
$postdata = @json_decode($postdata, true);
- console("Calling method " . $method . " on service " . $service);
+ //console("Calling method " . $method . " on service " . $service);
// validate user session
if ($service != 'system' || $method != 'authenticate') {
@@ -181,7 +181,7 @@ class kolab_api_controller
$method = $this->request['method'];
$url = rtrim($url, '/') . '/' . $service . '.' . $method;
- console("Proxying " . $url);
+ //console("Proxying " . $url);
$request = new HTTP_Request2();
$url = new Net_URL2($url);
@@ -297,7 +297,9 @@ class kolab_api_controller
*/
private function capabilities()
{
+ //console("system.capabilities called");
$auth = Auth::get_instance();
+
$this->domains = $auth->list_domains();
$result = array();
@@ -305,6 +307,7 @@ class kolab_api_controller
// Should we have no permissions to list domain name spaces,
// we should always return our own.
if (count($this->domains) < 1) {
+ //console("As there is but one domain, we insert our own");
$this->domains[] = $_SESSION['user']->get_domain();
}
diff --git a/lib/kolab_api_service.php b/lib/kolab_api_service.php
index 54687a9..8c9dbde 100644
--- a/lib/kolab_api_service.php
+++ b/lib/kolab_api_service.php
@@ -76,15 +76,12 @@ abstract class kolab_api_service
if (empty($object_types[$type_id])) {
if ($object_name == 'domain') {
- return array(
+ $result = array(
'auto_form_fields' => array(),
'form_fields' => array(
'associateddomain' => array(
'type' => 'list'
),
- 'o' => array(
- 'optional' => 'true',
- ),
),
'fields' => array(
'objectclass' => array(
@@ -94,6 +91,10 @@ abstract class kolab_api_service
),
);
+ //console("object_type_attributes('domain', $type_id);", $result);
+
+ return $result;
+
} else {
throw new Exception($this->controller->translate($object_name . '.invalidtypeid'), 35);
}
@@ -142,8 +143,8 @@ abstract class kolab_api_service
$commonalities = count($object_class) - $differences;
$elem_score = $differences > 0 ? ($commonalities / $differences) : $commonalities;
-// console("\$object_class not in \$ref_class (" . $elem['key'] . "): " . implode(", ", $_object_class));
-// console("\$ref_class not in \$object_class (" . $elem['key'] . "): " . implode(", ", $_ref_class));
+ //console("\$object_class not in \$ref_class (" . $elem['key'] . "): " . implode(", ", $_object_class));
+ //console("\$ref_class not in \$object_class (" . $elem['key'] . "): " . implode(", ", $_ref_class));
//console("Score for $object_name type " . $elem['name'] . ": " . $elem_score . "(" . $commonalities . "/" . $differences . ")");
if ($elem_score > $type_score) {
@@ -210,6 +211,8 @@ abstract class kolab_api_service
*/
protected function parse_result_attributes($object_name, $attrs = array())
{
+ //console("parse_result_attributes($object_name, \$attrs = ", $attrs);
+
if (empty($attrs) || !is_array($attrs)) {
return $attrs;
}
@@ -282,6 +285,7 @@ abstract class kolab_api_service
$type_attrs = $this->object_type_attributes($object_name, $attribs['type_id']);
//console("parse_input_attributes", $type_attrs);
+ //console("called with \$attribs", $attribs);
$form_service = $this->controller->get_service('form_value');
$result = array();
diff --git a/lib/kolab_client_api.php b/lib/kolab_client_api.php
index 96188a2..359fe73 100644
--- a/lib/kolab_client_api.php
+++ b/lib/kolab_client_api.php
@@ -150,7 +150,7 @@ class kolab_client_api
$this->request->setMethod(HTTP_Request2::METHOD_GET);
- console("GET", $url);
+ //console("GET", $url);
return $this->get_response($url);
}
@@ -171,7 +171,7 @@ class kolab_client_api
$this->request->setMethod(HTTP_Request2::METHOD_POST);
$this->request->setBody(@json_encode($post));
- console("POST", $url, $post);
+ //console("POST", $url, $post);
return $this->get_response($url);
}
diff --git a/lib/kolab_client_task.php b/lib/kolab_client_task.php
index 4bcc56b..652cfa2 100644
--- a/lib/kolab_client_task.php
+++ b/lib/kolab_client_task.php
@@ -457,7 +457,7 @@ class kolab_client_task
$capabilities = $this->capabilities();
- //console($capabilities);
+ //console("Capabilities", $capabilities);
foreach ($this->menu as $idx => $label) {
//console("$task: $task, idx: $idx, label: $label");
@@ -515,6 +515,8 @@ class kolab_client_task
$_SESSION['user_types'] = $list;
}
+ //console("user_types() \$list", $list);
+
return $list;
}
@@ -557,6 +559,8 @@ class kolab_client_task
$result = $this->api->post('system.capabilities');
$list = $result->get('list');
+ //console("Capabilities obtained from the API", $list);
+
if (is_array($list)) {
$_SESSION['capabilities'] = $list;
}
@@ -741,6 +745,9 @@ class kolab_client_task
protected function form_prepare($name, &$data, $extra_fields = array())
{
$types = (array) $this->{$name . '_types'}();
+
+ //console("form_prepare types", $types);
+
$form_id = $attribs['id'];
$add_mode = empty($data['id']);
@@ -979,13 +986,24 @@ class kolab_client_task
*/
protected function form_create($name, $attribs, $sections, $fields, $fields_map, $data, $add_mode)
{
+ //console("Creating form for $name");
+
+ //console("Assign fields to sections", $fields);
// Assign sections to fields
foreach ($fields as $idx => $field) {
if (!$field['section']) {
$fields[$idx]['section'] = isset($fields_map[$idx]) ? $fields_map[$idx] : 'other';
+ //console("Assigned field $idx to section " . $fields[$idx]['section']);
+/*
+ } else {
+ $fields[$idx]['section'] = 'other';
+ //console("Assigned field $idx to section " . $fields[$idx]['section']);
+*/
}
}
+ //console("Using fields_map", $fields_map);
+
// Sort
foreach ($fields_map as $idx => $val) {
if (array_key_exists($idx, $fields)) {
@@ -1000,13 +1018,19 @@ class kolab_client_task
$fields_map = array_merge($fields_map, $fields);
}
+ //console("Using attribs", $attribs);
+
$form = new kolab_form($attribs);
$assoc_fields = array();
$req_fields = array();
$writeable = 0;
$auto_fields = $this->output->get_env('auto_fields');
- //console("\$auto_fields", $auto_fields);
+
+ //console("form_create() \$attribs", $attribs);
+ //console("form_create() \$auto_fields", $auto_fields);
+
+ //console("Going to walk through sections", $sections);
// Parse elements and add them to the form object
foreach ($sections as $section_idx => $section) {
@@ -1026,6 +1050,9 @@ class kolab_client_task
$field['section'] = $section_idx;
if (empty($field['value']) && !empty($data[$idx])) {
+
+ //console("Using data value", $data[$idx], "for value of field $idx");
+
$field['value'] = $data[$idx];
// Convert data for the list field with autocompletion
@@ -1090,6 +1117,8 @@ class kolab_client_task
}
}
+ //console("Adding field to form", $field);
+
$form->add_element($field);
}
}
diff --git a/lib/kolab_recipient_policy.php b/lib/kolab_recipient_policy.php
index 6667631..54f79d2 100644
--- a/lib/kolab_recipient_policy.php
+++ b/lib/kolab_recipient_policy.php
@@ -157,7 +157,7 @@ class kolab_recipient_policy {
);
}
} else {
- console("Key " . $substrings[1][$x] . " does not exist in \$userdata");
+ //console("Key " . $substrings[1][$x] . " does not exist in \$userdata");
}
}
@@ -209,7 +209,7 @@ class kolab_recipient_policy {
if (array_key_exists($substrings[1][$x], $userdata)) {
$userdata[$substrings[1][$x]] = substr($userdata[$substrings[1][$x]], $substrings[2][$x], $substrings[3][$x]);
} else {
- console("Key " . $substrings[1][$x] . " does not exist in \$userdata");
+ //console("Key " . $substrings[1][$x] . " does not exist in \$userdata");
}
$rule = preg_replace(