Beispiel #1
0
 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');
         }
     }
 }
Beispiel #2
0
 public function checkCredentials($strUsername, $strPassword, $booDoLogin = false)
 {
     $objDataCustomer = new GSALES_DATA_CUSTOMER();
     $intResult = $objDataCustomer->customerLogin($strUsername, $strPassword);
     if ($intResult > 0 && $booDoLogin) {
         $arrUserData = $objDataCustomer->getCustomerById($intResult);
         if ($arrUserData) {
             $this->login($arrUserData);
         }
     }
     return $intResult;
 }
Beispiel #3
0
 public function newpasswordAction()
 {
     $intCustomerId = false;
     $strToken = false;
     $arrUserRequest = $this->getUserRequest();
     // check link or hidden post vars
     if (is_array($arrUserRequest['params'])) {
         if (count($arrUserRequest['params']) == 2) {
             $intCustomerId = $arrUserRequest['params'][0];
             $strToken = $arrUserRequest['params'][1];
         }
     }
     if (isset($_POST['cid'])) {
         $intCustomerId = $_POST['cid'];
     }
     if (isset($_POST['token'])) {
         $strToken = $_POST['token'];
     }
     if (false == $intCustomerId || false == $strToken) {
         $this->setMessage('Ungültiger Link', 'error');
         $this->redirectTo('index', 'index');
         return;
     }
     // check if customer exists
     $objDataCustomer = new GSALES_DATA_CUSTOMER();
     $objCustomer = $objDataCustomer->getCustomerById($intCustomerId, true);
     if (false == $objCustomer) {
         $this->setMessage('Ungültiger Link', 'error');
         $this->redirectTo('index', 'index');
         return;
     }
     // check if token is correct
     if ($objCustomer->getFrontendPasswordLost() != $strToken) {
         $this->setMessage('Ungültiger Link', 'error');
         $this->redirectTo('index', 'index');
         return;
     }
     $objForm = new HTMLFORM($this, 'newpassword');
     $objForm->setAction('index/newpassword');
     $objForm->setConfirmField('password1', 'password2');
     $objForm->setConfirmField('password1', 'password2');
     $objForm->addField('Neues Passwort', 'password', 'password1', '', true, 'password', '', '');
     $objForm->addField('Neues Passwort bestätigen', 'password', 'password2', '', true, '', '', '');
     $objForm->addField('cid', 'hidden', 'cid', $intCustomerId);
     $objForm->addField('token', 'hidden', 'token', $strToken);
     $objForm->addSubmitButton('Neues Passwort speichern');
     $objForm->output();
     if ($objForm->isSubmittedAndValid()) {
         $booCheck = $objDataCustomer->saveUpdatedFrontendPassword($intCustomerId, $_POST['password1']);
         if ($booCheck) {
             $this->setMessage('Passwort wurde erfolgreich geändert');
             $this->redirectTo('index', 'index');
         } else {
             $this->setMessage('Passwort konnte aufgrund eines Programmfehlers nicht geändert werden', 'error');
         }
     }
 }
Beispiel #4
0
 public function paypaypalAction()
 {
     $this->setSmartyOutput(false);
     $arrUserRequest = $this->getUserRequest();
     // no invoice id given
     if (false == isset($arrUserRequest['params']['0']) || false == is_numeric($arrUserRequest['params']['0'])) {
         $this->redirectTo('invoice');
         return;
     }
     // paypal is disabled
     if (false == PAYPAL_ENABLE) {
         $this->setMessage('Die Bezahlung über PayPal ist momentan nicht möglich', 'error');
         $this->redirectTo('invoice', 'pay', $arrUserRequest['params']['0']);
         return;
     }
     $objDataInvoice = new GSALES_DATA_INVOICE();
     $objInvoice = $objDataInvoice->getInvoiceById($arrUserRequest['params']['0'], $this->objUserAuth->getCustomerId(), true);
     // invoice does not exist (or belongs to another customer)
     if (false == $objInvoice) {
         $this->redirectTo('invoice');
         return;
     }
     // read customer details
     $objDataCustomer = new GSALES_DATA_CUSTOMER();
     $objCustomer = $objDataCustomer->getCustomerById($this->objUserAuth->getCustomerId());
     // do paypal
     require_once FE_DIR . '/lib/payment/paypal.php';
     $objPayPal = new PAYPAL();
     // invoice data
     $objPayPal->add('item_name', 'Rechnung ' . $objInvoice->getInvoiceNo());
     $objPayPal->add('amount', $objInvoice->getOpenAmount());
     $objPayPal->add('custom', $objInvoice->getId());
     // custom field -> invoice id
     // customer data
     $objPayPal->add('first_name', $objCustomer->getFirstname());
     $objPayPal->add('last_name', $objCustomer->getLastname());
     $objPayPal->add('address1', $objCustomer->getAddress());
     $objPayPal->add('city', $objCustomer->getCity());
     $objPayPal->add('zip', $objCustomer->getZIP());
     $objPayPal->add('email', $objCustomer->getEmail());
     $objPayPal->startProcess();
 }
Beispiel #5
0
 public function passwordAction()
 {
     $objForm = new HTMLFORM($this, 'editpass');
     $objForm->setAction('mydata/password');
     $objForm->setConfirmField('password1', 'password2');
     $objForm->addField('Neues Passwort', 'password', 'password1', '', true, 'password', '', '');
     $objForm->addField('Neues Passwort bestätigen', 'password', 'password2', '', true, '', '', '');
     $objForm->addSubmitButton('Passwort ändern');
     $objForm->output();
     if ($objForm->isSubmittedAndValid()) {
         $objDataCustomer = new GSALES_DATA_CUSTOMER();
         $booResult = $objDataCustomer->saveUpdatedFrontendPassword($this->objUserAuth->getCustomerId(), $_POST['password1']);
         if (false == $booResult) {
             $this->setMessage('Das neue Passwort konnte nicht gespeichert werden', 'error');
             return false;
         }
         $this->setMessage('Das neue Passwort wurde erfolgreich gespeichert');
         $this->redirectTo('mydata', 'index');
     }
 }