Vergleich admin/modules/tools/tasks.php - 1.8.2 - 1.8.19

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 23Zeile 23
/**
* Validates a string or array of values
*

/**
* Validates a string or array of values
*

 * @param mixed Comma-separated list or array of values
* @param int Minimum value
* @param int Maximum value
* @param string Set "string" to return in a comma-separated list, or "array" to return in an array
* @return mixed String or array of valid values OR false if string/array is invalid

 * @param string|array $value Comma-separated list or array of values
* @param int $min Minimum value
* @param int $max Maximum value
* @param string $return_type Set "string" to return in a comma-separated list, or "array" to return in an array
* @return string|array String or array of valid values OR false if string/array is invalid

 */
function check_time_values($value, $min, $max, $return_type)
{

 */
function check_time_values($value, $min, $max, $return_type)
{

Zeile 79Zeile 79
			$errors[] = $lang->error_missing_description;
}


			$errors[] = $lang->error_missing_description;
}


		if(!file_exists(MYBB_ROOT."inc/tasks/".$mybb->input['file'].".php"))




		$file = $mybb->get_input('file');
$file = basename($file, '.php');

if(!file_exists(MYBB_ROOT."inc/tasks/".$file.".php"))

		{
$errors[] = $lang->error_invalid_task_file;
}

		{
$errors[] = $lang->error_invalid_task_file;
}

Zeile 126Zeile 129
			$new_task = array(
"title" => $db->escape_string($mybb->input['title']),
"description" => $db->escape_string($mybb->input['description']),

			$new_task = array(
"title" => $db->escape_string($mybb->input['title']),
"description" => $db->escape_string($mybb->input['description']),

				"file" => $db->escape_string($mybb->input['file']),

				"file" => $db->escape_string($file),

				"minute" => $db->escape_string($mybb->input['minute']),
"hour" => $db->escape_string($mybb->input['hour']),
"day" => $db->escape_string($mybb->input['day']),
"month" => $db->escape_string(implode(',', $mybb->input['month'])),
"weekday" => $db->escape_string(implode(',', $mybb->input['weekday'])),

				"minute" => $db->escape_string($mybb->input['minute']),
"hour" => $db->escape_string($mybb->input['hour']),
"day" => $db->escape_string($mybb->input['day']),
"month" => $db->escape_string(implode(',', $mybb->input['month'])),
"weekday" => $db->escape_string(implode(',', $mybb->input['weekday'])),

				"enabled" => (int)$mybb->input['enabled'],
"logging" => (int)$mybb->input['logging']

				"enabled" => $mybb->get_input('enabled', MyBB::INPUT_INT),
"logging" => $mybb->get_input('logging', MyBB::INPUT_INT)

			);

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

			);

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

Zeile 153Zeile 156
	$page->add_breadcrumb_item($lang->add_new_task);
$page->output_header($lang->scheduled_tasks." - ".$lang->add_new_task);


	$page->add_breadcrumb_item($lang->add_new_task);
$page->output_header($lang->scheduled_tasks." - ".$lang->add_new_task);






	$sub_tabs['scheduled_tasks'] = array(
'title' => $lang->scheduled_tasks,
'link' => "index.php?module=tools-tasks"

	$sub_tabs['scheduled_tasks'] = array(
'title' => $lang->scheduled_tasks,
'link' => "index.php?module=tools-tasks"

Zeile 163Zeile 166
		'title' => $lang->add_new_task,
'link' => "index.php?module=tools-tasks&action=add",
'description' => $lang->add_new_task_desc

		'title' => $lang->add_new_task,
'link' => "index.php?module=tools-tasks&action=add",
'description' => $lang->add_new_task_desc

	);


	);


	$sub_tabs['task_logs'] = array(
'title' => $lang->view_task_logs,
'link' => "index.php?module=tools-tasks&action=logs"

	$sub_tabs['task_logs'] = array(
'title' => $lang->view_task_logs,
'link' => "index.php?module=tools-tasks&action=logs"

Zeile 175Zeile 178
	if($errors)
{
$page->output_inline_error($errors);

	if($errors)
{
$page->output_inline_error($errors);

	}

	}

	else
{
$mybb->input['minute'] = '*';

	else
{
$mybb->input['minute'] = '*';

Zeile 247Zeile 250

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


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

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

	$query = $db->simple_select("tasks", "*", "tid='".$mybb->get_input('tid', MyBB::INPUT_INT)."'");

	$task = $db->fetch_array($query);

// Does the task not exist?

	$task = $db->fetch_array($query);

// Does the task not exist?

Zeile 271Zeile 274
			$errors[] = $lang->error_missing_description;
}


			$errors[] = $lang->error_missing_description;
}


		if(!file_exists(MYBB_ROOT."inc/tasks/".$mybb->input['file'].".php"))




        $file = $mybb->get_input('file');
$file = basename($file, '.php');

if(!file_exists(MYBB_ROOT."inc/tasks/".$file.".php"))

		{
$errors[] = $lang->error_invalid_task_file;
}

		{
$errors[] = $lang->error_invalid_task_file;
}

Zeile 326Zeile 332
			$updated_task = array(
"title" => $db->escape_string($mybb->input['title']),
"description" => $db->escape_string($mybb->input['description']),

			$updated_task = array(
"title" => $db->escape_string($mybb->input['title']),
"description" => $db->escape_string($mybb->input['description']),

				"file" => $db->escape_string($mybb->input['file']),

				"file" => $db->escape_string($file),

				"minute" => $db->escape_string($mybb->input['minute']),
"hour" => $db->escape_string($mybb->input['hour']),
"day" => $db->escape_string($mybb->input['day']),
"month" => $db->escape_string(implode(',', $mybb->input['month'])),
"weekday" => $db->escape_string(implode(',', $mybb->input['weekday'])),

				"minute" => $db->escape_string($mybb->input['minute']),
"hour" => $db->escape_string($mybb->input['hour']),
"day" => $db->escape_string($mybb->input['day']),
"month" => $db->escape_string(implode(',', $mybb->input['month'])),
"weekday" => $db->escape_string(implode(',', $mybb->input['weekday'])),

				"enabled" => (int)$mybb->input['enabled'],
"logging" => (int)$mybb->input['logging']

				"enabled" => $mybb->get_input('enabled', MyBB::INPUT_INT),
"logging" => $mybb->get_input('logging', MyBB::INPUT_INT)

			);

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

			);

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

Zeile 449Zeile 455

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


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

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

	$query = $db->simple_select("tasks", "*", "tid='".$mybb->get_input('tid', MyBB::INPUT_INT)."'");

	$task = $db->fetch_array($query);

// Does the task not exist?

	$task = $db->fetch_array($query);

// Does the task not exist?

Zeile 499Zeile 505
		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)."'");

	$query = $db->simple_select("tasks", "*", "tid='".$mybb->get_input('tid', MyBB::INPUT_INT)."'");

	$task = $db->fetch_array($query);

// Does the task not exist?

	$task = $db->fetch_array($query);

// Does the task not exist?

Zeile 593Zeile 599

$plugins->run_hooks("admin_tools_tasks_run");



$plugins->run_hooks("admin_tools_tasks_run");


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

	$query = $db->simple_select("tasks", "*", "tid='".$mybb->get_input('tid', MyBB::INPUT_INT)."'");

	$task = $db->fetch_array($query);

// Does the task not exist?

	$task = $db->fetch_array($query);

// Does the task not exist?

Zeile 652Zeile 658

if($mybb->input['page'] > 0)
{


if($mybb->input['page'] > 0)
{

		$current_page = $mybb->get_input('page', 1);

		$current_page = $mybb->get_input('page', MyBB::INPUT_INT);

		$start = ($current_page-1)*$per_page;
$pages = $log_count / $per_page;
$pages = ceil($pages);

		$start = ($current_page-1)*$per_page;
$pages = $log_count / $per_page;
$pages = ceil($pages);

Zeile 730Zeile 736
	{
$task['title'] = htmlspecialchars_uni($task['title']);
$task['description'] = htmlspecialchars_uni($task['description']);

	{
$task['title'] = htmlspecialchars_uni($task['title']);
$task['description'] = htmlspecialchars_uni($task['description']);

		$next_run = date($mybb->settings['dateformat'], $task['nextrun']).", ".date($mybb->settings['timeformat'], $task['nextrun']);

		$next_run = my_date('normal', $task['nextrun'], "", 2);

		if($task['enabled'] == 1)
{
$icon = "<img src=\"styles/{$page->style}/images/icons/bullet_on.png\" alt=\"({$lang->alt_enabled})\" title=\"{$lang->alt_enabled}\" style=\"vertical-align: middle;\" /> ";

		if($task['enabled'] == 1)
{
$icon = "<img src=\"styles/{$page->style}/images/icons/bullet_on.png\" alt=\"({$lang->alt_enabled})\" title=\"{$lang->alt_enabled}\" style=\"vertical-align: middle;\" /> ";