Code Duplication    Length = 7-10 lines in 6 locations

Sources/ManagePermissions.php 4 locations

@@ 589-598 (lines=10) @@
586
		);
587
588
		// And insert the copied permissions.
589
		if (!empty($inserts))
590
		{
591
			// ..and insert the new ones.
592
			$smcFunc['db_insert']('',
593
				'{db_prefix}board_permissions',
594
				array('permission' => 'string', 'id_group' => 'int', 'id_profile' => 'int', 'add_deny' => 'int'),
595
				$inserts,
596
				array('permission', 'id_group', 'id_profile')
597
			);
598
		}
599
600
		// Update any children out there!
601
		updateChildPermissions($_POST['group'], $_REQUEST['pid']);
@@ 1957-1963 (lines=7) @@
1954
			$inserts[] = array($profile_id, $row['id_group'], $row['permission'], $row['add_deny']);
1955
		$smcFunc['db_free_result']($request);
1956
1957
		if (!empty($inserts))
1958
			$smcFunc['db_insert']('insert',
1959
				'{db_prefix}board_permissions',
1960
				array('id_profile' => 'int', 'id_group' => 'int', 'permission' => 'string', 'add_deny' => 'int'),
1961
				$inserts,
1962
				array('id_profile', 'id_group', 'permission')
1963
			);
1964
	}
1965
	// Renaming?
1966
	elseif (isset($_POST['rename']))
@@ 2178-2186 (lines=9) @@
2175
		);
2176
2177
		// Do the insert.
2178
		if (!empty($permissions))
2179
		{
2180
			$smcFunc['db_insert']('insert',
2181
				'{db_prefix}board_permissions',
2182
				array('id_group' => 'int', 'id_profile' => 'int', 'permission' => 'string', 'add_deny' => 'int'),
2183
				$permissions,
2184
				array('id_group', 'id_profile', 'permission')
2185
			);
2186
		}
2187
	}
2188
}
2189
@@ 2427-2433 (lines=7) @@
2424
			}
2425
2426
			// Insert new permissions.
2427
			if (!empty($new_permissions))
2428
				$smcFunc['db_insert']('',
2429
					'{db_prefix}board_permissions',
2430
					array('id_profile' => 'int', 'id_group' => 'int', 'permission' => 'string', 'add_deny' => 'int'),
2431
					$new_permissions,
2432
					array('id_profile', 'id_group', 'permission')
2433
				);
2434
		}
2435
	}
2436

Sources/ManageMembergroups.php 1 location

@@ 412-418 (lines=7) @@
409
				$inserts[] = array($id_group, $row['id_profile'], $row['permission'], $row['add_deny']);
410
			$smcFunc['db_free_result']($request);
411
412
			if (!empty($inserts))
413
				$smcFunc['db_insert']('insert',
414
					'{db_prefix}board_permissions',
415
					array('id_group' => 'int', 'id_profile' => 'int', 'permission' => 'string', 'add_deny' => 'int'),
416
					$inserts,
417
					array('id_group', 'id_profile', 'permission')
418
				);
419
420
			// Also get some membergroup information if we're copying and not copying from guests...
421
			if ($copy_id > 0 && $_POST['perm_type'] == 'copy')

Sources/Subs.php 1 location

@@ 5757-5763 (lines=7) @@
5754
	updateSettings(array('tld_regex' => $tld_regex));
5755
5756
	// Schedule a background update if we need one
5757
	if (!empty($schedule_update))
5758
	{
5759
		$smcFunc['db_insert']('insert', '{db_prefix}background_tasks',
5760
			array('task_file' => 'string-255', 'task_class' => 'string-255', 'task_data' => 'string', 'claimed_time' => 'int'),
5761
			array('$sourcedir/tasks/UpdateTldRegex.php', 'Update_TLD_Regex', '', 0), array()
5762
		);
5763
	}
5764
5765
	// Redundant repetition is redundant
5766
	$done = true;