mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-22 07:53:39 +01:00
fix bug that prevented the editing of own infologs, if no grouprights are set, and history config for application infolog is not set
This commit is contained in:
parent
c5de5fd8e2
commit
8d9003fbf8
@ -297,17 +297,18 @@ class infolog_bo
|
|||||||
{
|
{
|
||||||
static $cache = array();
|
static $cache = array();
|
||||||
|
|
||||||
|
$info_id = is_array($info) ? $info['info_id'] : $info;
|
||||||
|
|
||||||
if (!$user) $user = $this->user;
|
if (!$user) $user = $this->user;
|
||||||
if ($user == $this->user)
|
if ($user == $this->user)
|
||||||
{
|
{
|
||||||
$grants = $this->grants;
|
$grants = $this->grants;
|
||||||
$access =& $cache[$info_id][$required_rights]; // we only cache the current user!
|
if ($info_id) $access =& $cache[$info_id][$required_rights]; // we only cache the current user!
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$grants = $GLOBALS['egw']->acl->get_grants('infolog',$this->group_owners ? $this->group_owners : true,$user);
|
$grants = $GLOBALS['egw']->acl->get_grants('infolog',$this->group_owners ? $this->group_owners : true,$user);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$info)
|
if (!$info)
|
||||||
{
|
{
|
||||||
$owner = $other ? $other : $user;
|
$owner = $other ? $other : $user;
|
||||||
@ -315,7 +316,6 @@ class infolog_bo
|
|||||||
return $grant & $required_rights;
|
return $grant & $required_rights;
|
||||||
}
|
}
|
||||||
|
|
||||||
$info_id = is_array($info) ? $info['info_id'] : $info;
|
|
||||||
|
|
||||||
if (!isset($access))
|
if (!isset($access))
|
||||||
{
|
{
|
||||||
|
@ -88,7 +88,7 @@ class infolog_so
|
|||||||
if (!$user) $user = $this->user;
|
if (!$user) $user = $this->user;
|
||||||
|
|
||||||
static $um_cache = array();
|
static $um_cache = array();
|
||||||
$user_and_memberships =& $um_cache[$user];
|
if ($user == $this->user) $user_and_memberships =& $um_cache[$user];
|
||||||
if (!isset($user_and_memberships))
|
if (!isset($user_and_memberships))
|
||||||
{
|
{
|
||||||
$user_and_memberships = $GLOBALS['egw']->accounts->memberships($user,true);
|
$user_and_memberships = $GLOBALS['egw']->accounts->memberships($user,true);
|
||||||
@ -120,7 +120,7 @@ class infolog_so
|
|||||||
{
|
{
|
||||||
// dont change our own internal data,
|
// dont change our own internal data,
|
||||||
$backup_data = $this->data;
|
$backup_data = $this->data;
|
||||||
$info = $this->read((array)$info);
|
$info = $this->read(array('info_id'=>$info));
|
||||||
$this->data = $backup_data;
|
$this->data = $backup_data;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -132,7 +132,6 @@ class infolog_so
|
|||||||
return False;
|
return False;
|
||||||
}
|
}
|
||||||
$owner = $info['info_owner'];
|
$owner = $info['info_owner'];
|
||||||
|
|
||||||
$access_ok = $owner == $user || // user has all rights
|
$access_ok = $owner == $user || // user has all rights
|
||||||
// ACL only on public entrys || $owner granted _PRIVATE
|
// ACL only on public entrys || $owner granted _PRIVATE
|
||||||
(!!($grants[$owner] & $required_rights) ||
|
(!!($grants[$owner] & $required_rights) ||
|
||||||
|
Loading…
Reference in New Issue
Block a user