public function getUsername() { $this->__load(); return parent::getUsername(); }
/** * Generate the user hash in a secure format for storage in a client side 'remember cookie' cookie * * @param \Entities\User $user The user entitiy to generate the hash for * @return string The `sha1()` hash */ protected function _generateCookieUserhash($user) { return sha1($user->getId() . '+' . $user->getUsername() . '/' . $this->_options['resources']['auth']['oss']['rememberme']['salt']); }
/** * Send a welcome email to a new user * * @param \Entities\User $user The recipient of the email * @return bool True if the mail was sent successfully */ private function sendWelcomeEmail($user) { try { $mail = $this->getMailer(); $mail->setFrom($this->_options['identity']['email'], $this->_options['identity']['name'])->setSubject($this->_options['identity']['sitename'] . ' - ' . _('Your Access Details'))->addTo($user->getEmail(), $user->getUsername())->setBodyHtml($this->view->render('user/email/html/welcome.phtml'))->send(); } catch (Zend_Mail_Exception $e) { $this->getLogger()->alert("Could not send welcome email for new user!\n\n" . $e->toString()); return false; } return true; }
/** * A simple function to reauthenticate to a given user **Ignores password**. * * @param \Entities\User $nuser The user to reauthenticate as * @return Zend_Auth_Result */ protected function _reauthenticate($nuser) { $auth = Zend_Auth::getInstance(); $authAdapter = $this->_getAuthAdapter($nuser->getUsername(), $nuser->getPassword()); // trick the adapter into ignoring the password $authAdapter->haveCookie(true); return $auth->authenticate($authAdapter); }