Code Duplication    Length = 7-10 lines in 6 locations

Sources/ManageMembergroups.php 1 location

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

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']);
@@ 1958-1964 (lines=7) @@
1955
			$inserts[] = array($profile_id, $row['id_group'], $row['permission'], $row['add_deny']);
1956
		$smcFunc['db_free_result']($request);
1957
1958
		if (!empty($inserts))
1959
			$smcFunc['db_insert']('insert',
1960
				'{db_prefix}board_permissions',
1961
				array('id_profile' => 'int', 'id_group' => 'int', 'permission' => 'string', 'add_deny' => 'int'),
1962
				$inserts,
1963
				array('id_profile', 'id_group', 'permission')
1964
			);
1965
	}
1966
	// Renaming?
1967
	elseif (isset($_POST['rename']))
@@ 2179-2187 (lines=9) @@
2176
		);
2177
2178
		// Do the insert.
2179
		if (!empty($permissions))
2180
		{
2181
			$smcFunc['db_insert']('insert',
2182
				'{db_prefix}board_permissions',
2183
				array('id_group' => 'int', 'id_profile' => 'int', 'permission' => 'string', 'add_deny' => 'int'),
2184
				$permissions,
2185
				array('id_group', 'id_profile', 'permission')
2186
			);
2187
		}
2188
	}
2189
}
2190
@@ 2428-2434 (lines=7) @@
2425
			}
2426
2427
			// Insert new permissions.
2428
			if (!empty($new_permissions))
2429
				$smcFunc['db_insert']('',
2430
					'{db_prefix}board_permissions',
2431
					array('id_profile' => 'int', 'id_group' => 'int', 'permission' => 'string', 'add_deny' => 'int'),
2432
					$new_permissions,
2433
					array('id_profile', 'id_group', 'permission')
2434
				);
2435
		}
2436
	}
2437

Sources/Subs.php 1 location

@@ 5688-5694 (lines=7) @@
5685
	updateSettings(array('tld_regex' => $tld_regex));
5686
5687
	// Schedule a background update if we need one
5688
	if (!empty($schedule_update))
5689
	{
5690
		$smcFunc['db_insert']('insert', '{db_prefix}background_tasks',
5691
			array('task_file' => 'string-255', 'task_class' => 'string-255', 'task_data' => 'string', 'claimed_time' => 'int'),
5692
			array('$sourcedir/tasks/UpdateTldRegex.php', 'Update_TLD_Regex', '', 0), array()
5693
		);
5694
	}
5695
5696
	// Redundant repetition is redundant
5697
	$done = true;