Zeile 6 | Zeile 6 |
---|
* Website: http://www.mybboard.net * License: http://www.mybboard.net/about/license *
|
* Website: http://www.mybboard.net * License: http://www.mybboard.net/about/license *
|
* $Id: tasks.php 4042 2008-07-25 23:46:54Z Tikitiki $
| * $Id: tasks.php 4427 2009-08-13 21:22:07Z RyanGordon $
|
*/
// Disallow direct access to this file for security reasons
| */
// Disallow direct access to this file for security reasons
|
Zeile 315 | Zeile 315 |
---|
if(!$errors) {
|
if(!$errors) {
|
| $enable_confirmation = false; // Check if we need to ask the user to confirm turning on the task if(($task['file'] == "backupdb" || $task['file'] == "checktables") && $task['enabled'] == 0 && $mybb->input['enabled'] == 1) { $mybb->input['enabled'] = 0; $enable_confirmation = true; }
|
$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']),
|
Zeile 333 | Zeile 341 |
---|
$cache->update_tasks(); $plugins->run_hooks("admin_tools_tasks_edit_commit");
|
$cache->update_tasks(); $plugins->run_hooks("admin_tools_tasks_edit_commit");
|
|
|
// Log admin action log_admin_action($task['tid'], $mybb->input['title']);
flash_message($lang->success_task_updated, 'success');
|
// Log admin action log_admin_action($task['tid'], $mybb->input['title']);
flash_message($lang->success_task_updated, 'success');
|
admin_redirect("index.php?module=tools/tasks");
| if($enable_confirmation == true) { admin_redirect("index.php?module=tools/tasks&action=enable&tid={$task['tid']}&my_post_key={$mybb->post_code}"); } else { admin_redirect("index.php?module=tools/tasks"); }
|
} }
$page->add_breadcrumb_item($lang->edit_task); $page->output_header($lang->scheduled_tasks." - ".$lang->edit_task);
|
} }
$page->add_breadcrumb_item($lang->edit_task); $page->output_header($lang->scheduled_tasks." - ".$lang->edit_task);
|
|
|
$sub_tabs['edit_task'] = array( 'title' => $lang->edit_task, 'description' => $lang->edit_task_desc,
| $sub_tabs['edit_task'] = array( 'title' => $lang->edit_task, 'description' => $lang->edit_task_desc,
|
Zeile 432 | Zeile 448 |
---|
if($mybb->input['action'] == "delete") { $plugins->run_hooks("admin_tools_tasks_delete");
|
if($mybb->input['action'] == "delete") { $plugins->run_hooks("admin_tools_tasks_delete");
|
$query = $db->simple_select("tasks", "*", "tid='".intval($mybb->input['tid'])."'"); $task = $db->fetch_array($query);
| $query = $db->simple_select("tasks", "*", "tid='".intval($mybb->input['tid'])."'"); $task = $db->fetch_array($query);
|
// Does the task not exist? if(!$task['tid'])
|
// Does the task not exist? if(!$task['tid'])
|
{
| {
|
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"); }
|
Zeile 464 | Zeile 480 |
---|
log_admin_action($task['tid'], $task['title']);
flash_message($lang->success_task_deleted, 'success');
|
log_admin_action($task['tid'], $task['title']);
flash_message($lang->success_task_deleted, 'success');
|
admin_redirect("index.php?module=tools/tasks");
| admin_redirect("index.php?module=tools/tasks");
|
} else {
| } else {
|
Zeile 474 | Zeile 490 |
---|
if($mybb->input['action'] == "enable" || $mybb->input['action'] == "disable") {
|
if($mybb->input['action'] == "enable" || $mybb->input['action'] == "disable") {
|
if($mybb->input['action'] == "enable") { $plugins->run_hooks("admin_tools_tasks_enable");
| if($mybb->input['action'] == "enable") { $plugins->run_hooks("admin_tools_tasks_enable");
|
} else
|
} else
|
{
| {
|
$plugins->run_hooks("admin_tools_tasks_enable"); }
| $plugins->run_hooks("admin_tools_tasks_enable"); }
|
Zeile 494 | Zeile 510 |
---|
}
if($mybb->input['action'] == "enable")
|
}
if($mybb->input['action'] == "enable")
|
{
| {
|
if($task['file'] == "backupdb" || $task['file'] == "checktables") {
| if($task['file'] == "backupdb" || $task['file'] == "checktables") {
|
Zeile 555 | Zeile 571 |
---|
if($mybb->input['action'] == "run") {
|
if($mybb->input['action'] == "run") {
|
| if(!verify_post_check($mybb->input['my_post_key'])) { flash_message($lang->invalid_post_verify_key2, 'error'); admin_redirect("index.php?module=tools/tasks"); }
|
ignore_user_abort(true); @set_time_limit(0); $plugins->run_hooks("admin_tools_tasks_run");
| ignore_user_abort(true); @set_time_limit(0); $plugins->run_hooks("admin_tools_tasks_run");
|
Zeile 644 | Zeile 666 |
---|
while($log_entry = $db->fetch_array($query)) { $log_entry['title'] = htmlspecialchars_uni($log_entry['title']);
|
while($log_entry = $db->fetch_array($query)) { $log_entry['title'] = htmlspecialchars_uni($log_entry['title']);
|
$log_entry['data'] = htmlspecialchars_uni($log_entry['data']);
| $log_entry['data'] = nl2br(htmlspecialchars_uni($log_entry['data']));
|
$date = my_date($mybb->settings['dateformat'], $log_entry['dateline']).", ".my_date($mybb->settings['timeformat'], $log_entry['dateline']); $table->construct_cell("<a href=\"index.php?module=tools/tasks&action=edit&tid={$log_entry['tid']}\">{$log_entry['title']}</a>"); $table->construct_cell($date, array("class" => "align_center"));
| $date = my_date($mybb->settings['dateformat'], $log_entry['dateline']).", ".my_date($mybb->settings['timeformat'], $log_entry['dateline']); $table->construct_cell("<a href=\"index.php?module=tools/tasks&action=edit&tid={$log_entry['tid']}\">{$log_entry['title']}</a>"); $table->construct_cell($date, array("class" => "align_center"));
|
Zeile 706 | Zeile 728 |
---|
{ $icon = "<img src=\"styles/{$page->style}/images/icons/bullet_off.gif\" alt=\"({$lang->alt_disabled})\" title=\"{$lang->alt_disabled}\" style=\"vertical-align: middle;\" /> "; }
|
{ $icon = "<img src=\"styles/{$page->style}/images/icons/bullet_off.gif\" alt=\"({$lang->alt_disabled})\" title=\"{$lang->alt_disabled}\" style=\"vertical-align: middle;\" /> "; }
|
$table->construct_cell("<div class=\"float_right\"><a href=\"index.php?module=tools/tasks&action=run&tid={$task['tid']}\"><img src=\"styles/{$page->style}/images/icons/run_task.gif\" title=\"{$lang->run_task_now}\" alt=\"{$lang->run_task}\" /></a></div><div>{$icon}<strong><a href=\"index.php?module=tools/tasks&action=edit&tid={$task['tid']}\">{$task['title']}</a></strong><br /><small>{$task['description']}</small></div>");
| $table->construct_cell("<div class=\"float_right\"><a href=\"index.php?module=tools/tasks&action=run&tid={$task['tid']}&my_post_key={$mybb->post_code}\"><img src=\"styles/{$page->style}/images/icons/run_task.gif\" title=\"{$lang->run_task_now}\" alt=\"{$lang->run_task}\" /></a></div><div>{$icon}<strong><a href=\"index.php?module=tools/tasks&action=edit&tid={$task['tid']}\">{$task['title']}</a></strong><br /><small>{$task['description']}</small></div>");
|
$table->construct_cell($next_run, array("class" => "align_center"));
$popup = new PopupMenu("task_{$task['tid']}", $lang->options); $popup->add_item($lang->edit_task, "index.php?module=tools/tasks&action=edit&tid={$task['tid']}"); if($task['enabled'] == 1) {
|
$table->construct_cell($next_run, array("class" => "align_center"));
$popup = new PopupMenu("task_{$task['tid']}", $lang->options); $popup->add_item($lang->edit_task, "index.php?module=tools/tasks&action=edit&tid={$task['tid']}"); if($task['enabled'] == 1) {
|
$popup->add_item($lang->disable_task, "index.php?module=tools/tasks&action=disable&tid={$task['tid']}");
| $popup->add_item($lang->disable_task, "index.php?module=tools/tasks&action=disable&tid={$task['tid']}&my_post_key={$mybb->post_code}");
|
} else {
|
} else {
|
$popup->add_item($lang->enable_task, "index.php?module=tools/tasks&action=enable&tid={$task['tid']}");
| $popup->add_item($lang->enable_task, "index.php?module=tools/tasks&action=enable&tid={$task['tid']}&my_post_key={$mybb->post_code}");
|
} $popup->add_item($lang->delete_task, "index.php?module=tools/tasks&action=delete&tid={$task['tid']}&my_post_key={$mybb->post_code}", "return AdminCP.deleteConfirmation(this, '{$lang->confirm_task_deletion}')"); $table->construct_cell($popup->fetch(), array("class" => "align_center"));
| } $popup->add_item($lang->delete_task, "index.php?module=tools/tasks&action=delete&tid={$task['tid']}&my_post_key={$mybb->post_code}", "return AdminCP.deleteConfirmation(this, '{$lang->confirm_task_deletion}')"); $table->construct_cell($popup->fetch(), array("class" => "align_center"));
|