Index: branches/5.2.x/core/kernel/managers/agent_manager.php =================================================================== diff -u -N -r14585 -r14605 --- branches/5.2.x/core/kernel/managers/agent_manager.php (.../agent_manager.php) (revision 14585) +++ branches/5.2.x/core/kernel/managers/agent_manager.php (.../agent_manager.php) (revision 14605) @@ -1,6 +1,6 @@ (int)$agent_data['LastRunOn'], 'NextRunOn' => (int)$agent_data['NextRunOn'], 'Status' => $agent_data['Status'], + 'SiteDomainLimitation' => $agent_data['SiteDomainLimitation'], ); } } @@ -159,7 +160,21 @@ $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 + $site_helper =& $this->Application->recallObject('SiteHelper'); + /* @var $site_helper SiteHelper */ + + $site_domain_id = $site_helper->getDomainByName('DomainName', DOMAIN); + foreach ($events_source as $short_name => $event_data) { + if ( $site_domain_id && $event_data['SiteDomainLimitation'] != '' ) { + $site_domains = explode('|', substr($event_data['SiteDomainLimitation'], 1, -1)); + + if ( !in_array($site_domain_id, $site_domains) ) { + // agent isn't allowed on this site domain + continue; + } + } + $next_run = $event_data['NextRunOn']; if ($next_run && ($next_run > adodb_mktime())) {