/** * Saves the simple register element * @return ContentRegisterSimple */ protected function SaveElement() { $this->register->SetConfirmUrl($this->selectorConfirm->Save($this->register->GetConfirmUrl())); $this->register->SetNextUrl($this->selectorNext->Save($this->register->GetNextUrl())); $this->register->SetMailFrom($this->Value('MailFrom')); $this->register->SetMailText1($this->Value('MailText1')); $this->register->SetMailText2($this->Value('MailText2')); $this->register->SetMailSubject($this->Value('MailSubject')); $this->register->SetMailStyles($this->Value('MailStyles')); return $this->register; }
protected function OnSuccess() { $this->member = new Member(); $this->member->SetEMail($this->Value('EMail')); $this->member->SetName($this->Value('Name')); $password = $this->Value('Password'); $salt = String::Start(md5(uniqid(microtime())), 8); $pwHash = hash('sha256', $password . $salt); $this->member->SetPassword($pwHash); $this->member->SetPasswordSalt($salt); $this->member->SetCreated(Date::Now()); $this->member->Save(); $this->SendConfirmMail(); if ($this->register->GetNextUrl()) { Response::Redirect(FrontendRouter::Url($this->register->GetNextUrl())); } }