private function lock($lock = 1) { $update = array('locked' => $lock); if (!$lock) { // If we're unlocking the task, we need the next run time $update['next_run'] = $this->get_next_run($this->task['minute'], $this->task['hour'], $this->task['day'], $this->task['month'], $this->task['week_day']); } $data = array(':id' => $this->task['id']); $this->db->update('tasks', $update, 'id=:id', $data); if (!defined('FORUM_CACHE_FUNCTIONS_LOADED')) { require PANTHER_ROOT . 'include/cache.php'; } generate_task_cache(); }
exec('crontab -l', $cron_jobs); $cron = array_search($delete, $cron_jobs); if ($cron !== false) { exec('crontab -r'); unset($cron_jobs[$cron]); } else { message($lang_admin_tasks['Unable to remove']); } foreach ($cron_jobs as $cur_job) { exec('echo -e "`crontab -l`\\n' . $cur_job . '" | crontab -'); } } if (!defined('FORUM_CACHE_FUNCTIONS_LOADED')) { require PANTHER_ROOT . 'include/cache.php'; } generate_task_cache(); redirect(panther_link($panther_url['admin_tasks']), $lang_admin_tasks['Task removed redirect']); } else { if (isset($_POST['upload_task'])) { confirm_referrer(PANTHER_ADMIN_DIR . '/tasks.php'); if (!isset($_FILES['req_file'])) { message($lang_admin_tasks['No file']); } $uploaded_file = $_FILES['req_file']; // Make sure the upload went smooth if (isset($uploaded_file['error'])) { switch ($uploaded_file['error']) { case 1: // UPLOAD_ERR_INI_SIZE // UPLOAD_ERR_INI_SIZE case 2: