public function save(Application_Model_User $user) { $password = sha1($user->getPassword()); $data = array('confirmed' => $user->getConfirmed(), 'created' => $user->getCreated(), 'email' => $user->getEmail(), 'id' => $user->getId(), 'name' => $user->getName(), 'password' => $password); if (null === ($id = $user->getId())) { unset($data['id']); return $this->getDbTable()->insert($data); } else { $this->getDbTable()->update($data, array('id = ?' => $id)); } }
private function sendRecoverEmail(Application_Model_User $user) { $mail = new Zend_Mail(); $mail->setFrom('*****@*****.**', 'Wins and Wants'); $mail->addTo($user->getEmail()); $mail->setSubject('Account Details'); $txt = "Your account details are as follows Username: "******" Password: " . $user->getPassword(); $mail->setBodyText($txt, 'UTF-8'); $mail->send(); }