[ Index ] |
|
Code source de eGroupWare 1.2.106-2 |
1 <?php 2 /**************************************************************************\ 3 * eGroupWare API - SOAP functions * 4 * This file written by dietrich@ganx4.com * 5 * shared functions and vars for use with soap client/server * 6 * -------------------------------------------------------------------------* 7 * This library is free software; you can redistribute it and/or modify it * 8 * under the terms of the GNU Lesser General Public License as published by * 9 * the Free Software Foundation; either version 2.1 of the License, * 10 * or any later version. * 11 * This library is distributed in the hope that it will be useful, but * 12 * WITHOUT ANY WARRANTY; without even the implied warranty of * 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * 14 * See the GNU Lesser General Public License for more details. * 15 * You should have received a copy of the GNU Lesser General Public License * 16 * along with this library; if not, write to the Free Software Foundation, * 17 * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * 18 \**************************************************************************/ 19 20 /* $Id: soap_functions.inc.php 20295 2006-02-15 12:31:25Z $ */ 21 22 $GLOBALS['soapTypes'] = array( 23 'i4' => 1, 24 'int' => 1, 25 'boolean' => 1, 26 'string' => 1, 27 'double' => 1, 28 'float' => 1, 29 'dateTime' => 1, 30 'timeInstant' => 1, 31 'dateTime' => 1, 32 'base64Binary' => 1, 33 'base64' => 1, 34 'array' => 2, 35 'Array' => 2, 36 'SOAPStruct' => 3, 37 'ur-type' => 2 38 ); 39 40 while(list($key,$val) = each($GLOBALS['soapTypes'])) 41 { 42 $GLOBALS['soapKeys'][] = $val; 43 } 44 45 $GLOBALS['typemap'] = array( 46 'http://soapinterop.org/xsd' => array('SOAPStruct'), 47 'http://schemas.xmlsoap.org/soap/encoding/' => array('base64'), 48 'http://www.w3.org/1999/XMLSchema' => $GLOBALS['soapKeys'] 49 ); 50 51 $GLOBALS['namespaces'] = array( 52 'http://schemas.xmlsoap.org/soap/envelope/' => 'SOAP-ENV', 53 'http://www.w3.org/1999/XMLSchema-instance' => 'xsi', 54 'http://www.w3.org/1999/XMLSchema' => 'xsd', 55 'http://schemas.xmlsoap.org/soap/encoding/' => 'SOAP-ENC', 56 'http://soapinterop.org/xsd' => 'si' 57 ); 58 59 /* 60 NOTE: already defined in xml_functions 61 $xmlEntities = array( 62 'quot' => '"', 63 'amp' => '&', 64 'lt' => '<', 65 'gt' => '>', 66 'apos' => "'" 67 ); 68 */ 69 70 $GLOBALS['soap_defencoding'] = 'UTF-8'; 71 72 function system_login($m1,$m2,$m3) 73 { 74 $server_name = trim($m1); 75 $username = trim($m2); 76 $password = trim($m3); 77 78 list($sessionid,$kp3) = $GLOBALS['phpgw']->session->create_server($username.'@'.$server_name,$password,'text'); 79 80 if(!$sessionid && !$kp3) 81 { 82 if($server_name) 83 { 84 $user = $username.'@'.$server_name; 85 } 86 else 87 { 88 $user = $username; 89 } 90 $sessionid = $GLOBALS['phpgw']->session->create($user,$password,'text'); 91 $kp3 = $GLOBALS['phpgw']->session->kp3; 92 $domain = $GLOBALS['phpgw']->session->account_domain; 93 } 94 if($sessionid && $kp3) 95 { 96 $rtrn = array( 97 CreateObject('phpgwapi.soapval','domain','string',$domain), 98 CreateObject('phpgwapi.soapval','sessionid','string',$sessionid), 99 CreateObject('phpgwapi.soapval','kp3','string',$kp3) 100 ); 101 } 102 else 103 { 104 $rtrn = array(CreateObject('phpgwapi.soapval','GOAWAY','string',$username)); 105 } 106 return $rtrn; 107 } 108 109 function system_logout($m1,$m2) 110 { 111 $sessionid = $m1; 112 $kp3 = $m2; 113 114 $later = $GLOBALS['phpgw']->session->destroy($sessionid,$kp3); 115 116 if($later) 117 { 118 $rtrn = array( 119 CreateObject('phpgwapi.soapval','GOODBYE','string','XOXO') 120 ); 121 } 122 else 123 { 124 $rtrn = array( 125 CreateObject('phpgwapi.soapval','OOPS','string','WHAT?') 126 ); 127 } 128 return $rtrn; 129 } 130 131 /* 132 function system_listApps() 133 { 134 $GLOBALS['phpgw']->db->query("SELECT * FROM egw_applications WHERE app_enabled<3",__LINE__,__FILE__); 135 $apps = array(); 136 if($GLOBALS['phpgw']->db->num_rows()) 137 { 138 while ($GLOBALS['phpgw']->db->next_record()) 139 { 140 $name = $GLOBALS['phpgw']->db->f('app_name'); 141 $title = $GLOBALS['phpgw']->db->f('app_title'); 142 $status = $GLOBALS['phpgw']->db->f('app_enabled'); 143 $version= $GLOBALS['phpgw']->db->f('app_version'); 144 $apps[$name] = array( 145 CreateObject('phpgwapi.soapval','title','string',$title), 146 CreateObject('phpgwapi.soapval','name','string',$name), 147 CreateObject('phpgwapi.soapval','status','string',$status), 148 CreateObject('phpgwapi.soapval','version','string',$version) 149 ); 150 } 151 } 152 return $apps; 153 } 154 */ 155 ?>
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
Généré le : Sun Feb 25 17:20:01 2007 | par Balluche grâce à PHPXref 0.7 |