Code Duplication    Length = 7-12 lines in 3 locations

calendar/inc/class.calendar_bo.inc.php 2 locations

@@ 404-410 (lines=7) @@
401
				{
402
					$contact = 'c'.$contact['id'];
403
				}
404
				if ($ignore_acl || $this->check_perms(ACL::READ|self::ACL_READ_FOR_PARTICIPANTS|($use_freebusy?self::ACL_FREEBUSY:0),0,$contact))
405
				{
406
					if ($contact && !in_array($contact,$contact_list))	// already added?
407
					{
408
						$contact_list[] = $contact;
409
					}
410
				}
411
			}
412
		}
413
		return $contact_list;
@@ 512-523 (lines=12) @@
509
				if ($no_enum_groups) continue;
510
511
				$members = $GLOBALS['egw']->accounts->members($user, true);
512
				if (is_array($members))
513
				{
514
					foreach($members as $member)
515
					{
516
						// use only members which gave the user a read-grant
517
						if (!in_array($member, $users) &&
518
							($ignore_acl || $this->check_perms(Acl::READ|($use_freebusy?self::ACL_FREEBUSY:0),0,$member)))
519
						{
520
							$users[] = $member;
521
						}
522
					}
523
				}
524
			}
525
			else	// for users we have to include all the memberships, to get the group-events
526
			{

calendar/inc/class.calendar_boupdate.inc.php 1 location

@@ 2205-2216 (lines=12) @@
2202
			if ($GLOBALS['egw']->accounts->get_type($user) == 'g')
2203
			{
2204
				$members = $GLOBALS['egw']->accounts->members($user, true);
2205
				if (is_array($members))
2206
				{
2207
					foreach($members as $member)
2208
					{
2209
						// use only members which gave the user a read-grant
2210
						if (!in_array($member, $users) &&
2211
								$this->check_perms(Acl::READ|self::ACL_FREEBUSY, 0, $member))
2212
						{
2213
							$users[] = $member;
2214
						}
2215
					}
2216
				}
2217
			}
2218
			else	// for users we have to include all the memberships, to get the group-events
2219
			{