public function indexAction() { $objForm = new HTMLFORM($this, 'contact'); $objForm->setAction('contact/index'); $objForm->addField('Anliegen', 'input', 'subject', '', true, '', '', ''); $objForm->addField('Nachricht', 'textarea', 'message', '', true, '', '', ''); $objForm->addSubmitButton('Nachricht übermitteln'); $objForm->output(); if ($objForm->isSubmittedAndValid()) { $objDataCustomer = new GSALES_DATA_CUSTOMER(); $objCustomer = $objDataCustomer->getCustomerById($this->objUserAuth->getCustomerId()); $objMailer = new FRONTEND_MAILER(); $objMailer->FromName = trim($objCustomer->getFirstname() . ' ' . $objCustomer->getLastname()); $objMailer->From = $objCustomer->getEmail(); $objMailer->AddReplyTo($objCustomer->getEmail(), trim($objCustomer->getFirstname() . ' ' . $objCustomer->getLastname())); $objMailer->Subject = 'Kundenfrontend "' . $_POST['subject'] . '"'; $objMailer->Body = $_POST['message']; $objMailer->AddAddress(MAIL_TO); $booCheck = $objMailer->Send(); if ($booCheck) { $this->setMessage('Nachricht wurde erfolgreich verschickt'); $this->redirectTo('contact', 'index'); } else { $this->setMessage($objMailer->ErrorInfo, 'error'); } } }
public function passwordAction() { $objForm = new HTMLFORM($this, 'password'); $objForm->setAction('index/password'); $objForm->addField('E-Mail/Kundennummer', 'input', 'username', '', true, '', '', ''); $objForm->addSubmitButton('E-Mail zusenden'); $objForm->output(); if ($objForm->isSubmittedAndValid()) { $objCustomerData = new GSALES_DATA_CUSTOMER(); $intResult = $objCustomerData->passwordLostStep1($_POST['username']); if ($intResult < 0) { switch ($intResult) { case -1: if (false == strstr('@', $strUsername)) { $this->setMessage('Die E-Mail Adresse ist nicht eindeutig, bitte anhand Ihrer Kundennummer probieren.', 'error'); } else { $this->setMessage('Die Kundennummer ist nicht eindeutig, bitte anhand Ihrer E-Mail Adresse probieren.', 'error'); } break; case -2: $this->setMessage('Kudenkonto konnte nicht gefunden werden.', 'error'); break; case -3: $this->setMessage('Die Passwort-Vergessen Funktion steht momentan aufgrund eines Fehlers nicht zur Verfügung.', 'error'); break; default: } return false; } else { // email versenden $objCustomer = $objCustomerData->getCustomerById($intResult); $arrData['id'] = $objCustomer->getId(); $arrData['email'] = $objCustomer->getEmail(); $arrData['token'] = $objCustomer->getFrontendPasswordLost(); $arrData['url'] = FRONTEND_URL; $objMailer = new FRONTEND_MAILER(); $objMailer->FromName = MAIL_FROM_NAME; $objMailer->From = MAIL_FROM; $objMailer->useTemplateForSubjectAndBody('passwordlost.tpl', $arrData); $objMailer->AddAddress($objCustomer->getEmail(), trim($objCustomer->getFirstname() . ' ' . $objCustomer->getLastname())); $objMailer->Send(); $this->setMessage('Sie erhalten in Kürze eine E-Mail. Bitte befolgen Sie die Anweisungen um ein neues Passwort festzulegen.'); $this->redirectTo('index', 'index'); } } }