need to invalidate the cache, before new users can be assigned any memberships

This commit is contained in:
Ralf Becker 2006-06-07 17:55:57 +00:00
parent 51ca785916
commit 5a84e151b2

View File

@ -288,8 +288,6 @@ class accounts extends accounts_backend
*/ */
function save(&$data,$check_depricated_names=false) function save(&$data,$check_depricated_names=false)
{ {
$this->cache_invalidate($data['account_id']);
if ($check_depricated_names) if ($check_depricated_names)
{ {
foreach($this->depricated_names as $name) foreach($this->depricated_names as $name)
@ -303,9 +301,12 @@ class accounts extends accounts_backend
if (($id = parent::save($data)) && $data['account_type'] == 'u' && $data['account_primary_group'] && if (($id = parent::save($data)) && $data['account_type'] == 'u' && $data['account_primary_group'] &&
(!($memberships = $this->memberships($id,true)) || !in_array($data['account_primary_group'],$memberships))) (!($memberships = $this->memberships($id,true)) || !in_array($data['account_primary_group'],$memberships)))
{ {
$this->cache_invalidate($data['account_id']);
$memberships[] = $data['account_primary_group']; $memberships[] = $data['account_primary_group'];
$this->set_memberships($memberships,$id); $this->set_memberships($memberships,$id);
} }
$this->cache_invalidate($data['account_id']);
return $id; return $id;
} }