From b8c7e075cc240c1e4dc9f4c11cecc00473d28b10 Mon Sep 17 00:00:00 2001 From: Conrad Vermeulen Date: Wed, 20 Jun 2007 16:48:06 +0000 Subject: [PATCH] WSA-3 "Error occurs in >>ktws_eg_folder_listing.php<<" Fixed. Rewrote get_listing() to accomodate anonymous. --- ktwebservice/webservice.php | 44 +++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 41 insertions(+), 3 deletions(-) diff --git a/ktwebservice/webservice.php b/ktwebservice/webservice.php index 1a0b437..32637c8 100644 --- a/ktwebservice/webservice.php +++ b/ktwebservice/webservice.php @@ -126,6 +126,8 @@ class KTWebService 'mime_type' => 'string', 'mime_icon_path' => 'string', 'mime_display' => 'string', + 'workflow'=>'string', + 'workflow_state'=>'string', 'items' =>"{urn:$this->namespace}kt_folder_items" ); @@ -303,6 +305,13 @@ class KTWebService array('in' => array('username' => 'string', 'password' => 'string', 'ip' => 'string'), 'out' => array('return' => "{urn:$this->namespace}kt_response" ), ); + + // anonymous_login + $this->__dispatch_map['anonymous_login'] = + array('in' => array('ip' => 'string'), + 'out' => array('return' => "{urn:$this->namespace}kt_response" ), + ); + // logout $this->__dispatch_map['logout'] = @@ -586,7 +595,36 @@ class KTWebService } return $kt; } - + + /** + * Creates a new anonymous session. + * + * @param string $ip + * @return kt_response + */ + function anonymous_login($ip=null) + { + $response = array( + 'status_code'=>KTWS_ERR_AUTHENTICATION_ERROR, + 'message'=>'', + ); + + $kt = &new KTAPI(); + + $session = $kt->start_anonymous_session($ip); + + if (PEAR::isError($session)) + { + $response['message'] = $session->getMessage(); + return new SOAP_Value('return',"{urn:$this->namespace}kt_response", $response); + } + + $response['status_code'] = KTWS_SUCCESS; + $response['message'] = $session->get_session(); + + return new SOAP_Value('return',"{urn:$this->namespace}kt_response", $response); + } + /** * Creates a new session for the user. * @@ -672,7 +710,7 @@ class KTWebService 'status_code'=>KTWS_ERR_INVALID_FOLDER, 'message'=>$folder->getMessage() ); - return new SOAP_Value('return',"{urn:$this->namespace}kt_folder_detail", $kt); + return new SOAP_Value('return',"{urn:$this->namespace}kt_folder_detail", $response); } $detail = $folder->get_detail(); @@ -810,7 +848,7 @@ class KTWebService } $listing = $folder->get_listing($depth, $what); - + $contents = array( 'status_code'=>KTWS_SUCCESS, 'message'=>'', -- libgit2 0.21.4