public function sendInvitation($email, Application_Model_Entity_User $user) { $firstName = $user->getFirstName(); $lastName = $user->getLastName(); $link = stripslashes("https://{$this->_domain}/user/signup/code/29da0faeb47f91a8cef1bb2c1b5da19d"); $message = $this->_translate->_('mail_dear') . ",<br>" . $this->_translate->_('mail_invite_text') . "{$link}<br><br>" . "{$firstName} {$lastName}"; $subject = $this->_translate->_('mail_invite_subject'); $this->send($user, $subject, $message, false, $email); }
/** * @param Application_Model_Entity_User $user * @return string */ public function signUp(Application_Model_Entity_User $user, $notify, $code = null) { $language = 'en'; try { $locale = new Zend_Locale(Zend_Locale::BROWSER); $language = $locale->getLanguage(); if ($language !== 'de') { $language = 'en'; } } catch (Exception $e) { } $this->_db->insert($this->_table, ['firstName' => $user->getFirstName(), 'lastName' => $user->getLastName(), 'email' => $user->getEmail(), 'password' => $user->getPassword(), 'language' => $language, 'notify' => $notify, 'date' => new Zend_Db_Expr('NOW()'), 'code' => $code]); // get the user's id $user->setId($this->_db->lastInsertId($this->_table)); // insert a dataset with the validation code to the validation table return Application_Model_ValidationRepository::getInstance()->addValidation($user); }
public function update(Application_Model_Entity_User $user) { return $this->_db->update($this->_table, ['firstName' => $user->getFirstName(), 'lastName' => $user->getLastName(), 'email' => $user->getEmail(), 'password' => $user->getPassword(), 'role' => $user->getRole()], $this->_db->quoteInto('id=?', $user->getId())); }