Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
voitto committed Sep 23, 2009
1 parent d499b5d commit c4413d4
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions db/library/dbscript/_functions.php
Expand Up @@ -946,16 +946,18 @@ function member_of( $group ) {
$Group =& $db->model('Group');

$p = $Person->find( get_person_id() );

while ( $m = $p->NextChild( 'memberships' )) {
$g = $Group->find( $m->group_id );
$memberships[] = $g->name;
if ($p)
while ( $m = $p->NextChild( 'memberships' )) {
$g = $Group->find( $m->group_id );
$memberships[] = $g->name;

if (!$g)
trigger_error( "the Group with id ".$m->group_id." does not exist", E_USER_ERROR );
if ( $g->name == $group )
return true;
}
if (!$g)
trigger_error( "the Group with id ".$m->group_id." does not exist", E_USER_ERROR );
if ( $g->name == $group )
return true;
}
else
return false;

} else {

Expand Down

0 comments on commit c4413d4

Please sign in to comment.