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']);
@@ 1954-1960 (lines=7) @@
1951
			$inserts[] = array($profile_id, $row['id_group'], $row['permission'], $row['add_deny']);
1952
		$smcFunc['db_free_result']($request);
1953
1954
		if (!empty($inserts))
1955
			$smcFunc['db_insert']('insert',
1956
				'{db_prefix}board_permissions',
1957
				array('id_profile' => 'int', 'id_group' => 'int', 'permission' => 'string', 'add_deny' => 'int'),
1958
				$inserts,
1959
				array('id_profile', 'id_group', 'permission')
1960
			);
1961
	}
1962
	// Renaming?
1963
	elseif (isset($_POST['rename']))
@@ 2175-2183 (lines=9) @@
2172
		);
2173
2174
		// Do the insert.
2175
		if (!empty($permissions))
2176
		{
2177
			$smcFunc['db_insert']('insert',
2178
				'{db_prefix}board_permissions',
2179
				array('id_group' => 'int', 'id_profile' => 'int', 'permission' => 'string', 'add_deny' => 'int'),
2180
				$permissions,
2181
				array('id_group', 'id_profile', 'permission')
2182
			);
2183
		}
2184
	}
2185
}
2186
@@ 2424-2430 (lines=7) @@
2421
			}
2422
2423
			// Insert new permissions.
2424
			if (!empty($new_permissions))
2425
				$smcFunc['db_insert']('',
2426
					'{db_prefix}board_permissions',
2427
					array('id_profile' => 'int', 'id_group' => 'int', 'permission' => 'string', 'add_deny' => 'int'),
2428
					$new_permissions,
2429
					array('id_profile', 'id_group', 'permission')
2430
				);
2431
		}
2432
	}
2433

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

@@ 6083-6089 (lines=7) @@
6080
	updateSettings(array('tld_regex' => $tld_regex));
6081
6082
	// Schedule a background update if we need one
6083
	if (!empty($schedule_update))
6084
	{
6085
		$smcFunc['db_insert']('insert', '{db_prefix}background_tasks',
6086
			array('task_file' => 'string-255', 'task_class' => 'string-255', 'task_data' => 'string', 'claimed_time' => 'int'),
6087
			array('$sourcedir/tasks/UpdateTldRegex.php', 'Update_TLD_Regex', '', 0), array()
6088
		);
6089
	}
6090
6091
	// Redundant repetition is redundant
6092
	$done = true;