phpgroupware-cvs
[Top][All Lists]
Advanced

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

[Phpgroupware-cvs] CVS: phpgwapi/inc class.acl.inc.php,1.65,1.66


From: Ralf Becker <address@hidden>
Subject: [Phpgroupware-cvs] CVS: phpgwapi/inc class.acl.inc.php,1.65,1.66
Date: Sat, 17 May 2003 16:26:51 -0400

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

Modified Files:
        class.acl.inc.php 
Log Message:
fixed bug, account_id param in constructor was not used
merged jengos changes from .16 too

Index: class.acl.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/phpgwapi/inc/class.acl.inc.php,v
retrieving revision 1.65
retrieving revision 1.66
diff -C2 -r1.65 -r1.66
*** class.acl.inc.php   11 Dec 2001 01:14:43 -0000      1.65
--- class.acl.inc.php   17 May 2003 20:26:49 -0000      1.66
***************
*** 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 (!($this->account_id = intval($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)
                        {
***************
*** 252,255 ****
--- 312,316 ----
                                                        return False;
                                                }
+ 
                                                $rights |= 
$this->data[$idx]['rights'];
                                        }





reply via email to

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