You are here

function hosting_task_cancel in Hosting 7.3

Same name and namespace in other branches
  1. 6.2 task/hosting_task.module \hosting_task_cancel()
  2. 7.4 task/hosting_task.module \hosting_task_cancel()

Cancel a task before it's started.

1 string reference to 'hosting_task_cancel'
hosting_task_menu in task/hosting_task.module
Implements hook_menu().

File

task/hosting_task.module, line 219
Web server node type is defined here.

Code

function hosting_task_cancel($node) {
  if ($node->type == 'task' && $node->task_status == HOSTING_TASK_QUEUED) {
    $node->task_status = HOSTING_TASK_WARNING;
    node_save($node);

    // Log the cancellation.
    hosting_task_log($node->vid, 'warning', t("Task was cancelled."));
    drupal_goto('node/' . $node->rid);
  }
  drupal_access_denied();
}