mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-07 16:44:20 +01:00
adding an ignore-acl parameter to addressbook_bo::read() and addressbook_merge::get_replacements()
This commit is contained in:
parent
a0338f3398
commit
cd1692c4a6
@ -1055,15 +1055,16 @@ class addressbook_bo extends addressbook_so
|
||||
* reads contacts matched by key and puts all cols in the data array
|
||||
*
|
||||
* @param int|string $contact_id
|
||||
* @param boolean $ignore_acl =false true: no acl check
|
||||
* @return array|boolean array with contact data, null if not found or false on no view perms
|
||||
*/
|
||||
function read($contact_id)
|
||||
function read($contact_id, $ignore_acl=false)
|
||||
{
|
||||
if (!($data = parent::read($contact_id)))
|
||||
{
|
||||
$data = null; // not found
|
||||
}
|
||||
elseif (!$this->check_perms(EGW_ACL_READ,$data))
|
||||
elseif (!$ignore_acl && !$this->check_perms(EGW_ACL_READ,$data))
|
||||
{
|
||||
$data = false; // no view perms
|
||||
}
|
||||
|
@ -46,17 +46,18 @@ class addressbook_merge extends bo_merge
|
||||
*
|
||||
* @param int $id id of entry
|
||||
* @param string &$content=null content to create some replacements only if they are use
|
||||
* @param boolean $ignore_acl =false true: no acl check
|
||||
* @return array|boolean
|
||||
*/
|
||||
protected function get_replacements($id,&$content=null)
|
||||
protected function get_replacements($id,&$content=null,$ignore_acl=false)
|
||||
{
|
||||
if (!($replacements = $this->contact_replacements($id)))
|
||||
if (!($replacements = $this->contact_replacements($id,'',$ignore_acl)))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if($content && strpos($content, '$$#') !== 0)
|
||||
{
|
||||
$this->cf_link_to_expand($this->contacts->read($id), $content, $replacements,'addressbook');
|
||||
$this->cf_link_to_expand($this->contacts->read($id, $ignore_acl), $content, $replacements,'addressbook');
|
||||
}
|
||||
|
||||
// Links
|
||||
|
@ -193,14 +193,15 @@ abstract class bo_merge
|
||||
* Return replacements for a contact
|
||||
*
|
||||
* @param int|string|array $contact contact-array or id
|
||||
* @param string $prefix='' prefix like eg. 'user'
|
||||
* @param string $prefix ='' prefix like eg. 'user'
|
||||
* @param boolean $ignore_acl =false true: no acl check
|
||||
* @return array
|
||||
*/
|
||||
public function contact_replacements($contact,$prefix='')
|
||||
public function contact_replacements($contact,$prefix='',$ignore_acl=false)
|
||||
{
|
||||
if (!is_array($contact))
|
||||
{
|
||||
$contact = $this->contacts->read($contact);
|
||||
$contact = $this->contacts->read($contact, $ignore_acl);
|
||||
}
|
||||
if (!is_array($contact)) return array();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user