Ejemplo n.º 1
0
 /**
  * 
  * @cmdForm /centreon-administration/aclresource/update optional
  * @cmdObject string aclresource the acl resource
  * @cmdParam boolean|true all-hosts optional all host 
  * @cmdParam boolean|true all-bas optional all bas 
  * @cmdParam boolean|false no-hosts optional no host 
  * @cmdParam boolean|false no-bas optional no bas 
  */
 public function updateAction($object, $params)
 {
     $events = Di::getDefault()->get('events');
     $aclTagsEvent = new aclTagsEvent($params);
     $events->emit('centreon-administration.acl.tag', array($aclTagsEvent));
     $params = $aclTagsEvent->getParams();
     parent::updateAction($object, $params);
 }
Ejemplo n.º 2
0
 public static function execute(aclTagsEvent $event)
 {
     $params = $event->getParams();
     if (!empty($params["business-activity-tags"])) {
         $tagId = array();
         $tags = explode(",", $params["business-activity-tags"]);
         foreach ($tags as $tag) {
             $tagId = array_merge($tagId, TagsRepository::getTagsIdByResource('bas', $tag));
         }
         $params["business-activity-tags"] = implode(',', $tagId);
     }
     $event->setParams($params);
 }