Code Duplication    Length = 30-30 lines in 2 locations

Sources/ManageMail.php 1 location

@@ 421-450 (lines=30) @@
418
/**
419
 * Used for pausing the mail queue.
420
 */
421
function pauseMailQueueClear()
422
{
423
	global $context, $txt, $time_start;
424
425
	// Try get more time...
426
	@set_time_limit(600);
427
	if (function_exists('apache_reset_timeout'))
428
		@apache_reset_timeout();
429
430
	// Have we already used our maximum time?
431
	if (time() - array_sum(explode(' ', $time_start)) < 5)
432
		return;
433
434
	$context['continue_get_data'] = '?action=admin;area=mailqueue;sa=clear;te=' . $_GET['te'] . ';sent=' . $_GET['sent'] . ';' . $context['session_var'] . '=' . $context['session_id'];
435
	$context['page_title'] = $txt['not_done_title'];
436
	$context['continue_post_data'] = '';
437
	$context['continue_countdown'] = '2';
438
	$context['sub_template'] = 'not_done';
439
440
	// Keep browse selected.
441
	$context['selected'] = 'browse';
442
443
	// What percent through are we?
444
	$context['continue_percent'] = round(($_GET['sent'] / $_GET['te']) * 100, 1);
445
446
	// Never more than 100%!
447
	$context['continue_percent'] = min($context['continue_percent'], 100);
448
449
	obExit();
450
}
451
452
/**
453
 * Little utility function to calculate how long ago a time was.

Sources/ManageSettings.php 1 location

@@ 1213-1242 (lines=30) @@
1210
/**
1211
 * Just pause the signature applying thing.
1212
 */
1213
function pauseSignatureApplySettings()
1214
{
1215
	global $context, $txt, $sig_start;
1216
1217
	// Try get more time...
1218
	@set_time_limit(600);
1219
	if (function_exists('apache_reset_timeout'))
1220
		@apache_reset_timeout();
1221
1222
	// Have we exhausted all the time we allowed?
1223
	if (time() - array_sum(explode(' ', $sig_start)) < 3)
1224
		return;
1225
1226
	$context['continue_get_data'] = '?action=admin;area=featuresettings;sa=sig;apply;step=' . $_GET['step'] . ';' . $context['session_var'] . '=' . $context['session_id'];
1227
	$context['page_title'] = $txt['not_done_title'];
1228
	$context['continue_post_data'] = '';
1229
	$context['continue_countdown'] = '2';
1230
	$context['sub_template'] = 'not_done';
1231
1232
	// Specific stuff to not break this template!
1233
	$context[$context['admin_menu_name']]['current_subsection'] = 'sig';
1234
1235
	// Get the right percent.
1236
	$context['continue_percent'] = round(($_GET['step'] / $context['max_member']) * 100);
1237
1238
	// Never more than 100%!
1239
	$context['continue_percent'] = min($context['continue_percent'], 100);
1240
1241
	obExit();
1242
}
1243
1244
/**
1245
 * Show all the custom profile fields available to the user.