summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAleksander Machniak <alec@alec.pl>2012-10-03 18:59:02 +0200
committerAleksander Machniak <alec@alec.pl>2012-10-03 18:59:02 +0200
commit5bd64ac6ff2efcc89e1c016e671d577693c5c069 (patch)
treec5f75ef6604509a60703c181c3f3e15f44426ca0
parentf6b25899f7d279ce58599781e094bf256ac49c4d (diff)
downloadwebadmin-5bd64ac6ff2efcc89e1c016e671d577693c5c069.tar.gz
Fix bug where ssl_* configuration wasn't used when proxying API requests (Bug #1016)
-rw-r--r--lib/kolab_api_controller.php2
-rw-r--r--lib/kolab_client_api.php11
2 files changed, 12 insertions, 1 deletions
diff --git a/lib/kolab_api_controller.php b/lib/kolab_api_controller.php
index 8e9fc30..bf7058b 100644
--- a/lib/kolab_api_controller.php
+++ b/lib/kolab_api_controller.php
@@ -198,6 +198,8 @@ class kolab_api_controller
$request->setMethod($method == 'GET' ? HTTP_Request2::METHOD_GET : HTTP_Request2::METHOD_POST);
$request->setHeader('X-Session-Token', kolab_utils::get_request_header('X-Session-Token'));
+ kolab_client_api::configure($request);
+
if ($method == 'GET') {
parse_str($_SERVER['QUERY_STRING'], $query);
unset($query['service']);
diff --git a/lib/kolab_client_api.php b/lib/kolab_client_api.php
index aeb37a5..7405489 100644
--- a/lib/kolab_client_api.php
+++ b/lib/kolab_client_api.php
@@ -60,7 +60,16 @@ class kolab_client_api
public function init()
{
$this->request = new HTTP_Request2();
+ self::configure($this->request);
+ }
+ /**
+ * Configure HTTP_Request2 object
+ *
+ * @param HTTP_Request2 $request Request object
+ */
+ public static function configure($request)
+ {
// Configure connection options
$config = Conf::get_instance();
$options = array(
@@ -75,7 +84,7 @@ class kolab_client_api
foreach ($options as $optname => $opttype) {
if (($optvalue = $config->get('kolab_wap', $optname, $opttype)) !== null) {
try {
- $this->request->setConfig($optname, $optvalue);
+ $request->setConfig($optname, $optvalue);
}
catch (Exception $e) {
Log::error("HTTP: " . $e->getMessage());