Changeset View
Changeset View
Standalone View
Standalone View
core/kernel/managers/scheduled_task_manager.php
Show First 20 Lines • Show All 110 Lines • ▼ Show 20 Line(s) | |||||
return ; | return ; | ||||
} | } | ||||
ignore_user_abort(true); | ignore_user_abort(true); | ||||
set_time_limit(0); | set_time_limit(0); | ||||
$events_source = $this->getAll(); | $events_source = $this->getAll(); | ||||
if ( $this->Application->isWebRequest() ) { | |||||
$user_id = $this->Application->RecallVar('user_id'); | $user_id = $this->Application->RecallVar('user_id'); | ||||
$this->Application->StoreVar('user_id', USER_ROOT, true); // to prevent permission checking inside events, true for optional storage | |||||
// To prevent permission checking inside events, true for optional storage. | |||||
$this->Application->StoreVar('user_id', USER_ROOT, true); | |||||
} | |||||
$site_helper = $this->Application->recallObject('SiteHelper'); | $site_helper = $this->Application->recallObject('SiteHelper'); | ||||
/* @var $site_helper SiteHelper */ | /* @var $site_helper SiteHelper */ | ||||
$site_domain_id = $site_helper->getDomainByName('DomainName', DOMAIN); | $site_domain_id = $site_helper->getDomainByName('DomainName', DOMAIN); | ||||
foreach ($events_source as $short_name => $event_data) { | foreach ($events_source as $short_name => $event_data) { | ||||
if ( $site_domain_id && $event_data['SiteDomainLimitation'] != '' ) { | if ( $site_domain_id && $event_data['SiteDomainLimitation'] != '' ) { | ||||
Show All 14 Lines | |||||
if ($next_run && ($next_run > time())) { | if ($next_run && ($next_run > time())) { | ||||
continue; | continue; | ||||
} | } | ||||
$this->run($event_data); | $this->run($event_data); | ||||
} | } | ||||
if ( $this->Application->isWebRequest() ) { | |||||
$this->Application->StoreVar('user_id', $user_id, $user_id == USER_GUEST); | $this->Application->StoreVar('user_id', $user_id, $user_id == USER_GUEST); | ||||
} | } | ||||
} | |||||
/** | /** | ||||
* Runs scheduled task based on given data | * Runs scheduled task based on given data | ||||
* | * | ||||
* @param Array $scheduled_task_data | * @param Array $scheduled_task_data | ||||
* @return bool | * @return bool | ||||
* @access public | * @access public | ||||
*/ | */ | ||||
▲ Show 20 Lines • Show All 73 Lines • Show Last 20 Lines |