Exemplo n.º 1
0
 /**
  * @param $userId
  *
  * @return \consim\core\entity\ConsimUser
  */
 public function getUser($userId)
 {
     if (null !== $this->currentUser && $this->currentUser->getUserId()) {
         return $this->currentUser;
     }
     return $this->container->get('consim.core.entity.consim_user')->load($userId);
 }
Exemplo n.º 2
0
    /**
     * Speichere die ConSim daten
     * und speichere den User als Consim register
     *
     * @param ConsimUser $consim_user
     * @access private
     * @throws \consim\core\exception\out_of_bounds
     */
    private function addUserToConsim(ConsimUser $consim_user)
    {
        $user_id = $this->user->data['user_id'];
        $consim_user->insert($user_id);
        //$this->container->get('consim.core.service.inventory')->setStartInventory($user_id, $consim_user->getGeburtsland()->getValue());
        $this->container->get('consim.core.service.asset')->setStartAssets($user_id, $consim_user->getGeburtsland()->getValue());
        foreach ($this->skills as $skill) {
            if ($skill->getCountryId() > 0 && ($consim_user->getGeburtsland()->getValue() == 'bak' && $skill->getId() == 1 || $consim_user->getGeburtsland()->getValue() == 'sur' && $skill->getId() == 2 || $consim_user->getGeburtsland()->getValue() == 'frt' && $skill->getId() == 3)) {
                $this->skills_values[$skill->getId()] += self::EXTRA_LANG;
            }
            $this->container->get('consim.core.entity.consim_user_skill')->insert($user_id, $skill->getId(), $this->skills_values[$skill->getId()]);
        }
        $sql = 'UPDATE ' . USERS_TABLE . '
			SET consim_register = 1
			WHERE user_id = ' . $user_id;
        $this->db->sql_query($sql);
    }
Exemplo n.º 3
0
 /**
  * @param \consim\core\entity\ConsimUser	$user
  */
 public function experienceWidget(\consim\core\entity\ConsimUser $user)
 {
     $this->template->assign_vars(array('IS_USER_EXPERIENCE_WIDGET' => True, 'USER_EXPERIENCE_POINTS_WIDGET' => $user->getExperiencePoints()));
 }