Vergleich admin/modules/tools/tasks.php - 1.8.0 - 1.8.1

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 138Zeile 138

$new_task['nextrun'] = fetch_next_run($new_task);
$tid = $db->insert_query("tasks", $new_task);


$new_task['nextrun'] = fetch_next_run($new_task);
$tid = $db->insert_query("tasks", $new_task);

			$cache->update_tasks();





			$plugins->run_hooks("admin_tools_tasks_add_commit");

			$plugins->run_hooks("admin_tools_tasks_add_commit");

 

$cache->update_tasks();


// Log admin action
log_admin_action($tid, $mybb->input['title']);


// Log admin action
log_admin_action($tid, $mybb->input['title']);

Zeile 186Zeile 187
	$form_container = new FormContainer($lang->add_new_task);
$form_container->output_row($lang->title." <em>*</em>", "", $form->generate_text_box('title', $mybb->input['title'], array('id' => 'title')), 'title');
$form_container->output_row($lang->short_description." <em>*</em>", "", $form->generate_text_box('description', $mybb->input['description'], array('id' => 'description')), 'description');

	$form_container = new FormContainer($lang->add_new_task);
$form_container->output_row($lang->title." <em>*</em>", "", $form->generate_text_box('title', $mybb->input['title'], array('id' => 'title')), 'title');
$form_container->output_row($lang->short_description." <em>*</em>", "", $form->generate_text_box('description', $mybb->input['description'], array('id' => 'description')), 'description');


$task_list = array();
$task_files = scandir(MYBB_ROOT."inc/tasks/");
foreach($task_files as $task_file)
{
if(is_file(MYBB_ROOT."inc/tasks/{$task_file}") && get_extension($task_file) == "php")


$task_list = array();
$task_files = scandir(MYBB_ROOT."inc/tasks/");
foreach($task_files as $task_file)
{
if(is_file(MYBB_ROOT."inc/tasks/{$task_file}") && get_extension($task_file) == "php")

		{
$file_id = preg_replace("#\.".get_extension($task_file)."$#i", "$1", $task_file);
$task_list[$file_id] = $task_file;

		{
$file_id = preg_replace("#\.".get_extension($task_file)."$#i", "$1", $task_file);
$task_list[$file_id] = $task_file;

Zeile 295Zeile 296
				$errors[] = $lang->error_invalid_day;
}
$mybb->input['weekday'] = array('*');

				$errors[] = $lang->error_invalid_day;
}
$mybb->input['weekday'] = array('*');

		}
else
{

		}
else
{

			$mybb->input['weekday'] = check_time_values($mybb->input['weekday'], 0, 6, 'array');
if($mybb->input['weekday'] === false)
{

			$mybb->input['weekday'] = check_time_values($mybb->input['weekday'], 0, 6, 'array');
if($mybb->input['weekday'] === false)
{

Zeile 336Zeile 337
			);

$updated_task['nextrun'] = fetch_next_run($updated_task);

			);

$updated_task['nextrun'] = fetch_next_run($updated_task);

 

$plugins->run_hooks("admin_tools_tasks_edit_commit");


			$db->update_query("tasks", $updated_task, "tid='{$task['tid']}'");

			$db->update_query("tasks", $updated_task, "tid='{$task['tid']}'");

 


			$cache->update_tasks();

			$cache->update_tasks();


$plugins->run_hooks("admin_tools_tasks_edit_commit");






			// Log admin action
log_admin_action($task['tid'], $mybb->input['title']);

			// Log admin action
log_admin_action($task['tid'], $mybb->input['title']);


flash_message($lang->success_task_updated, 'success');

if($enable_confirmation == true)
{
admin_redirect("index.php?module=tools-tasks&amp;action=enable&amp;tid={$task['tid']}&amp;my_post_key={$mybb->post_code}");
}
else


flash_message($lang->success_task_updated, 'success');

if($enable_confirmation == true)
{
admin_redirect("index.php?module=tools-tasks&amp;action=enable&amp;tid={$task['tid']}&amp;my_post_key={$mybb->post_code}");
}
else

			{
admin_redirect("index.php?module=tools-tasks");
}

			{
admin_redirect("index.php?module=tools-tasks");
}

Zeile 471Zeile 474
		$db->delete_query("tasklog", "tid='{$task['tid']}'");

// Fetch next task run

		$db->delete_query("tasklog", "tid='{$task['tid']}'");

// Fetch next task run

		$cache->update_tasks();

$plugins->run_hooks("admin_tools_tasks_delete_commit");




$plugins->run_hooks("admin_tools_tasks_delete_commit");

$cache->update_tasks();


		// Log admin action
log_admin_action($task['tid'], $task['title']);

flash_message($lang->success_task_deleted, 'success');

		// Log admin action
log_admin_action($task['tid'], $task['title']);

flash_message($lang->success_task_deleted, 'success');

		admin_redirect("index.php?module=tools-tasks");
}
else
{
$page->output_confirm_action("index.php?module=tools-tasks&amp;action=delete&amp;tid={$task['tid']}", $lang->confirm_task_deletion);
}

		admin_redirect("index.php?module=tools-tasks");
}
else
{
$page->output_confirm_action("index.php?module=tools-tasks&amp;action=delete&amp;tid={$task['tid']}", $lang->confirm_task_deletion);
}

}

if($mybb->input['action'] == "enable" || $mybb->input['action'] == "disable")

}

if($mybb->input['action'] == "enable" || $mybb->input['action'] == "disable")

Zeile 492Zeile 496
	if(!verify_post_check($mybb->input['my_post_key']))
{
flash_message($lang->invalid_post_verify_key2, 'error');

	if(!verify_post_check($mybb->input['my_post_key']))
{
flash_message($lang->invalid_post_verify_key2, 'error');

		admin_redirect("index.php?module=tools-tasks");
}

		admin_redirect("index.php?module=tools-tasks");
}


$query = $db->simple_select("tasks", "*", "tid='".$mybb->get_input('tid', 1)."'");
$task = $db->fetch_array($query);


$query = $db->simple_select("tasks", "*", "tid='".$mybb->get_input('tid', 1)."'");
$task = $db->fetch_array($query);

Zeile 503Zeile 507
	{
flash_message($lang->error_invalid_task, 'error');
admin_redirect("index.php?module=tools-tasks");

	{
flash_message($lang->error_invalid_task, 'error');
admin_redirect("index.php?module=tools-tasks");

	}

	}


if($mybb->input['action'] == "enable")


if($mybb->input['action'] == "enable")

	{

	{

		$plugins->run_hooks("admin_tools_tasks_enable");

		$plugins->run_hooks("admin_tools_tasks_enable");

	}
else
{

	}
else
{

		$plugins->run_hooks("admin_tools_tasks_disable");
}

if($mybb->input['action'] == "enable")
{
if($task['file'] == "backupdb" || $task['file'] == "checktables")

		$plugins->run_hooks("admin_tools_tasks_disable");
}

if($mybb->input['action'] == "enable")
{
if($task['file'] == "backupdb" || $task['file'] == "checktables")

		{

		{

			// User clicked no
if($mybb->input['no'])
{

			// User clicked no
if($mybb->input['no'])
{

Zeile 528Zeile 532
			{
$nextrun = fetch_next_run($task);
$db->update_query("tasks", array("nextrun" => $nextrun, "enabled" => 1), "tid='{$task['tid']}'");

			{
$nextrun = fetch_next_run($task);
$db->update_query("tasks", array("nextrun" => $nextrun, "enabled" => 1), "tid='{$task['tid']}'");

				$cache->update_tasks();

$plugins->run_hooks("admin_tools_tasks_enable_commit");



$plugins->run_hooks("admin_tools_tasks_enable_commit");

$cache->update_tasks();


// Log admin action
log_admin_action($task['tid'], $task['title'], $mybb->input['action']);

flash_message($lang->success_task_enabled, 'success');
admin_redirect("index.php?module=tools-tasks");


// Log admin action
log_admin_action($task['tid'], $task['title'], $mybb->input['action']);

flash_message($lang->success_task_enabled, 'success');
admin_redirect("index.php?module=tools-tasks");

			}

			}

			else
{
$page->output_confirm_action("index.php?module=tools-tasks&amp;action=enable&amp;tid={$task['tid']}", $lang->confirm_task_enable);

			else
{
$page->output_confirm_action("index.php?module=tools-tasks&amp;action=enable&amp;tid={$task['tid']}", $lang->confirm_task_enable);

Zeile 547Zeile 552
		{
$nextrun = fetch_next_run($task);
$db->update_query("tasks", array("nextrun" => $nextrun, "enabled" => 1), "tid='{$task['tid']}'");

		{
$nextrun = fetch_next_run($task);
$db->update_query("tasks", array("nextrun" => $nextrun, "enabled" => 1), "tid='{$task['tid']}'");

			$cache->update_tasks();

$plugins->run_hooks("admin_tools_tasks_enable_commit");




$plugins->run_hooks("admin_tools_tasks_enable_commit");

$cache->update_tasks();


			// Log admin action
log_admin_action($task['tid'], $task['title'], $mybb->input['action']);


			// Log admin action
log_admin_action($task['tid'], $task['title'], $mybb->input['action']);


Zeile 561Zeile 567
	else
{
$db->update_query("tasks", array("enabled" => 0), "tid='{$task['tid']}'");

	else
{
$db->update_query("tasks", array("enabled" => 0), "tid='{$task['tid']}'");

		$cache->update_tasks();





		$plugins->run_hooks("admin_tools_tasks_disable_commit");

		$plugins->run_hooks("admin_tools_tasks_disable_commit");

 

$cache->update_tasks();


// Log admin action
log_admin_action($task['tid'], $task['title'], $mybb->input['action']);


// Log admin action
log_admin_action($task['tid'], $task['title'], $mybb->input['action']);