Exemplo n.º 1
0
	function Run()
	{
		require_once(LOGIC_PATH.'task.logic.php');
		$TaskLogic=new TaskLogic();
		$TaskLogic->run();
		echo 'ok';
		exit;
	}
Exemplo n.º 2
0
 function Notice_email($touid = 0)
 {
     $touid = max(0, (int) $touid);
     $timestamp = time();
     $sql = "select `uid`,`email`,`notice_at`,`notice_pm`,`notice_reply`,`user_notice_time`,`last_notice_time` from `" . TABLE_PREFIX . "members` where `uid` = '{$touid}'";
     $query = $this->DatabaseHandler->Query($sql);
     $members = $query->GetRow();
     $sql = "select * from `" . TABLE_PREFIX . "cron` where `touid` = '{$touid}'";
     $query = $this->DatabaseHandler->Query($sql);
     $crons = $query->GetRow();
     if ($members['user_notice_time'] == 0) {
         Load::logic('task');
         $TaskLogic = new TaskLogic();
         $TaskLogic->run($id = 1);
     }
     if ($send_return) {
         jtable('members')->update_count($touid, 'last_notice_time', $timestamp);
         $sql = "delete from `" . TABLE_PREFIX . "cron` where `id`= '{$crons['id']}' ";
         $this->DatabaseHandler->Query($sql);
     }
 }
Exemplo n.º 3
0
 function DoModify()
 {
     $sql = "SELECT * FROM " . TABLE_PREFIX . 'task' . " where id='{$this->ID}'";
     $query = $this->DatabaseHandler->Query($sql);
     $task = $query->getRow();
     if ($task == false) {
         $this->Messager("任务已经不存在");
     }
     $task['filename'] = str_replace(array('..', '/', '\\'), array('', '', ''), $task['filename']);
     $task['minute'] = explode("\t", $task['minute']);
     $daynew = get_param('daynew');
     $weekdaynew = get_param('weekdaynew');
     $daynew = $weekdaynew != -1 ? -1 : $daynew;
     $minutenew = get_param('minutenew');
     if (is_array($minutenew)) {
         sort($minutenew = array_unique($minutenew));
         foreach ($minutenew as $key => $val) {
             if ($val < 0 || $val > 59) {
                 unset($minutenew[$key]);
             }
         }
         $minutenew = implode("\t", $minutenew);
     } else {
         $minutenew = '';
     }
     $filenamenew = get_param('filenamenew');
     $hournew = get_param('hournew');
     if (preg_match("/[\\\\\\/\\:\\*\\?\"\\<\\>\\|]+/", $filenamenew)) {
         $this->Messager("计划任务文件名不正确", -1);
     } elseif ($weekdaynew == -1 && $daynew == -1 && $hournew == -1 && $minutenew == '') {
         $this->Messager("时间设置不正确", -1);
     }
     $sql = "UPDATE " . TABLE_PREFIX . 'task' . " SET weekday='{$weekdaynew}', day='{$daynew}', hour='{$hournew}', minute='{$minutenew}', filename='" . trim($filenamenew) . "' WHERE id='{$this->ID}'";
     $this->DatabaseHandler->Query($sql);
     Load::logic('task');
     $TaskLogic = new TaskLogic();
     $TaskLogic->nextRun($task);
     $this->Messager("编辑成功", "admin.php?mod=task&code=list");
 }