public function userInit() { $user = null; $email = $this->userValues["contact"]["email"]; try { $user = $this->userService->getUserEmail($email); } catch (Exceptions\NoResultException $ex) { $this->logger->addDebug($ex); } if ($user === null) { $this->logger->addInfo("Users module initializer - User - no user with email {$email} found. New one is gonna be created."); $addrValues = $this->userValues["contact"]["address"]; $address = new Address((array) $addrValues); $address->applyAccountNumber($this->userValues["contact"]["address"]["accountNumber"]); $address->applyIdentificationNumber($this->userValues["contact"]["address"]["identificationNumber"]); $address->applyTaxIdentificationNumber($this->userValues["contact"]["address"]["taxIdentificationNumber"]); $contValues = $this->userValues["contact"]; $contact = new Contact((array) $contValues); $contact->setAddress($address); $userValues = $this->userValues; unset($userValues["contact"]); $user = new User((array) $userValues); $user->setActive(true); $user->setContact($contact); $user->setBirthNumber("0000000000"); $this->userService->createUser($user); } }
public function groupInit() { $group = null; $abbr = $this->groupValues["abbr"]; try { $group = $this->groupService->getSportGroupAbbr($abbr); } catch (Exceptions\NoResultException $ex) { $this->logger->addDebug($ex); } if ($group === null) { $this->logger->addInfo("System module initializer - Sport Group - no group with abbr {$abbr} found. New one is gonna be created."); $g = new SportGroup((array) $this->getGroupValues()); $this->groupService->createSportGroup($g); } }
public function rulesInit() { $role = $this->roleService->getRoleName("admin"); $rule = null; try { $rule = $this->ruleService->getUniqueRule($role); } catch (Exceptions\NoResultException $ex) { $this->logger->addDebug($ex->getMessage()); } if ($rule === null) { $this->logger->addInfo("Security module initializer - AclRules - no godlike Rule for role {$role} found. New one is gonna be created."); $rule = new AclRule(); $rule->setRole($role); $rule->setResource(null); $rule->setPrivilege(null); $rule->setMode(\App\Model\Misc\Enum\AclMode::PERMIT); $this->ruleService->createRule($rule); } }
public function onPasswordRegenerate(User $u) { $this->notifService->notifyNewPassword($u); $this->logger->addInfo("User Listener - onPasswordRegenerate - user {$u} notified"); $this->logger->addDebug("User Listener - onPasswordRegenerate - new password for user {$u} is {$u->provideRawPassword()}"); }
/** * @param string $message * @param array $data */ public function iLog($message, array $data = []) { /** @var Control $this */ $data = array_merge(['user' => $this->presenter->user->id, 'route' => $this->presenter->getName() . ':' . $this->presenter->action], $data); $this->log->addInfo($message, $data); }
public function onCreate(Payment $p) { $this->notifService->notifyNewPayment($p); $this->logger->addInfo("System Module - Payments Listener - onCreate - owner of {$p} has been notified"); }
/** * onDelete event handler * @param BaseEntity $e */ public function onDelete(BaseEntity $e) { $this->aclService->invalidateCache(); $this->logger->addInfo("AclRuleListener - onDelete - cache of aclService is gonna be deleted"); }
protected function logInfo($message, array $context = []) { $this->logger->addInfo($this->prefixMessage($message, "INFO"), $context); }
public function onCreate(SeasonApplication $app) { $this->notifService->notifyNewSeasonApplication($app); $this->logger->addInfo("System Module - Application Listener - onCreated - owner of season application {$app} has been notified"); }
/** * {@inheritdoc} * @return Boolean Whether the record has been processed */ public function addInfo($message, array $context = []) { return $this->parentLogger->addInfo($message, ['channel' => $this->name] + $context); }
public function onCreate(MailBoxEntry $entry) { $this->notifService->notifyNewMessage($entry); $this->logger->addInfo("System Module - Messages Listener - onCreate - recipient of {$entry} has been notified"); }