/** * @param \Cms\Data\User $user * * @return Result */ protected function createSuccessAuthResult($user) { $authIdentity = $user->toArray(); // groups $authIdentity['groups'] = array(); $groups = $user->getGroups(); foreach ($groups as $g) { $authIdentity['groups'][] = array('id' => $g->getId(), 'websiteid' => $g->getWebsiteId()); } $authResult = $this->createAuthResult(Result::SUCCESS, $authIdentity, array('Authentication successful.'), self::BACKEND_NAME); return $authResult; }
/** * @param \Cms\Data\User $user * * @return array */ public function createAndStorePasswordCode(\Cms\Data\User $user) { $userIds = array($user->getId()); $this->execute('deleteByUserIdsAndMode', array($userIds, \Orm\Entity\OptIn::MODE_PASSWORD)); return $this->getDao()->create(array($user), \Orm\Entity\OptIn::MODE_PASSWORD); }
/** * @param \Cms\Data\User $data */ protected function setValuesFromData(UserData $data) { $this->setId($data->getId()); $this->setLastname($data->getLastname()); $this->setFirstname($data->getFirstname()); $this->setGender($data->getGender()); $this->setEmail($data->getEmail()); $this->setLanguage($data->getLanguage()); $this->setSuperuser($data->isSuperuser()); $this->setDeletable($data->isDeletable()); $this->setOwner($data->isOwner()); $this->setReadonly($data->isReadonly()); $this->setGroups($data->getGroups()); }