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 editAction()
 {
     $objDataCustomer = new GSALES_DATA_CUSTOMER();
     $objCustomer = $objDataCustomer->getCustomerById($this->objUserAuth->getCustomerId());
     // read customer data
     $objCustomer->overriteProposalWithCurrentValues();
     // load existent proposals
     $objForm = new HTMLFORM($this, 'mydataedit');
     // form for customer data edit
     $objForm->setAction('mydata/edit');
     $objForm->addField('Firma', 'input', 'company', $objCustomer->getCompany(), false, '', '', '');
     $objForm->addField('Vorname', 'input', 'firstname', $objCustomer->getFirstname(), true, '', '', '');
     $objForm->addField('Nachname', 'input', 'lastname', $objCustomer->getLastname(), true, '', '', '');
     $objForm->addField('Anschrift', 'input', 'address', $objCustomer->getAddress(), true, '', '', '');
     $objForm->addField('PLZ', 'input', 'zip', $objCustomer->getZIP(), true, '', '', '');
     $objForm->addField('Ort', 'input', 'city', $objCustomer->getCity(), true, '', '', '');
     $objForm->addField('Land', 'input', 'country', $objCustomer->getCountry(), false, '', '', '');
     $objForm->addField('Homepage', 'input', 'homepage', $objCustomer->getHomepage(), false, '', '', '');
     $objForm->addField('E-Mail', 'input', 'email', $objCustomer->getEMail(), true, '', '', '');
     $objForm->addField('Telefon', 'input', 'phone', $objCustomer->getPhone(), true, '', '', '');
     $objForm->addField('Fax', 'input', 'fax', $objCustomer->getFax(), false, '', '', '');
     $objForm->addField('Kontonummer', 'input', 'bank_account_no', $objCustomer->getBankAccountNo(), false, '', '', '');
     $objForm->addField('BLZ', 'input', 'bank_code', $objCustomer->getBankCode(), false, '', '', '');
     $objForm->addField('Inhaber', 'input', 'bank_account_owner', $objCustomer->getBankAccountOwner(), false, '', '', '');
     $objForm->addField('IBAN', 'input', 'bank_iban', $objCustomer->geBankIBAN(), false, '', '', '');
     $objForm->addField('BIC', 'input', 'bank_bic', $objCustomer->getBankBIC(), false, '', '', '');
     $objForm->addSubmitButton('Änderungen speichern');
     // save button
     $objForm->output();
     if ($objForm->isSubmittedAndValid()) {
         $arrData = $_POST;
         unset($arrData['submitted']);
         // unset "garbage" of HTMLFORM Class
         unset($arrData['submitButton']);
         $arrResult = $objDataCustomer->updateCustomerProposal($this->objUserAuth->getCustomerId(), $arrData);
         if (false != $arrResult->getProposedChanges()) {
             $this->setMessage('Wir haben Ihre Änderungen erhalten und werden diese nach einer Überprüfung endgültig in unser System aufnehmen');
             $this->redirectTo('mydata', 'index');
         }
     } else {
         if (false != $objCustomer->getProposedChanges()) {
             $this->setMessage('Ihre zuvor übermittelten Änderungen wurden noch nicht endgültig ins unser System übernommen', '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 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');
         }
     }
 }