[ Index ]
 

Code source de eGroupWare 1.2.106-2

Accédez au Source d'autres logiciels libresSoutenez Angelica Josefina !

title

Body

[fermer]

/ -> xmlrpc.php (source)

   1  <?php
   2      /**************************************************************************\
   3      * eGroupWare xmlrpc server                                                 *
   4      * http://www.egroupware.org                                                *
   5      * This file written by Miles Lott <milos@groupwhere.org>                   *
   6      * --------------------------------------------                             *
   7      *  This program is free software; you can redistribute it and/or modify it *
   8      *  under the terms of the GNU General Public License as published by the   *
   9      *  Free Software Foundation; either version 2 of the License, or (at your  *
  10      *  option) any later version.                                              *
  11      \**************************************************************************/
  12  
  13      /* $Id: xmlrpc.php 20295 2006-02-15 12:31:25Z  $ */
  14      /* $Source$ */
  15      /*list($usec, $sec) = explode(" ", microtime());
  16      $GLOBALS['concisus']['script_start'] = ((float)$usec + (float)$sec);*/
  17  
  18      $GLOBALS['egw_info'] = array();
  19      $GLOBALS['egw_info']['flags'] = array(
  20          'currentapp'            => 'login',
  21          'noheader'              => True,
  22          'disable_Template_class' => True
  23      );
  24      include('header.inc.php');
  25  
  26      //viniciuscb: a secure way to know if we're in a xmlrpc call...
  27      $GLOBALS['egw_info']['server']['xmlrpc'] = true;
  28  
  29      $server = CreateObject('phpgwapi.xmlrpc_server');
  30  
  31      /* uncomment here if you want to show all of the testing functions for compatibility */
  32      //include(EGW_API_INC . '/xmlrpc.interop.php');
  33  
  34      if (!$GLOBALS['egw_info']['server']['xmlrpc_enabled'])
  35      {
  36          $server->xmlrpc_error(9999,'xmlrpc service is not enabled in the eGroupWare system configuration');
  37          exit;
  38      }
  39  
  40      /* Note: this command only available natively in Apache (Netscape/iPlanet/SunONE in php >= 4.3.3) */
  41      if(!function_exists('getallheaders'))
  42      {
  43  		function getallheaders()
  44          {
  45              settype($headers,'array');
  46              foreach($_SERVER as $h => $v)
  47              {
  48                  if(ereg('HTTP_(.+)',$h,$hp))
  49                  {
  50                      $headers[$hp[1]] = $v;
  51                  }
  52              }
  53              return $headers;
  54          }
  55      }
  56      $headers = getallheaders();
  57  
  58      //print_r($headers);
  59      $isodate = $headers['isoDate'] ? $headers['isoDate'] : $headers['isodate'];
  60      $isodate = ($isodate == 'simple') ? True : False;
  61      $server->setSimpleDate($isodate);
  62      $auth_header = $headers['Authorization'] ? $headers['Authorization'] : $headers['authorization'];
  63  
  64      if(eregi('Basic *([^ ]*)',$auth_header,$auth))
  65      {
  66          list($sessionid,$kp3) = explode(':',base64_decode($auth[1]));
  67          //echo "auth='$auth[1]', sessionid='$sessionid', kp3='$kp3'\n";
  68      }
  69      else
  70      {
  71          $sessionid = get_var('sessionid',array('COOKIE','GET'));
  72          $kp3 = get_var('kp3',array('COOKIE','GET'));
  73      }
  74      $server->authed = $GLOBALS['egw']->session->verify($sessionid,$kp3);
  75  
  76      if (!$server->authed and isset($_SERVER['PHP_AUTH_USER']) and isset($_SERVER['PHP_AUTH_PW']))
  77      {
  78          $authed = $GLOBALS['egw']->session->create($login.'@'.$domain, $_SERVER['PHP_AUTH_PW'], 'text');
  79  
  80          if ($authed)
  81          {
  82              $server->authed = true;
  83          }
  84      }
  85  
  86      $server->service($_SERVER['HTTP_RAW_POST_DATA']);
  87  ?>


Généré le : Sun Feb 25 17:20:01 2007 par Balluche grâce à PHPXref 0.7