/** * @DI\Observe("log") * * @param LogGenericEvent $event */ public function onLog(LogGenericEvent $event) { if ($event instanceof NotifiableInterface && $this->ch->getParameter('is_notification_active')) { if ($event->isAllowedToNotify()) { $this->notificationManager->createNotificationAndNotify($event); } } }
/** * @DI\Observe("log") * * @param LogGenericEvent $event */ public function onDeleteUser(LogGenericEvent $event) { if ($event instanceof LogUserDeleteEvent) { $receiver = $event->getReceiver(); if ($receiver !== null) { $this->oauthManager->unlinkAccount($receiver->getId()); } } }
/** * @DI\Observe("log") * * @param LogGenericEvent $event */ public function onLog(LogGenericEvent $event) { if ($event instanceof PotentialEvaluationEndInterface) { $correction = $event->getCorrection(); $this->sendFinishedLog($correction->getDrop()); if ($correction->getDrop()->getUser()->getId() != $correction->getUser()->getId()) { $drop = $this->entityManager->getRepository('InnovaCollecticielBundle:Drop')->findOneBy(array('user' => $correction->getUser())); if ($drop !== null) { $this->sendFinishedLog($drop); } } } }
public function __construct(CourseSessionRegistrationQueue $queue) { $session = $queue->getSession(); $course = $session->getCourse(); $user = $queue->getUser(); $organizationAdmin = $queue->getOrganizationAdmin(); $details = []; $details['userId'] = $user->getId(); $details['username'] = $user->getUsername(); $details['firsName'] = $user->getFirstName(); $details['lastName'] = $user->getLastName(); $details['courseId'] = $course->getId(); $details['courseTitle'] = $course->getTitle(); $details['courseCode'] = $course->getCode(); $details['sessionId'] = $session->getId(); $details['sessionName'] = $session->getName(); $details['sessionStatus'] = $session->getSessionStatus(); $details['sessionType'] = $session->getType(); $details['organizationAdminId'] = $organizationAdmin->getId(); $details['organizationAdminUsername'] = $organizationAdmin->getUsername(); $details['organizationAdminFirsName'] = $organizationAdmin->getFirstName(); $details['organizationAdminLastName'] = $organizationAdmin->getLastName(); $details['organizationValidationDate'] = $queue->getOrganizationValidationDate(); parent::__construct(self::ACTION, $details, $user); }
public function __construct(Course $course) { $details = []; $details['id'] = $course->getId(); $details['title'] = $course->getTitle(); $details['code'] = $course->getCode(); $details['publicRegistration'] = $course->getPublicRegistration(); $details['publicUnregistration'] = $course->getPublicUnregistration(); $details['registrationValidation'] = $course->getRegistrationValidation(); $details['icon'] = $course->getIcon(); $details['tutorRoleName'] = $course->getTutorRoleName(); $details['learnerRoleName'] = $course->getLearnerRoleName(); $details['userValidation'] = $course->getUserValidation(); $details['organizationValidation'] = $course->getOrganizationValidation(); $details['maxUsers'] = $course->getMaxUsers(); $details['defaultSessionDuration'] = $course->getDefaultSessionDuration(); $details['withSessionEvent'] = $course->getWithSessionEvent(); $workspace = $course->getWorkspace(); $workspaceModel = $course->getWorkspaceModel(); if (!is_null($workspace)) { $details['workspaceId'] = $workspace->getId(); $details['workspaceName'] = $workspace->getName(); $details['workspaceCode'] = $workspace->getCode(); $details['workspaceGuid'] = $workspace->getGuid(); } if (!is_null($workspaceModel)) { $details['workspaceModelId'] = $workspaceModel->getId(); $details['workspaceModelName'] = $workspaceModel->getName(); } parent::__construct(self::ACTION, $details); }
/** * Constructor. * ChangeSet expected variable is array which contain all modified properties, in the following form: * ( * 'propertyName1' => ['property old value 1', 'property new value 1'], * 'propertyName2' => ['property old value 2', 'property new value 2'], * etc. * ) * * Please respect lower caml case naming convention for property names */ public function __construct($role, $resource, $changeSet) { $this->role = $role; $this->changeSet = $changeSet; $this->details = array('role' => array('name' => $role->getTranslationKey(), 'changeSet' => $changeSet), 'workspace' => array('name' => $resource->getWorkspace() ? $resource->getWorkspace()->getName() : ' - '), 'resource' => array('name' => $resource->getName(), 'path' => $resource->getPathForDisplay(), 'id' => $resource->getId(), 'resourceType' => $resource->getResourceType()->getName())); parent::__construct(self::ACTION, $this->details, null, null, $resource, $role, $resource->getWorkspace()); }
/** * Constructor. */ public function __construct(HomeTab $homeTab, WidgetHomeTabConfig $whtc, WidgetDisplayConfig $wdc = null) { $widgetInstance = $whtc->getWidgetInstance(); $widget = $widgetInstance->getWidget(); $details = []; $details['tabId'] = $homeTab->getId(); $details['tabName'] = $homeTab->getName(); $details['tabType'] = $homeTab->getType(); $details['tabIcon'] = $homeTab->getIcon(); $details['widgetId'] = $widget->getId(); $details['widgetName'] = $widget->getName(); $details['widgetIsConfigurable'] = $widget->isConfigurable(); $details['widgetIsExportable'] = $widget->isExportable(); $details['widgetIsDisplayableInWorkspace'] = $widget->isDisplayableInWorkspace(); $details['widgetIsDisplayableInDesktop'] = $widget->isDisplayableInDesktop(); $details['id'] = $widgetInstance->getId(); $details['name'] = $widgetInstance->getName(); $details['icon'] = $widgetInstance->getIcon(); $details['isAdmin'] = $widgetInstance->isAdmin(); $details['isDesktop'] = $widgetInstance->isDesktop(); $details['widgetHomeTabConfigId'] = $whtc->getId(); $details['order'] = $whtc->getWidgetOrder(); $details['type'] = $whtc->getType(); $details['visible'] = $whtc->isVisible(); $details['locked'] = $whtc->isLocked(); if (!is_null($wdc)) { $details['widgetDisplayConfigId'] = $wdc->getId(); $details['row'] = $wdc->getRow(); $details['column'] = $wdc->getColumn(); $details['width'] = $wdc->getWidth(); $details['height'] = $wdc->getHeight(); $details['color'] = $wdc->getColor(); } parent::__construct(self::ACTION, $details); }
/** * @DI\Observe("log") * * @param LogGenericEvent $event */ public function onLog(LogGenericEvent $event) { if ($event instanceof PotentialEvaluationEndInterface) { // var_dump('on log !! : '.$event->getAction()); // var_dump('instance of potential evaluation end interface'); $correction = $event->getCorrection(); $this->sendFinishedLog($correction->getDrop()); if ($correction->getDrop()->getUser()->getId() != $correction->getUser()->getId()) { $drop = $this->entityManager->getRepository('IcapDropzoneBundle:Drop')->findOneBy(array('user' => $correction->getUser())); if ($drop !== null) { $this->sendFinishedLog($drop); } } // die(); } }
public function __construct(Cursus $cursus) { $details = []; $details['id'] = $cursus->getId(); $details['title'] = $cursus->getTitle(); $details['code'] = $cursus->getCode(); $details['blocking'] = $cursus->isBlocking(); $details['details'] = $cursus->getDetails(); $details['root'] = $cursus->getRoot(); $details['lvl'] = $cursus->getLvl(); $details['lft'] = $cursus->getLft(); $details['rgt'] = $cursus->getRgt(); $parent = $cursus->getParent(); $course = $cursus->getCourse(); $workspace = $cursus->getWorkspace(); if (!is_null($parent)) { $details['parentId'] = $parent->getId(); $details['parentTitle'] = $parent->getTitle(); $details['parentCode'] = $parent->getCode(); } if (!is_null($course)) { $details['courseId'] = $course->getId(); $details['courseTitle'] = $course->getTitle(); $details['courseCode'] = $course->getCode(); } if (!is_null($workspace)) { $details['workspaceId'] = $workspace->getId(); $details['workspaceName'] = $workspace->getName(); $details['workspaceCode'] = $workspace->getCode(); $details['workspaceGuid'] = $workspace->getGuid(); } parent::__construct(self::ACTION, $details); }
/** * Constructor. * ChangeSet expected variable is array which contain all modified properties, in the following form: * ( * 'propertyName1' => ['property old value 1', 'property new value 1'], * 'propertyName2' => ['property old value 2', 'property new value 2'], * etc. * ) * * Please respect lower caml case naming convention for property names */ public function __construct(ResourceNode $node, $changeSet) { $action = self::ACTION; if ($changeSet != null and count($changeSet) == 1 and array_key_exists('name', $changeSet)) { $action = self::ACTION_RENAME; } parent::__construct($action, array('resource' => array('name' => $node->getName(), 'path' => $node->getPathForDisplay(), 'changeSet' => $changeSet), 'workspace' => array('name' => $node->getWorkspace()->getName()), 'owner' => array('lastName' => $node->getCreator()->getLastName(), 'firstName' => $node->getCreator()->getFirstName())), null, null, $node, null, $node->getWorkspace(), $node->getCreator()); }
public function __construct(SurveyAnswer $surveyAnswer) { $survey = $surveyAnswer->getSurvey(); $resourceNode = $survey->getResourceNode(); $user = $surveyAnswer->getUser(); $details = ['answer_date' => $surveyAnswer->getAnswerDate(), 'nb_answers' => $surveyAnswer->getNbAnswers()]; parent::__construct(self::ACTION, $details, $user, null, $resourceNode, null, $resourceNode->getWorkspace()); }
/** * @param Badge $badge * @param User $receiver */ public function __construct(Badge $badge, User $receiver, $doer) { if (null === $doer) { $this->doer = LogGenericEvent::PLATFORM_EVENT_TYPE; } $this->badge = $badge; parent::__construct(self::ACTION, array('badge' => array('id' => $badge->getId()), 'receiverUser' => array('lastName' => $receiver->getLastName(), 'firstName' => $receiver->getFirstName())), $receiver, null, null, null, $badge->getWorkspace()); }
public function __construct(Cursus $cursus, User $user) { $details = []; $details['username'] = $user->getUsername(); $details['firsName'] = $user->getFirstName(); $details['lastName'] = $user->getLastName(); $details['cursusId'] = $cursus->getId(); $details['cursusTitle'] = $cursus->getTitle(); $details['cursusCode'] = $cursus->getCode(); parent::__construct(self::ACTION, $details, $user); }
/** * Constructor. */ public function __construct(WorkspaceRegistrationQueue $queue) { $this->user = $queue->getUser(); $this->workspace = $queue->getWorkspace(); $this->role = $queue->getRole(); $details = array('role' => array('name' => $this->role->getTranslationKey())); $details['workspace'] = array('name' => $this->workspace->getName(), 'id' => $this->workspace->getId()); $details['receiverUser'] = array('firstName' => $this->user->getFirstName(), 'lastName' => $this->user->getLastName()); $this->details = $details; parent::__construct(self::ACTION, $this->details, $this->user, null, null, $this->role, $this->workspace); }
public function __construct(CursusUser $cursusUser) { $cursus = $cursusUser->getCursus(); $user = $cursusUser->getUser(); $details = []; $details['username'] = $user->getUsername(); $details['firsName'] = $user->getFirstName(); $details['lastName'] = $user->getLastName(); $details['cursusId'] = $cursus->getId(); $details['cursusTitle'] = $cursus->getTitle(); $details['cursusCode'] = $cursus->getCode(); $details['registrationDate'] = $cursusUser->getRegistrationDate()->format('d/m/Y H:i:s'); parent::__construct(self::ACTION, $details, $user); }
public function __construct(CourseRegistrationQueue $queue) { $course = $queue->getCourse(); $user = $queue->getUser(); $details = []; $details['userId'] = $user->getId(); $details['username'] = $user->getUsername(); $details['firsName'] = $user->getFirstName(); $details['lastName'] = $user->getLastName(); $details['courseId'] = $course->getId(); $details['courseTitle'] = $course->getTitle(); $details['courseCode'] = $course->getCode(); parent::__construct(self::ACTION, $details, $user); }
public function __construct(CourseSession $session, User $user) { $course = $session->getCourse(); $details = array(); $details['username'] = $user->getUsername(); $details['firsName'] = $user->getFirstName(); $details['lastName'] = $user->getLastName(); $details['sessionId'] = $session->getId(); $details['sessionName'] = $session->getName(); $details['sessionCreationDate'] = $session->getCreationDate()->format('d/m/Y H:i:s'); $details['courseId'] = $course->getId(); $details['courseTitle'] = $course->getTitle(); $details['courseCode'] = $course->getCode(); parent::__construct(self::ACTION, $details, $user); }
/** * Constructor. */ public function __construct(HomeTabConfig $htc) { $homeTab = $htc->getHomeTab(); $details = []; $details['tabId'] = $homeTab->getId(); $details['tabName'] = $homeTab->getName(); $details['tabType'] = $homeTab->getType(); $details['tabIcon'] = $homeTab->getIcon(); $details['configId'] = $htc->getId(); $details['type'] = $htc->getType(); $details['locked'] = $htc->isLocked(); $details['visible'] = $htc->isVisible(); $details['tabOrder'] = $htc->getTabOrder(); $details['details'] = $htc->getDetails(); parent::__construct(self::ACTION, $details); }
public function __construct(SessionEvent $sessionEvent, User $user) { $session = $sessionEvent->getSession(); $course = $session->getCourse(); $details = []; $details['username'] = $user->getUsername(); $details['firsName'] = $user->getFirstName(); $details['lastName'] = $user->getLastName(); $details['sessionEventId'] = $sessionEvent->getId(); $details['sessionEventName'] = $sessionEvent->getName(); $details['sessionId'] = $session->getId(); $details['sessionName'] = $session->getName(); $details['courseId'] = $course->getId(); $details['courseTitle'] = $course->getTitle(); $details['courseCode'] = $course->getCode(); parent::__construct(self::ACTION, $details, $user); }
/** * Constructor. */ public function __construct(Role $role, AbstractRoleSubject $subject) { $this->role = $role; $details = array('role' => array('name' => $role->getTranslationKey())); if ($role->getWorkspace()) { $details['workspace'] = array('name' => $role->getWorkspace()->getName(), 'id' => $role->getWorkspace()->getId()); } if ($subject instanceof User) { $details['receiverUser'] = array('firstName' => $subject->getFirstName(), 'lastName' => $subject->getLastName()); $this->receiver = $subject; } else { $details['receiverGroup'] = array('name' => $subject->getName()); $this->receiverGroup = $subject; } $this->details = $details; parent::__construct($this->getActionKey(), $details, $this->receiver, $this->receiverGroup, null, $role, $role->getWorkspace()); }
public function __construct(SessionEvent $sessionEvent) { $session = $sessionEvent->getSession(); $course = $session->getCourse(); $details = []; $details['id'] = $sessionEvent->getId(); $details['name'] = $sessionEvent->getName(); $details['startDate'] = $sessionEvent->getStartDate(); $details['endDate'] = $sessionEvent->getEndDate(); $details['sessionId'] = $session->getId(); $details['sessionName'] = $session->getName(); $details['courseId'] = $course->getId(); $details['courseTitle'] = $course->getTitle(); $details['courseCode'] = $course->getCode(); foreach ($sessionEvent->getTutors() as $tutor) { $details['tutors'][] = ['id' => $tutor->getId(), 'username' => $tutor->getUsername(), 'firstName' => $tutor->getFirstName(), 'lastName' => $tutor->getLastName(), 'guid' => $tutor->getGuid()]; } parent::__construct(self::ACTION, $details); }
/** * Constructor. */ public function __construct(Role $role, AbstractRoleSubject $subject) { $receiver = null; $receiverGroup = null; $details = array('role' => array('name' => $role->getTranslationKey())); if ($role->getWorkspace()) { $details['workspace'] = array('name' => $role->getWorkspace()->getName()); } if ($subject instanceof User) { $details['receiverUser'] = array('firstName' => $subject->getFirstName(), 'lastName' => $subject->getLastName()); $action = self::ACTION_USER; $receiver = $subject; } else { $details['receiverGroup'] = array('name' => $subject->getName()); $action = self::ACTION_GROUP; $receiverGroup = $subject; } parent::__construct($action, $details, $receiver, $receiverGroup, null, $role, $role->getWorkspace()); }
public function __construct(CourseSession $session) { $course = $session->getCourse(); $workspace = $session->getWorkspace(); $learnerRole = $session->getLearnerRole(); $tutorRole = $session->getTutorRole(); $details = []; $details['id'] = $session->getId(); $details['name'] = $session->getName(); $details['defaultSession'] = $session->isDefaultSession(); $details['creationDate'] = $session->getCreationDate(); $details['publicRegistration'] = $session->getPublicRegistration(); $details['publicUnregistration'] = $session->getPublicUnregistration(); $details['registrationValidation'] = $session->getRegistrationValidation(); $details['startDate'] = $session->getStartDate(); $details['endDate'] = $session->getEndDate(); $details['extra'] = $session->getExtra(); $details['userValidation'] = $session->getUserValidation(); $details['organizationValidation'] = $session->getOrganizationValidation(); $details['maxUsers'] = $session->getMaxUsers(); $details['type'] = $session->getType(); $details['courseId'] = $course->getId(); $details['courseTitle'] = $course->getTitle(); $details['courseCode'] = $course->getCode(); if (!is_null($workspace)) { $details['workspaceId'] = $workspace->getId(); $details['workspaceName'] = $workspace->getName(); $details['workspaceCode'] = $workspace->getCode(); $details['workspaceGuid'] = $workspace->getGuid(); } if (!is_null($learnerRole)) { $details['learnerRoleId'] = $learnerRole->getId(); $details['learnerRoleName'] = $learnerRole->getName(); $details['learnerRoleKey'] = $learnerRole->getTranslationKey(); } if (!is_null($tutorRole)) { $details['tutorRoleId'] = $tutorRole->getId(); $details['tutorRoleName'] = $tutorRole->getName(); $details['tutorRoleKey'] = $tutorRole->getTranslationKey(); } parent::__construct(self::ACTION, $details); }
/** * Constructor. */ public function __construct(HomeTabConfig $htc) { $workspace = $htc->getWorkspace(); $homeTab = $htc->getHomeTab(); $details = []; $details['tabId'] = $homeTab->getId(); $details['tabName'] = $homeTab->getName(); $details['tabType'] = $homeTab->getType(); $details['tabIcon'] = $homeTab->getIcon(); $details['configId'] = $htc->getId(); $details['type'] = $htc->getType(); $details['locked'] = $htc->isLocked(); $details['visible'] = $htc->isVisible(); $details['tabOrder'] = $htc->getTabOrder(); $details['details'] = $htc->getDetails(); $details['workspaceId'] = $workspace->getId(); $details['workspaceCode'] = $workspace->getCode(); $details['workspaceName'] = $workspace->getName(); $details['workspaceGuid'] = $workspace->getGuid(); parent::__construct(self::ACTION, $details, null, null, null, null, $workspace); }
public function __construct(SessionEventUser $sessionEventUser) { $sessionEvent = $sessionEventUser->getSessionEvent(); $session = $sessionEvent->getSession(); $course = $session->getCourse(); $user = $sessionEventUser->getUser(); $details = []; $details['username'] = $user->getUsername(); $details['firsName'] = $user->getFirstName(); $details['lastName'] = $user->getLastName(); $details['sessionEventId'] = $sessionEvent->getId(); $details['sessionEventName'] = $sessionEvent->getName(); $details['sessionId'] = $session->getId(); $details['sessionName'] = $session->getName(); $details['sessionCreationDate'] = $session->getCreationDate()->format('d/m/Y H:i:s'); $details['courseId'] = $course->getId(); $details['courseTitle'] = $course->getTitle(); $details['courseCode'] = $course->getCode(); $registrationDate = $sessionEventUser->getRegistrationDate(); if (!is_null($registrationDate)) { $details['registrationDate'] = $registrationDate->format('d/m/Y H:i:s'); } parent::__construct(self::ACTION, $details, $user); }
public function __construct(array $details) { parent::__construct(self::ACTION, $details); }
/** * Constructor. * ChangeSet expected variable is array which contain all modified properties, in the following form: * ( * 'propertyName1' => ['property old value 1', 'property new value 1'], * 'propertyName2' => ['property old value 2', 'property new value 2'], * etc. * ). * * Please respect lower caml case naming convention for property names */ public function __construct(ResourceNode $node, array $usersToNotify = array()) { $action = self::ACTION; $this->usersToNotify = $usersToNotify; parent::__construct($action, array('resource' => array('name' => $node->getName(), 'path' => $node->getPathForDisplay()), 'workspace' => array('name' => $node->getWorkspace()->getName(), 'id' => $node->getWorkspace()->getId(), 'guid' => $node->getWorkspace()->getGuid()), 'owner' => array('lastName' => $node->getCreator()->getLastName(), 'firstName' => $node->getCreator()->getFirstName())), null, null, $node, null, $node->getWorkspace(), $node->getCreator()); }
/** * Constructor. */ public function __construct(User $user, Workspace $workspace, $details = []) { parent::__construct(self::ACTION, $details, $user, null, null, null, $workspace); }
public function __construct(Survey $survey, User $user) { parent::__construct(self::ACTION, array(), $user, null, $survey->getResourceNode(), null, $survey->getResourceNode()->getWorkspace()); }
/** * Is a repeat if the session contains a same logSignature for the same action category. */ public function isARepeat(LogGenericEvent $event) { if ($this->tokenStorage->getToken() === null) { //Only if have a user session; return false; } if ($event instanceof LogNotRepeatableInterface) { $request = $this->container->get('request'); $session = $request->getSession(); $is = false; $pushInSession = true; $now = time(); //if ($session->get($event->getAction()) != null) { if ($session->get($event->getLogSignature()) != null) { //$oldArray = json_decode($session->get($event->getAction())); $oldArray = json_decode($session->get($event->getLogSignature())); $oldSignature = $oldArray->logSignature; $oldTime = $oldArray->time; if ($oldSignature == $event->getLogSignature()) { $diff = $now - $oldTime; $notRepeatableLogTimeInSeconds = $this->container->getParameter('non_repeatable_log_time_in_seconds'); if ($event->getIsWorkspaceEnterEvent()) { $notRepeatableLogTimeInSeconds = $notRepeatableLogTimeInSeconds * 3; } if ($diff > $notRepeatableLogTimeInSeconds) { $is = false; } else { $is = true; $pushInSession = false; } } } if ($pushInSession) { //Update last logSignature for this event category $array = array('logSignature' => $event->getLogSignature(), 'time' => $now); //$session->set($event->getAction(), json_encode($array)); $session->set($event->getLogSignature(), json_encode($array)); } return $is; } else { return false; } }