示例#1
0
 /**
  * @param Core\Events\LoadFormDatas $event
  */
 public static function execute(LoadFormDatasEvent $event)
 {
     $route = $event->getRoute();
     $objectId = $event->getObjectId();
     $parameters = $event->getParameters();
     if ($route === '/centreon-administration/aclresource/update') {
         try {
             $allHostsParameter = AclresourceHostsParams::getParameters($objectId, 'all_hosts');
             $event->addParameters(array('centreon-configuration__aclresource_all_hosts' => $allHostsParameter['all_hosts']));
         } catch (\Exception $e) {
         }
     }
 }
示例#2
0
 /**
  * get Hosts by acl id
  *
  * @param int $aclId
  */
 public static function updateAllHostsAcl($action, $objectId, $allHosts)
 {
     if ($action === 'create' || $action === 'update') {
         try {
             AclresourceHostsParams::delete($objectId);
         } catch (\Exception $e) {
         }
         AclresourceHostsParams::insert(array("acl_resource_id" => $objectId, "all_hosts" => $allHosts), true);
     }
 }