예제 #1
0
 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);
     }
 }
예제 #2
0
 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);
     }
 }
예제 #3
0
 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);
     }
 }
예제 #4
0
 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()}");
 }
예제 #5
0
 protected function logDebug($message, array $context = [])
 {
     $this->logger->addDebug($this->prefixMessage($message, "DEBUG"), $context);
 }
예제 #6
0
 /**
  * {@inheritdoc}
  * @return Boolean Whether the record has been processed
  */
 public function addDebug($message, array $context = [])
 {
     return $this->parentLogger->addDebug($message, ['channel' => $this->name] + $context);
 }