Code Duplication    Length = 9-9 lines in 3 locations

mod/gc_onboard/actions/groups/membership/join.php 1 location

@@ 29-37 (lines=9) @@
26
27
	// join or request
28
	$join = false;
29
	if ($group->isPublicMembership() || $group->canEdit($user->guid)) {
30
		// anyone can join public groups and admins can join any group
31
		$join = true;
32
	} else {
33
		if (check_entity_relationship($group->guid, 'invited', $user->guid)) {
34
			// user has invite to closed group
35
			$join = true;
36
		}
37
	}
38
39
	if ($join) {
40
		if (groups_join_group($group, $user)) {

mod/groups/actions/groups/membership/join.php 1 location

@@ 29-37 (lines=9) @@
26
27
	// join or request
28
	$join = false;
29
	if ($group->isPublicMembership() || $group->canEdit($user->guid)) {
30
		// anyone can join public groups and admins can join any group
31
		$join = true;
32
	} else {
33
		if (check_entity_relationship($group->guid, 'invited', $user->guid)) {
34
			// user has invite to closed group
35
			$join = true;
36
		}
37
	}
38
39
	if ($join) {
40
		if (groups_join_group($group, $user)) {

mod/gc_mobile_api/models/group.php 1 location

@@ 810-818 (lines=9) @@
807
808
		// join or request
809
		$join = false;
810
		if ($group->isPublicMembership() || $group->canEdit($user_entity->guid)) {
811
			// anyone can join public groups and admins can join any group
812
			$join = true;
813
		} else {
814
			if (check_entity_relationship($group->guid, 'invited', $user_entity->guid)) {
815
				// user has invite to closed group
816
				$join = true;
817
			}
818
		}
819
820
		if ($join) {
821
			if (groups_join_group($group, $user_entity)) {