- applied patch from cornelius Weiss: fixes some probs with xmlrpc too

- small documentation update
This commit is contained in:
Ralf Becker 2005-04-13 08:53:42 +00:00
parent cedb9b553f
commit 93c063bd6c

View File

@ -31,7 +31,8 @@
* It is also used for granting a user "membership" to a group, or making a user have the security equivilance of another user. * It is also used for granting a user "membership" to a group, or making a user have the security equivilance of another user.
* It is also used for granting a user or group rights to various records, such as todo or calendar items of another user. * It is also used for granting a user or group rights to various records, such as todo or calendar items of another user.
* $acl =& CreateObject('phpgwapi.acl',5); // 5 is the user id * $acl =& CreateObject('phpgwapi.acl',5); // 5 is the user id
* @author Seek3r *
* @author Seek3r and others
* @copyright LGPL * @copyright LGPL
* @package api * @package api
* @subpackage accounts * @subpackage accounts
@ -63,10 +64,10 @@
/** /**
* ACL constructor for setting account id * ACL constructor for setting account id
* *
* Author: Seek3r <br> * Sets the ID for $acl->account_id. Can be used to change a current instances id as well.
* Sets the ID for $acl->account_id. Can be used to change a current instances id as well. <br> * Some functions are specific to this account, and others are generic.
* Some functions are specific to this account, and others are generic. <br> *
* @example acl->acl(5); // 5 is the user id <br> * @example acl->acl(5); // 5 is the user id
* @param int $account_id int-the user id * @param int $account_id int-the user id
*/ */
function acl($account_id = '') function acl($account_id = '')
@ -130,13 +131,10 @@
\**************************************************************************/ \**************************************************************************/
/** /**
* Read acl records from reposity * Read acl records for $acl->account_id from reposity
* *
* Author: Seek3r <br> * @internal
* Reads ACL records for $acl->account_id and returns array along with storing it in $acl->data. <br> * @return array along with storing it in $acl->data. <br>
* Syntax: array read_repository() <br>
* Example1: acl->read_repository(); <br>
* Should only be called within this class
*/ */
function read_repository() function read_repository()
{ {
@ -146,18 +144,18 @@
{ {
$this->acl(); $this->acl();
} }
$this->db->select($this->table_name,'*',array( $acl_acc_list = array_values((array)$this->get_location_list_for_id('phpgw_group', 1, $this->account_id));
'acl_account' => array($this->account_id,0) + array_values((array)$this->get_location_list_for_id('phpgw_group', 1, $this->account_id)) array_unshift($acl_acc_list,$this->account_id,0);
),__LINE__,__FILE__); $this->db->select($this->table_name,'*',array('acl_account' => $acl_acc_list ),__LINE__,__FILE__);
$this->data = Array(); $this->data = Array();
while($this->db->next_record()) while(($row = $this->db->row(true)))
{ {
$this->data[] = array( $this->data[] = array(
'appname' => $this->db->f('acl_appname'), 'appname' => $row['acl_appname'],
'location' => $this->db->f('acl_location'), 'location' => $row['acl_location'],
'account' => $this->db->f('acl_account'), 'account' => $row['acl_account'],
'rights' => $this->db->f('acl_rights') 'rights' => $row['acl_rights'],
); );
} }
return $this->data; return $this->data;
@ -166,7 +164,6 @@
/** /**
* Read acl records from $acl->data * Read acl records from $acl->data
* *
* Author: Seek3r
* @return array all ACL records from $this->data. * @return array all ACL records from $this->data.
*/ */
function read() function read()