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:
Klaus Leithoff 2011-07-07 08:19:31 +00:00
parent c5de5fd8e2
commit 8d9003fbf8
2 changed files with 5 additions and 6 deletions

View File

@ -297,17 +297,18 @@ class infolog_bo
{
static $cache = array();
$info_id = is_array($info) ? $info['info_id'] : $info;
if (!$user) $user = $this->user;
if ($user == $this->user)
{
$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
{
$grants = $GLOBALS['egw']->acl->get_grants('infolog',$this->group_owners ? $this->group_owners : true,$user);
}
if (!$info)
{
$owner = $other ? $other : $user;
@ -315,7 +316,6 @@ class infolog_bo
return $grant & $required_rights;
}
$info_id = is_array($info) ? $info['info_id'] : $info;
if (!isset($access))
{

View File

@ -88,7 +88,7 @@ class infolog_so
if (!$user) $user = $this->user;
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))
{
$user_and_memberships = $GLOBALS['egw']->accounts->memberships($user,true);
@ -120,7 +120,7 @@ class infolog_so
{
// dont change our own internal data,
$backup_data = $this->data;
$info = $this->read((array)$info);
$info = $this->read(array('info_id'=>$info));
$this->data = $backup_data;
}
else
@ -132,7 +132,6 @@ class infolog_so
return False;
}
$owner = $info['info_owner'];
$access_ok = $owner == $user || // user has all rights
// ACL only on public entrys || $owner granted _PRIVATE
(!!($grants[$owner] & $required_rights) ||