public function getAction1() { $hash = $_REQUEST['h']; // Token gueltig? //if ($this->piVars['h'] && ($this->piVars['h']==$this->sendcode || $this->piVars['h']==$this->sendcode_old)) { if (strlen($_REQUEST['h']) > 10 || ($this->piVars['sendcode']==$this->sendcode || $this->piVars['sendcode']==$this->sendcode_old)) { $send=1; } else{ $send=0; } if ($send) { $this->error_email = 0; $this->error_password = 0; $this->error_user_exists = 0; // Ist E-Mail gueltig $con=$GLOBALS['TYPO3_DB']->exec_SELECTquery( '*', 'fe_users', "deleted = 0 AND comments=".$GLOBALS['TYPO3_DB']->fullQuoteStr($hash,'fe_users')."", null, null, null ); if (!filter_var($this->piVars['e'],FILTER_VALIDATE_EMAIL)) $this->error_email = 1; // Existiert der Benutzer schon $email=$this->piVars['e']; if ($this->error_email==0) { $con=$GLOBALS['TYPO3_DB']->exec_SELECTquery( 'uid', 'fe_users', "deleted = 0 AND email=".$GLOBALS['TYPO3_DB']->fullQuoteStr($email,'fe_users')."", null, null, null ); $row=$GLOBALS['TYPO3_DB']->sql_fetch_assoc( $con ); if (!empty($row)) { //$update_tmp=$GLOBALS['TYPO3_DB']->exec_UPDATEquery('fe_users',"deleted = 0 AND email=". $GLOBALS['TYPO3_DB']->fullQuoteStr($email,'fe_users')."", array( 'endtime' => 0)); $this->error_user_exists = 1; } } if ( $this->piVars['p']!=$this->piVars['p2']) { $this->error_password_text='Die beiden Passwörter sind nicht gleich'; $this->error_password = 1; } elseif( strlen($this->piVars['p'])<6 ) { $this->error_password = 1; $this->error_password_text='Das Passwort muss mindestens 6 Zeichen lang sein'; } $this->errors = $this->error_email || $this->error_password || $this->error_user_exists; } if (!$this->errors && $send==1) { return 'registersend';//$this->get_register_send_mail(); } else { return 'register';//$this->get_register_form_1(); } } //$mode = $this->pi_getFFvalue($this->settings, 'mode', 'sDEF'); public function getAction2() { $hash = $_REQUEST['h']; // Token gueltig? //if ($this->piVars['h'] && ($this->piVars['h']==$this->sendcode || $this->piVars['h']==$this->sendcode_old)) { if (strlen($_REQUEST['h']) > 10 || ($this->piVars['sendcode']==$this->sendcode || $this->piVars['sendcode']==$this->sendcode_old)) { $send=1; } else{ $send=0; } // Formular 2 // Felder testen if ($send) $this->error_agb = 0; $this->errors = $this->errors || $this->error_agb ; if (!$this->errors && $send==1) { return 'confirm';//$content = $this->update_register_form_2(); } else { return 'data';//$content = $this->get_register_form_2(); } return $content; } /** * renders fluid template * @param string $template path to fluid-html-template, form: ext/Resources/Private/Templates/*$template* * @param array $parameter key=>value pairs, where key is fluid placeholder {key} in the template * @return string rendered (html-format) template */ private function renderFluid($template, $parameter) { /** * @var \TYPO3\CMS\Fluid\View\StandaloneView $emailView */ $objectManager = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Extbase\\Object\\ObjectManager'); $fluidView = $objectManager -> get('TYPO3\\CMS\\Fluid\\View\\StandaloneView'); $extPath = \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath($this->extKey); $templateFile = $extPath . "Resources/Private/Templates/" . $template; $partialOrder = $extPath . "Resources/Private/Partials/"; $fluidView -> setTemplatePathAndFilename($templateFile); $fluidView -> setPartialRootPaths([$partialOrder]); $fluidView -> assignMultiple($parameter); $fluidView -> getRequest() -> setControllerExtensionName("ig_account_create"); return $fluidView -> render("index"); } /* public function getMailText($params = array()) { $params['baseUrl'] = $this->baseurl; //echo $this -> renderFluid("Mail/Index.html", $params); exit; return $this -> renderFluid("Mail/Index.html", $params); } */ function sendmail($email, $password, $hash/*, $valid_to*/) { //$endtime= date("d.m.Y - H:i", $valid_to); $msg = $this->pi_getFFvalue($this->settings, 'email_text', 'thanks'); $msg = str_replace('###USERNAME###',$email,$msg); $msg = str_replace('###PASSWORD###',$password,$msg); $username_password = '
Benutzername: | '.htmlspecialchars($email).' | |
Passwort: | '.htmlspecialchars($password).' |