예제 #1
0
 public function validateParentNotEmpty(ResourceEvent $event)
 {
     $group = $event->getSubject();
     if ($group->getParent() == null && !$this->context->isGranted(User::ROLE_SUPER_ADMIN)) {
         $event->stop('dedipanel.group.need_parent');
     }
 }
예제 #2
0
 public function deleteKeyPair(ResourceEvent $event)
 {
     try {
         $this->helper->deleteKeyPair($event->getSubject());
     } catch (ConnectionErrorException $e) {
         $event->stop('cant_delete_public_key', ResourceEvent::TYPE_WARNING);
     }
 }
예제 #3
0
 public function preUpdateTeamspeakInstance(ResourceEvent $event)
 {
     $entity = $event->getSubject();
     try {
         $entity->getQuery()->updateInstanceConfig($entity);
     } catch (MaxSlotsLimitReachedException $e) {
         $event->stop('dedipanel.voip.max_slots');
     }
 }