17488 Posts in 4473 Topics by 1978 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 1042 Views |
-
Members.php fix ?

3 July 2008 at 3:36pm Last edited: 3 July 2008 3:36pm
I've come across a function that I think may be wrong.
Consider changing
public function inGroups(array $groups) {
foreach($this->Groups() as $group)
$memberGroups[] = $group->Title;return count(array_intersect($memberGroups, $groups)) > 0;
}To:
public function inGroups(array $groups) {
foreach($this->Groups() as $group)
$memberGroups[] = $group->ID;return count(array_intersect($memberGroups, $groups)) > 0;
}To check a member's permissions by group Title is unreliable as a title can duplicated.
-
Re: Members.php fix ?

3 July 2008 at 4:01pm
Make a ticket for this on open.silverstripe.com and submit this as a patch (instructions on open.silverstripe.com) then when somebody goes through the patchs and merges back / checks (usually someone does it twice a month or something) it will be reviewed / updated
Have you tested it? any side effects for uses in more then 1 group etc
-
Re: Members.php fix ?

3 July 2008 at 6:19pm
Yeah tested on an instance with multiple groups. Will submit as patch.
| 1042 Views | ||
|
Page:
1
|
Go to Top |


