Code Duplication    Length = 10-10 lines in 2 locations

mod/gc_mobile_api/models/blog.php 1 location

@@ 440-449 (lines=10) @@
437
	 if ($status != 0 && $status != 1) { $status = 0; }
438
439
	 // if there is a container_guid, .: group, and access is set to group only, set access to proper group only
440
	 if (!empty($container_guid) && $access == 2){
441
		 $container = get_entity($container_guid);
442
		 //validate container and ability to write to it
443
		 if (!$container || !$container->canWriteToContainer(0, 'object', 'blog')) {
444
 			return elgg_echo('blog:error:cannot_write_to_container');
445
 		} else {
446
			$access = $container->group_acl;
447
		}
448
		 //If no group container, use user guid.
449
	 } else if ($container_guid=='') { $container_guid = $user_entity->guid; }
450
451
	 //Set int variables to correct
452
	 if ($status == 1) { $status = 'published'; } else { $status = 'draft'; }

mod/gc_mobile_api/models/event.php 1 location

@@ 551-560 (lines=10) @@
548
	 if ($status != 0 && $status != 1) { $status = 0; }
549
550
	 // if there is a container_guid, .: group, and access is set to group only, set access to proper group only
551
	 if (!empty($container_guid) && $access == 2){
552
		 $container = get_entity($container_guid);
553
		 //validate container and ability to write to it
554
		 if (!$container || !$container->canWriteToContainer(0, 'object', 'blog')) {
555
 			return elgg_echo('blog:error:cannot_write_to_container');
556
 		} else {
557
			$access = $container->group_acl;
558
		}
559
		 //If no group container, use user guid.
560
	 } else if ($container_guid=='') { $container_guid = $user_entity->guid; }
561
562
	 //Set int variables to correct
563
	 if ($status == 1) { $status = 'published'; } else { $status = 'draft'; }