Commit b8c7e075cc240c1e4dc9f4c11cecc00473d28b10

Authored by Conrad Vermeulen
1 parent c041d149

WSA-3

"Error occurs in >>ktws_eg_folder_listing.php<<"
Fixed. Rewrote get_listing() to accomodate anonymous.

Reviewed By: Kevin Fourie

git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@6823 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing 1 changed file with 41 additions and 3 deletions
ktwebservice/webservice.php
... ... @@ -126,6 +126,8 @@ class KTWebService
126 126 'mime_type' => 'string',
127 127 'mime_icon_path' => 'string',
128 128 'mime_display' => 'string',
  129 + 'workflow'=>'string',
  130 + 'workflow_state'=>'string',
129 131 'items' =>"{urn:$this->namespace}kt_folder_items"
130 132 );
131 133  
... ... @@ -303,6 +305,13 @@ class KTWebService
303 305 array('in' => array('username' => 'string', 'password' => 'string', 'ip' => 'string'),
304 306 'out' => array('return' => "{urn:$this->namespace}kt_response" ),
305 307 );
  308 +
  309 + // anonymous_login
  310 + $this->__dispatch_map['anonymous_login'] =
  311 + array('in' => array('ip' => 'string'),
  312 + 'out' => array('return' => "{urn:$this->namespace}kt_response" ),
  313 + );
  314 +
306 315  
307 316 // logout
308 317 $this->__dispatch_map['logout'] =
... ... @@ -586,7 +595,36 @@ class KTWebService
586 595 }
587 596 return $kt;
588 597 }
589   -
  598 +
  599 + /**
  600 + * Creates a new anonymous session.
  601 + *
  602 + * @param string $ip
  603 + * @return kt_response
  604 + */
  605 + function anonymous_login($ip=null)
  606 + {
  607 + $response = array(
  608 + 'status_code'=>KTWS_ERR_AUTHENTICATION_ERROR,
  609 + 'message'=>'',
  610 + );
  611 +
  612 + $kt = &new KTAPI();
  613 +
  614 + $session = $kt->start_anonymous_session($ip);
  615 +
  616 + if (PEAR::isError($session))
  617 + {
  618 + $response['message'] = $session->getMessage();
  619 + return new SOAP_Value('return',"{urn:$this->namespace}kt_response", $response);
  620 + }
  621 +
  622 + $response['status_code'] = KTWS_SUCCESS;
  623 + $response['message'] = $session->get_session();
  624 +
  625 + return new SOAP_Value('return',"{urn:$this->namespace}kt_response", $response);
  626 + }
  627 +
590 628 /**
591 629 * Creates a new session for the user.
592 630 *
... ... @@ -672,7 +710,7 @@ class KTWebService
672 710 'status_code'=>KTWS_ERR_INVALID_FOLDER,
673 711 'message'=>$folder->getMessage()
674 712 );
675   - return new SOAP_Value('return',"{urn:$this->namespace}kt_folder_detail", $kt);
  713 + return new SOAP_Value('return',"{urn:$this->namespace}kt_folder_detail", $response);
676 714 }
677 715  
678 716 $detail = $folder->get_detail();
... ... @@ -810,7 +848,7 @@ class KTWebService
810 848 }
811 849  
812 850 $listing = $folder->get_listing($depth, $what);
813   -
  851 +
814 852 $contents = array(
815 853 'status_code'=>KTWS_SUCCESS,
816 854 'message'=>'',
... ...