Example #1
0
 public function HandleSelfRegistration(User $user, IRegistrationPage $page, ILoginContext $loginContext)
 {
     if ($user->StatusId() == AccountStatus::ACTIVE) {
         Log::Debug('PostRegistration - Handling activate user %s', $user->EmailAddress());
         $this->authentication->Login($user->EmailAddress(), $loginContext);
         $page->Redirect(Pages::UrlFromId($user->Homepage()));
     } else {
         Log::Debug('PostRegistration - Handling pending user %s', $user->EmailAddress());
         $this->activation->Notify($user);
         $page->Redirect(Pages::ACTIVATION);
     }
 }
Example #2
0
 protected function LoadValidators($action)
 {
     $this->page->RegisterValidator('fname', new RequiredValidator($this->page->GetFirstName()));
     $this->page->RegisterValidator('lname', new RequiredValidator($this->page->GetLastName()));
     $this->page->RegisterValidator('username', new RequiredValidator($this->page->GetLoginName()));
     $this->page->RegisterValidator('passwordmatch', new EqualValidator($this->page->GetPassword(), $this->page->GetPasswordConfirm()));
     $this->page->RegisterValidator('passwordcomplexity', new PasswordComplexityValidator($this->page->GetPassword()));
     $this->page->RegisterValidator('emailformat', new EmailValidator($this->page->GetEmail()));
     $this->page->RegisterValidator('uniqueemail', new UniqueEmailValidator(new UserRepository(), $this->page->GetEmail()));
     $this->page->RegisterValidator('uniqueusername', new UniqueUserNameValidator(new UserRepository(), $this->page->GetLoginName()));
     $this->page->RegisterValidator('captcha', new CaptchaValidator($this->page->GetCaptcha(), $this->captchaService));
     $this->page->RegisterValidator('additionalattributes', new AttributeValidator($this->attributeService, CustomAttributeCategory::USER, $this->GetAttributeValues()));
 }