예제 #1
0
 /**
  *  Metod to reset Password
  *
  * @return  void
  */
 public function reset()
 {
     $post = JRequest::get('post');
     $model = $this->getModel('password');
     $Itemid = JRequest::getVar('Itemid');
     $layout = "";
     // Request a reset
     if ($model->resetpassword($post)) {
         $redshopMail = new redshopMail();
         if ($redshopMail->sendResetPasswordMail($post['email'])) {
             $layout = "&layout=token";
             $msg = JText::_('COM_REDSHOP_RESET_PASSWORD_MAIL_SEND');
         } else {
             $msg = JText::_('COM_REDSHOP_RESET_PASSWORD_MAIL_NOT_SEND');
         }
     } else {
         $msg = JText::_('COM_REDSHOP_RESET_PASSWORD_MAIL_NOT_SEND');
     }
     $this->setRedirect('index.php?option=com_redshop&view=password' . $layout . '&Itemid=' . $Itemid, $msg);
 }