mlanthaler: Small fix to prevent E_NOTICEs.

(merged from branches/gsoc)


git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@41814 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Ingo Schommer 2007-09-14 23:12:22 +00:00
parent fa43f70696
commit 3d612298a4
1 changed files with 9 additions and 3 deletions

View File

@ -97,9 +97,15 @@ class Permission extends DataObject {
// Build a list of the IDs of the groups. Most of the heavy lifting is done by Member::Groups
// NOTE: This isn't effecient; but it's called once per session so it's a low priority to fix.
$groups = $member->Groups();
if($groups) foreach($groups as $group) $groupList[] = $group->ID;
// Session caching
$groupList = array();
if($groups) {
foreach($groups as $group)
$groupList[] = $group->ID;
}
// Session caching
if(!$memberID) {
$_SESSION['Permission_groupList'][$member->ID] = $groupList;
}