phpgroupware-cvs
[Top][All Lists]
Advanced

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

[Phpgroupware-cvs] CVS: phpgwapi/inc class.accounts_ldap.inc.php,1.101.2


From: Joseph Engo <address@hidden>
Subject: [Phpgroupware-cvs] CVS: phpgwapi/inc class.accounts_ldap.inc.php,1.101.2.13,1.101.2.13.2.1 class.accounts_sql.inc.php,1.80.2.8,1.80.2.8.2.1 class.acl.inc.php,1.65,1.65.4.1 class.applications.inc.php,1.45.2.1,1.45.2.1.2.1 class.sessions_db.inc.php,1.2.2.10,1.2.2.10.2.1 class.xmlrpc_server.inc.php,1.22,1.22.4.1 functions.inc.php,1.121.2.13,1.121.2.13.2.1 xml_functions.inc.php,1.22.2.1,1.22.2.1.2.1
Date: Wed, 26 Mar 2003 17:55:50 -0500

Update of /cvsroot/phpgroupware/phpgwapi/inc
In directory subversions:/tmp/cvs-serv8634

Modified Files:
      Tag: Version-0_9_16-branch
        class.accounts_ldap.inc.php class.accounts_sql.inc.php 
        class.acl.inc.php class.applications.inc.php 
        class.sessions_db.inc.php class.xmlrpc_server.inc.php 
        functions.inc.php xml_functions.inc.php 
Log Message:
- Bunch of changes to get XML-RPC workins correctly ... again
- Added XML-RPC method to return the phpgwapi version number
- Added XML-RPC methods for returning account information, groups isnt working 
yet
- Added 3 new ACL levels for developers, instead of just add, delete, edit, etc 
 (These are generic ones and can be reassigned as needed)


Index: class.accounts_ldap.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/phpgwapi/inc/class.accounts_ldap.inc.php,v
retrieving revision 1.101.2.13
retrieving revision 1.101.2.13.2.1
diff -C2 -r1.101.2.13 -r1.101.2.13.2.1
*** class.accounts_ldap.inc.php 23 Mar 2003 10:03:47 -0000      1.101.2.13
--- class.accounts_ldap.inc.php 26 Mar 2003 22:55:47 -0000      1.101.2.13.2.1
***************
*** 743,750 ****
                                        $entry['objectclass'][2] = 
'organizationalPerson';
                                        $entry['objectclass'][3] = 
'inetOrgPerson';
-                                       /* $entry['objectclass'][4] = 
'account'; Causes problems with some LDAP servers */
                                        $entry['objectclass'][4] = 
'posixAccount';
                                        $entry['objectclass'][5] = 
'shadowAccount';
!                                       $entry['objectclass'][5] = 
'phpgwAccount';
                                        $entry['phpgwaccountstatus']    = 
$account_info['account_status'];
                                        $entry['phpgwaccounttype']      = 
$account_info['account_type'];
--- 743,749 ----
                                        $entry['objectclass'][2] = 
'organizationalPerson';
                                        $entry['objectclass'][3] = 
'inetOrgPerson';
                                        $entry['objectclass'][4] = 
'posixAccount';
                                        $entry['objectclass'][5] = 
'shadowAccount';
!                                       $entry['objectclass'][6] = 
'phpgwAccount';
                                        $entry['phpgwaccountstatus']    = 
$account_info['account_status'];
                                        $entry['phpgwaccounttype']      = 
$account_info['account_type'];

Index: class.accounts_sql.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/phpgwapi/inc/class.accounts_sql.inc.php,v
retrieving revision 1.80.2.8
retrieving revision 1.80.2.8.2.1
diff -C2 -r1.80.2.8 -r1.80.2.8.2.1
*** class.accounts_sql.inc.php  11 Oct 2002 00:33:25 -0000      1.80.2.8
--- class.accounts_sql.inc.php  26 Mar 2003 22:55:48 -0000      1.80.2.8.2.1
***************
*** 42,45 ****
--- 42,78 ----
                }
  
+               function list_methods($_type='xmlrpc')
+               {
+                       if (is_array($_type))
+                       {
+                               $_type = $_type['type'] ? $_type['type'] : 
$_type[0];
+                       }
+ 
+                       switch($_type)
+                       {
+                               case 'xmlrpc':
+                                       $xml_functions = array(
+                                               'get_list' => array(
+                                                       'function'  => 
'get_list',
+                                                       'signature' => 
array(array(xmlrpcStruct)),
+                                                       'docstring' => 
lang('Returns a full list of accounts on the system.  Warning: This is return 
can be quite large')
+                                               ),
+                                               'list_methods' => array(
+                                                       'function'  => 
'list_methods',
+                                                       'signature' => 
array(array(xmlrpcStruct,xmlrpcString)),
+                                                       'docstring' => 
lang('Read this list of methods.')
+                                               )
+                                       );
+                                       return $xml_functions;
+                                       break;
+                               case 'soap':
+                                       return $this->soap_functions;
+                                       break;
+                               default:
+                                       return array();
+                                       break;
+                       }
+               }
+ 
                /*!
                @function read_repository

Index: class.acl.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/phpgwapi/inc/class.acl.inc.php,v
retrieving revision 1.65
retrieving revision 1.65.4.1
diff -C2 -r1.65 -r1.65.4.1
*** class.acl.inc.php   11 Dec 2001 01:14:43 -0000      1.65
--- class.acl.inc.php   26 Mar 2003 22:55:48 -0000      1.65.4.1
***************
*** 63,67 ****
                {
                        $this->db = $GLOBALS['phpgw']->db;
!                       if($account_id != '')
                        {
                                $this->account_id = 
get_account_id($account_id,$GLOBALS['phpgw_info']['user']['account_id']);
--- 63,67 ----
                {
                        $this->db = $GLOBALS['phpgw']->db;
!                       if (! $account_id)
                        {
                                $this->account_id = 
get_account_id($account_id,$GLOBALS['phpgw_info']['user']['account_id']);
***************
*** 69,72 ****
--- 69,117 ----
                }
  
+               function list_methods($_type='xmlrpc')
+               {
+                       /*
+                         This handles introspection or discovery by the logged 
in client,
+                         in which case the input might be an array.  The 
server always calls
+                         this function to fill the server dispatch map using a 
string.
+                       */
+ 
+                       if (is_array($_type))
+                       {
+                               $_type = $_type['type'] ? $_type['type'] : 
$_type[0];
+                       }
+ 
+                       switch($_type)
+                       {
+                               case 'xmlrpc':
+                               $xml_functions = array(
+                                               'read_repository' => array(
+                                                       'function'  => 
'read_repository',
+                                                       'signature' => 
array(array(xmlrpcStruct)),
+                                                       'docstring' => 
lang('FIXME!')
+                                               ),
+                                               'get_rights' => array(
+                                                       'function'  => 
'get_rights',
+                                                       'signature' => 
array(array(xmlrpcStruct,xmlrpcStruct)),
+                                                       'docstring' => 
lang('FIXME!')
+ 
+                                               ),
+                                               'list_methods' => array(
+                                                       'function'  => 
'list_methods',
+                                                       'signature' => 
array(array(xmlrpcStruct,xmlrpcString)),
+                                                       'docstring' => 
lang('Read this list of methods.')
+                                               )
+                                       );
+                                       return $xml_functions;
+                                       break;
+                               case 'soap':
+                                       return $this->soap_functions;
+                                       break;
+                               default:
+                                       return array();
+                                       break;
+                       }
+               }
+ 
                
/**************************************************************************\
                * These are the standard $this->account_id specific functions   
           *
***************
*** 84,87 ****
--- 129,139 ----
                function read_repository()
                {
+                       // For some reason, calling this via XML-RPC doesn't 
call the constructor.
+                       // Here is yet another work around(tm) (jengo)
+                       if (! $this->account_id)
+                       {
+                               $this->acl();
+                       }
+ 
                        $sql = 'select * from phpgw_acl where (acl_account in 
('.$this->account_id.', 0'; 
  
***************
*** 224,227 ****
--- 276,287 ----
                function get_rights($location,$appname = False)
                {
+                       // For XML-RPC, change this once its working correctly 
for passing parameters (jengo)
+                       if (is_array($location))
+                       {
+                               $a        = $location;
+                               $location = $a['location'];
+                               $appname  = $a['appname'];
+                       }
+ 
                        if (count($this->data) == 0)
                        {

Index: class.applications.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/phpgwapi/inc/class.applications.inc.php,v
retrieving revision 1.45.2.1
retrieving revision 1.45.2.1.2.1
diff -C2 -r1.45.2.1 -r1.45.2.1.2.1
*** class.applications.inc.php  22 Mar 2003 12:10:26 -0000      1.45.2.1
--- class.applications.inc.php  26 Mar 2003 22:55:48 -0000      1.45.2.1.2.1
***************
*** 52,56 ****
                }
  
!               function DONTlist_methods($_type='xmlrpc')
                {
                        /*
--- 52,56 ----
                }
  
!               function list_methods($_type='xmlrpc')
                {
                        /*

Index: class.sessions_db.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/phpgwapi/inc/class.sessions_db.inc.php,v
retrieving revision 1.2.2.10
retrieving revision 1.2.2.10.2.1
diff -C2 -r1.2.2.10 -r1.2.2.10.2.1
*** class.sessions_db.inc.php   20 Mar 2003 23:53:26 -0000      1.2.2.10
--- class.sessions_db.inc.php   26 Mar 2003 22:55:48 -0000      1.2.2.10.2.1
***************
*** 383,387 ****
                        $GLOBALS['phpgw_info']['user']['account_id'] = 
$this->account_id;
                        
$GLOBALS['phpgw']->accounts->accounts($this->account_id);
- 
                        $this->sessionid = 
md5($GLOBALS['phpgw']->datetime->gmtnow . 
$GLOBALS['phpgw']->common->randomstring(10));
                        $this->kp3       = 
md5($GLOBALS['phpgw']->common->randomstring(15));
--- 383,386 ----

Index: class.xmlrpc_server.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/phpgwapi/inc/class.xmlrpc_server.inc.php,v
retrieving revision 1.22
retrieving revision 1.22.4.1
diff -C2 -r1.22 -r1.22.4.1
*** class.xmlrpc_server.inc.php 28 Dec 2001 18:41:33 -0000      1.22
--- class.xmlrpc_server.inc.php 26 Mar 2003 22:55:48 -0000      1.22.4.1
***************
*** 41,44 ****
--- 41,46 ----
                var $req_array = array();
                var $resp_struct = array();
+               var $debug = False;
+               var $method_requested;
  
                function xmlrpc_server($dispMap='', $serviceNow=0)
***************
*** 81,84 ****
--- 83,96 ----
                        Header("Content-type: text/xml\r\nContent-length: " . 
strlen($payload));
                        print $payload;
+ 
+                       if ($this->debug)
+                       {
+                               $this->echoInput();
+ 
+                               $fp = fopen('/tmp/xmlrpc_debug.out','w');
+                               fputs($fp,$payload);
+                               fclose($fp);
+                       }
+ 
                }
  
***************
*** 303,306 ****
--- 315,321 ----
                                        {
                                                /* phpgw mod - fetch the (bo) 
class methods to create the dmap */
+                                               // This part is to update 
session action to match
+                                               $this->method_requested = 
$methName;
+ 
                                                $method = $methName;
                                                $tmp = explode('.',$methName);
***************
*** 437,441 ****
  
                        $r = 
CreateObject('phpgwapi.xmlrpcresp',CreateObject('phpgwapi.xmlrpcval',"'Aha said 
I: '" . $HTTP_RAW_POST_DATA,'string'));
!                       echo $r->serialize();
                }
        }
--- 452,461 ----
  
                        $r = 
CreateObject('phpgwapi.xmlrpcresp',CreateObject('phpgwapi.xmlrpcval',"'Aha said 
I: '" . $HTTP_RAW_POST_DATA,'string'));
!                       //echo $r->serialize();
! 
!                       $fp = fopen('/tmp/xmlrpc_debug.in','w');
!                       fputs($fp,$r->serialize);
!                       fputs($fp,$HTTP_RAW_POST_DATA);
!                       fclose($fp);
                }
        }

Index: functions.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/phpgwapi/inc/functions.inc.php,v
retrieving revision 1.121.2.13
retrieving revision 1.121.2.13.2.1
diff -C2 -r1.121.2.13 -r1.121.2.13.2.1
*** functions.inc.php   22 Mar 2003 12:10:26 -0000      1.121.2.13
--- functions.inc.php   26 Mar 2003 22:55:48 -0000      1.121.2.13.2.1
***************
*** 726,729 ****
--- 726,732 ----
        define('PHPGW_ACL_PRIVATE',16);
        define('PHPGW_ACL_GROUP_MANAGERS',32);
+       define('PHPGW_ACL_CUSTOM_1',64);
+       define('PHPGW_ACL_CUSTOM_2',128);
+       define('PHPGW_ACL_CUSTOM_3',256);
  
        
/****************************************************************************\

Index: xml_functions.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/phpgwapi/inc/xml_functions.inc.php,v
retrieving revision 1.22.2.1
retrieving revision 1.22.2.1.2.1
diff -C2 -r1.22.2.1 -r1.22.2.1.2.1
*** xml_functions.inc.php       30 Jun 2002 00:54:25 -0000      1.22.2.1
--- xml_functions.inc.php       26 Mar 2003 22:55:48 -0000      1.22.2.1.2.1
***************
*** 735,738 ****
--- 735,748 ----
        }
  
+       $GLOBALS['_xmlrpcs_phpgw_api_version_sig'] = 
array(array(xmlrpcString,xmlrpcString));
+       $GLOBALS['_xmlrpcs_phpgw_api_version_doc'] = 'Returns the phpGroupWare 
API version';
+       function _xmlrpcs_phpgw_api_version($server,$m)
+       {
+               $version = 
$GLOBALS['phpgw_info']['server']['versions']['phpgwapi'];
+ 
+               return 
CreateObject('phpgwapi.xmlrpcresp',CreateObject('phpgwapi.xmlrpcval',$version,'string'));
+       }
+ 
+ 
        $GLOBALS['_xmlrpcs_logout_sig'] = 
array(array(xmlrpcStruct,xmlrpcStruct));
        $GLOBALS['_xmlrpcs_logout_doc'] = 'phpGroupWare client or server logout 
via XML-RPC';
***************
*** 791,794 ****
--- 801,809 ----
                        'signature' => $GLOBALS['_xmlrpcs_logout_sig'],
                        'docstring' => $GLOBALS['_xmlrpcs_logout_doc']
+               ),
+               'system.phpgw_api_version' => array(
+                       'function'  => '_xmlrpcs_phpgw_api_version',
+                       'signature' => 
$GLOBALS['_xmlrpcs_phpgw_api_version_sig'],
+                       'docstring' => 
$GLOBALS['_xmlrpcs_phpgw_api_version_doc']
                )
        );





reply via email to

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