From cfce20ea3bc312729eeec3e83ebe13ac41d86f8b Mon Sep 17 00:00:00 2001 From: wangyidong Date: Wed, 13 Dec 2017 11:35:20 +0800 Subject: [PATCH] * finish task #3375. --- module/cron/control.php | 6 +++++- module/group/model.php | 1 - 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/module/cron/control.php b/module/cron/control.php index 333c021906..0bd99db7a2 100644 --- a/module/cron/control.php +++ b/module/cron/control.php @@ -159,6 +159,7 @@ class cron extends control while(true) { dao::$cache = array(); + /* When cron is null then die. */ if(empty($crons)) break; if(empty($parsedCrons)) break; @@ -170,10 +171,12 @@ class cron extends control /* Run crons. */ $now = new datetime('now'); + unset($_SESSION['company']); + unset($this->app->company); + $this->common->setCompany(); $this->common->loadConfigFromDB(); foreach($parsedCrons as $id => $cron) { - $cronInfo = $this->cron->getById($id); /* Skip empty and stop cron.*/ if(empty($cronInfo) or $cronInfo->status == 'stop') continue; @@ -211,6 +214,7 @@ class cron extends control $log = ''; $time = $now->format('G:i:s'); $log = "$time task " . $id . " executed,\ncommand: $cron[command].\nreturn : $return.\noutput : $output\n"; + $log .= $this->app->company->name . "\n"; $this->cron->logCron($log); unset($log); } diff --git a/module/group/model.php b/module/group/model.php index 3565b60128..1e28da57ce 100644 --- a/module/group/model.php +++ b/module/group/model.php @@ -422,7 +422,6 @@ class groupModel extends model $action = strtolower($action); if($action == 'manageview' and $group->role == 'limited') return false; - if($action == 'edit' and $group->role == 'limited') return false; if($action == 'copy' and $group->role == 'limited') return false; return true;