phpgroupware-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Phpgroupware-cvs] api/interface/class.interface_soap.php, 1.1.2.5


From: nomail
Subject: [Phpgroupware-cvs] api/interface/class.interface_soap.php, 1.1.2.5
Date: Thu, 20 May 2004 15:48:02 -0000

Update of /api/interface
Modified Files:
        Branch: proposal-branch
          class.interface_soap.php

date: 2004/04/16 20:59:49;  author: seek3r;  state: Exp;  lines: +36 -45

Log Message:
bringing savannah cvs back up to date with what we were doing on our private 
cvs server. We will not be doing dev from this cvs tree
=====================================================================
No syntax errors detected in -
=====================================================================
Index: api/interface/class.interface_soap.php
diff -u api/interface/class.interface_soap.php:1.1.2.4 
api/interface/class.interface_soap.php:1.1.2.5
--- api/interface/class.interface_soap.php:1.1.2.4      Thu Dec 25 02:20:18 2003
+++ api/interface/class.interface_soap.php      Fri Apr 16 20:59:49 2004
@@ -32,26 +32,27 @@
                var $inputs;
                var $method_result;
                var $indent = '';
-               var $first_input = True;
+               var $first_input = true;
                
                function api_interface()
                {
                        $this->parse();
                        $GLOBALS['phpgw_data']['api']['op'] = $this->op;
-                       $GLOBALS['phpgw_data']['server']['session_method'] = 
'url';
+                       $_SESSION['phpgw_data']['server']['session_method'] = 
'url';
                }
 
-               function output($result, $debug = False)
+               function output($result, $debug = false)
                {
+                       define('PHPGW_FINISHED', true);
                        if(!$debug)
                        {
                                header('Content-type: text/xml');
                                header('Content-Length: '.strlen($result));
-                               echo $result;
+                               return $result;
                        }
                        else
                        {
-                               echo htmlentities($result);
+                               return htmlentities($result);
                        }
                }
 
@@ -62,7 +63,7 @@
 
                function login()
                {
-                       $GLOBALS['phpgw']->finish(False);
+                       $GLOBALS['phpgw']->finish(false);
                        $this->soap_fault('1', 'Please login.');
                }
 
@@ -82,10 +83,7 @@
                        
                        $result .= "</".$this->mainnodename."Response>\n";
                        $result .= "</SOAP-ENV:Body>";
-//html_print_r($GLOBALS['phpgw']);
-//exit;
-                       $GLOBALS['phpgw']->session->save_data();
-                       $this->output($result);
+                       echo $this->output($result);
                        exit;
                }
                
@@ -131,25 +129,29 @@
 
                function sendtoclient()
                {
-                       $xml_result =  
$GLOBALS['phpgw']->base_xml->export_xml();
-                       $api_data = xml2var($xml_result);
-
+                       if (defined('MISBEHAVEDAPP'))
+                       {
+                               $this->soap_fault('1', 'Method returned faulty 
data. May not be SOAP compliant.');
+                       }
+                       
                        switch ($this->methodName)
                        {
                                case 'system.listMethods':
-                                       $this->system_listMethods();
-                                       return;
+                                       return $this->system_listMethods();
                                case 'system.methodSignature':
-                                       $this->system_methodSignature();
-                                       return;
+                                       return $this->system_methodSignature();
                                case 'system.methodHelp':
-                                       $this->system_methodHelp();
-                                       return;                                 
+                                       return $this->system_methodHelp();
                        }
                        
-                       if(empty($this->method_result) && 
isset($api_data['APP']))
+                       if(empty($this->method_result))
                        {
-                               $this->method_result = $api_data['APP'];
+                               $xml_result =  
$GLOBALS['phpgw']->base_xml->export_xml();
+                               $api_data = xml2var($xml_result);
+                               if(isset($api_data['APP']))
+                               {
+                                       $this->method_result = $api_data['APP'];
+                               }
                        }
                        
                        /* Constructing the XML doc */
@@ -170,7 +172,7 @@
                        $response_packet .= 
"</".$this->mainnodename."Response>\n";
                        $response_packet .= "</SOAP-ENV:Body>";
                        
-                       $this->output($response_packet);
+                       return $this->output($response_packet);
                }
                
                function parse()
@@ -187,7 +189,7 @@
                        }
                        $tmp = explode ("\n", $GLOBALS['HTTP_RAW_POST_DATA']);
                        $num = count($tmp);
-                       $hit_start = False;
+                       $hit_start = false;
                        $soap_input = '';
                        for ($i=0; $i < $num; $i++)
                        {
@@ -197,7 +199,7 @@
                                }
                                elseif(stristr($tmp[$i], '<?xml'))
                                {
-                                       $hit_start = True;
+                                       $hit_start = true;
                                        $soap_input .= $tmp[$i]."\n";
                                }
                        }
@@ -211,12 +213,9 @@
                        $this->xml_vals = $xml_vals;
                        unset($xml_index, $xml_vals);
 
-//html_print_r($this->xml_index);
-//html_print_r($this->xml_vals);
-//exit;
                        
if(!isset($this->xml_vals[$this->xml_index['SOAP-ENV:Body'][0]+1]['tag']))
                        {
-                               $GLOBALS['phpgw']->finish(False);
+                               $GLOBALS['phpgw']->finish(false);
                                $this->soap_fault('1', 'Invalid soap packet. 
Main body tag missing.');
                        }
                        $this->mainnodename = 
$this->xml_vals[$this->xml_index['SOAP-ENV:Body'][0]+1]['tag'];
@@ -250,9 +249,6 @@
                                        $this->inputs = 
array_merge($this->inputs, $additional_inputs);
                                }
                        }
-//echo 'inputs<br>';
-//html_print_r($this->inputs);
-//exit;
                }
 
                function parse_params()
@@ -280,23 +276,21 @@
                                                        break;
                                        }
                                        $this->i++;
-//echo '$name: '.$name.'<br>';
-//echo '$value: '.$value.'<br>';
                                        if($this->op == 'api.base.login')
                                        {
                                                if($name == 'phpgw_user')
                                                {
-                                                       
$GLOBALS['HTTP_GET_VARS']['phpgw_user'] = $value;
+                                                       $_GET['phpgw_user'] = 
$value;
                                                }
                                                elseif($name == 'phpgw_pass')
                                                {
-                                                       
$GLOBALS['HTTP_GET_VARS']['phpgw_pass'] = $value;
+                                                       $_GET['phpgw_pass'] = 
$value;
                                                }
                                                return;
                                        }
                                        elseif($name == 'sid')
                                        {
-                                               
$GLOBALS['HTTP_GET_VARS']['sid'] = $value;
+                                               $_GET['sid'] = $value;
                                                return;
                                        }
                                        else
@@ -457,8 +451,7 @@
                                }
                                $result .= 
"</data>\n</array>\n</value>\n</param>\n</params>\n</methodResponse>";
                        }
-                       $this->output($result);
-                       exit;
+                       return $this->output($result);
                }
 
                function system_methodSignature()
@@ -492,8 +485,7 @@
                                        $result .= 
"</data>\n</array></value>\n</data>\n</array></value>\n</param>\n</params>\n";
                                }
                                $result .= "</methodResponse>\n";
-                               $this->output($result);
-                               exit;
+                               return $this->output($result);
                        }
                        
elseif(isset($GLOBALS['docs'][$app]['classes'][$app.'_'.$class]['functions'][$func])
 && !$GLOBALS['phpgw']->acl->check($methodname, 1))
                        {
@@ -533,8 +525,7 @@
                                        $result .= "</param>\n</params>\n";
                                }
                                $result .= "</methodResponse>\n";
-                               $this->output($result);
-                               exit;
+                               return $this->output($result);
                        }
                        
elseif(isset($GLOBALS['docs'][$app]['classes'][$app.'_'.$class]['functions'][$func])
 && !$GLOBALS['phpgw']->acl->check($methodname, 1))
                        {
@@ -557,7 +548,7 @@
                        $error_result .= "              </SOAP-ENV:Fault>\n";
                        $error_result .= "      </SOAP-ENV:Body>\n";
                        $error_result .= "</SOAP-ENV:Envelope>\n";
-                       $this->output($error_result);
+                       echo $this->output($error_result);
                        exit;
                }       
        }




reply via email to

[Prev in Thread] Current Thread [Next in Thread]