Action for creating a temporary account

@param Registration $registration
@return void
346734
public function createAccountAction(Registration $registration)
    {
        $accountIdentifier = $registration->getUsername();
        $existingAccount = $this->accountRepository->findActiveByAccountIdentifierAndAuthenticationProviderName($accountIdentifier, 'Neos.Neos:Backend');
        if ($existingAccount !== null) {
            $this->addFlashMessage('An account with the username "%s" already exists.', 'Account already exists', Message::SEVERITY_ERROR, array($accountIdentifier));
            $this->forward('newAccount');
        }

        $this->createTemporaryAccount($accountIdentifier, $registration->getPassword(), $registration->getFirstName(), $registration->getLastName());

        $uriBuilder = new UriBuilder();
        $uriBuilder->setRequest($this->request->getParentRequest());
        $redirectUri = $uriBuilder
            ->setCreateAbsoluteUri(true)
            ->uriFor('index', array('username' => $accountIdentifier), 'Login', 'Neos.Neos');
        $this->redirectToUri($redirectUri);
    }
961067
public function register( $context = null ) {
		if ( null !== $context ) {
			$this->add_context( $context );
		}

		if ( ! $this->is_needed( $this->context ) ) {
			return;
		}

		\add_shortcode( $this->get_tag(), [ $this, 'render' ] );
	}
812065
public function register(array $registry)
	{
		foreach($registry as $key => $reg)
			$this->data[$key] = $reg;
	}
489418
public function emailRegistration(array $data)
    {
        if ($this->config->get('user_registration_email_customer', true)) {
            $this->mail->set('user_registered_customer', array($data));
        }

        if ($this->config->get('user_registration_email_admin', true)) {
            $this->mail->set('user_registered_admin', array($data));
        }
    }
1297254
private function RegisterApproval() {
      Gdn::UserModel()->AddPasswordStrength($this);
      
      // If the form has been posted back...
      if ($this->Form->IsPostBack()) {
         
         // Add validation rules that are not enforced by the model
         $this->UserModel->DefineSchema();
         $this->UserModel->Validation->ApplyRule('Name', 'Username', $this->UsernameError);
         $this->UserModel->Validation->ApplyRule('TermsOfService', 'Required', T('You must agree to the terms of service.'));
         $this->UserModel->Validation->ApplyRule('Password', 'Required');
         $this->UserModel->Validation->ApplyRule('Password', 'Strength');
         $this->UserModel->Validation->ApplyRule('Password', 'Match');
         $this->UserModel->Validation->ApplyRule('DiscoveryText', 'Required', 'Tell us why you want to join!');
         // $this->UserModel->Validation->ApplyRule('DateOfBirth', 'MinimumAge');
         
         $this->FireEvent('RegisterValidation');
         
         try {
            $Values = $this->Form->FormValues();
            unset($Values['Roles']);
            $AuthUserID = $this->UserModel->Register($Values);
            if (!$AuthUserID) {
               $this->Form->SetValidationResults($this->UserModel->ValidationResults());
            } else {
               // The user has been created successfully, so sign in now.
               Gdn::Session()->Start($AuthUserID);

               if ($this->Form->GetFormValue('RememberMe'))
                  Gdn::Authenticator()->SetIdentity($AuthUserID, TRUE);
               
               // Notification text
               $Label = T('NewApplicantEmail', 'New applicant:');
               $Story = Anchor(Gdn_Format::Text($Label.' '.$Values['Name']), ExternalUrl('dashboard/user/applicants'));

               $this->EventArguments['AuthUserID'] = $AuthUserID;
               $this->EventArguments['Story'] = &$Story;
               $this->FireEvent('RegistrationPending');
               $this->View = "RegisterThanks"; // Tell the user their application will be reviewed by an administrator.
               
               // Grab all of the users that need to be notified.
               $Data = Gdn::Database()->SQL()->GetWhere('UserMeta', array('Name' => 'Preferences.Email.Applicant'))->ResultArray();
               $ActivityModel = new ActivityModel();
               foreach ($Data as $Row) {
                  $ActivityModel->Add($AuthUserID, 'Applicant', $Story, $Row['UserID'], '', '/dashboard/user/applicants', 'Only');
               }
            }
         } catch (Exception $Ex) {
            $this->Form->AddError($Ex);
         }
      }
      $this->Render();
   }
273726
public static function register($prepend = false)
    {
        if (self::$registered) {
            return;
        }

        spl_autoload_register(array(__CLASS__, 'loadClass'), true, $prepend);
        self::$registered = true;
    }
1057760
private function _xregistration_load($registration)
	{
		static $_propertyregmap = array('username'=>'login', 'name'=>'name', 'email'=>'email', 'orcid'=>'orcid', 'orgtype'=>'orgtype', 'organization'=>'org', 'countryresident'=>'countryresident', 'countryorigin'=>'countryorigin', 'gender'=>'sex', 'url'=>'web', 'reason'=>'reason', 'mailPreferenceOption'=>'mailPreferenceOption', 'usageAgreement'=>'usageAgreement', 'nativeTribe'=>'nativeTribe', 'phone'=>'phone', 'disability'=>'disability', 'hispanic'=>'hispanic', 'race'=>'race', 'admin'=>'admin', 'host'=>'host', 'edulevel'=>'edulevel', 'role'=>'role', 'givenName'=>'givenName', 'middleName'=>'middleName', 'surname'=>'surname');

		if (!is_object($registration))
		{
			$this->setError("Invalid XRegistration object");
			return false;
		}

		foreach ($_propertyregmap as $property => $rproperty)
		{
			if ($registration->get($rproperty) !== null)
			{
				$this->set($property, $registration->get($rproperty));
			}
		}

		$this->set('mailPreferenceOption', $this->get('mailPreferenceOption') ? $this->get('mailPreferenceOption') : '-1');
		$this->set('usageAgreement', $this->get('usageAgreement') ? '1' : '0');

		return true;
	}
842388
public function register()
    {
        $this->registerSessionStore();
        $this->registerTranslator();
        $this->registerFlasher();
        $this->registerFlash();
        $this->registerFlashAlias();
    }
1116320
public function postRegister(RegisterRequest $request)
    {
        if (! \Setting::get('user::enable-registration')) {
            return redirect()->route('login');
        }

        \Auth::login($this->create($request->all()));

        return redirect($this->redirectPath());
    }
592905
public function register(FormRequestRegister $request)
    {
        $user = $this->create($request->all());

        event(new Registered($user));

        return redirect()
            ->back()
            ->with('status', __('Your account has been created, check your email for the verification link.'));
    }
1006098
public void registerActivitiStateHandler(
			ActivitiStateHandlerRegistration registration) {
		String regKey = registrationKey(registration.getProcessName(),
				registration.getStateName());
		this.registrations.put(regKey, registration);
	}
949916
protected function registerRegistry()
    {
        $this->app['registry'] = $this->app->share(function($app)
        {
            $config = $app->config->get('registry', array());

            return new Registry($app['db'], $app['registry.cache'], $config);
        });
    }
801372
private function registerUsermanagement() {

        $this->app->bind('usermanagement', function($app) {
            return new Usermanagement($app);
        });

        $this->app->bind(
            'Illuminate\Contracts\Auth\Registrar',
            'Lasallecms\Usermanagement\Services\Registrar'
        );
    }
534353
public function register()
    {
        $this->app->singleton('soda.menu.registrar', function ($app) {
            return new MenuRegistrar;
        });

        $this->app->singleton('soda.menu', function ($app) {
            return new MenuBuilder($app['soda.menu.registrar']);
        });
    }
568985
protected function registerPeriodInterface()
	{
		$this->app->bind('Mgallegos\DecimaAccounting\Accounting\Repositories\Period\PeriodInterface', function($app)
		{
			$AuthenticationManager = $app->make('App\Kwaai\Security\Services\AuthenticationManagement\AuthenticationManagementInterface');

			return new \Mgallegos\DecimaAccounting\Accounting\Repositories\Period\EloquentPeriod(new Period(), $app['db'], $AuthenticationManager->getCurrentUserOrganizationConnection());
		});
	}
271772
private function _store_account( $blog_id = null ) {
            $this->_logger->entrance();

            $this->_store_site( false, $blog_id );
            $this->_store_user( false );
            $this->_store_plans( false );
            $this->_store_licenses( false );

            self::$_accounts->store( $blog_id );
        }
1177234
private function addRegistration(Registration $registration, RegisterMessage $msg)
    {
        try {
            // make sure the uri is exactly the same
            if ($registration->getProcedureName() !== $this->getProcedureName()) {
                throw new \Exception('Attempt to add registration to procedure with different procedure name.');
            }

            // make sure options match
            if (strcasecmp($registration->getInvokeType(), $this->getInvokeType()) !== 0) {
                throw new \Exception('Registration and procedure must agree on invocation type');
            }
            if ($registration->getDiscloseCaller() !== $this->getDiscloseCaller()) {
                throw new \Exception('Registration and procedure must agree on disclose caller');
            }

            $this->registrations[] = $registration;

            $registration->getSession()->sendMessage(new RegisteredMessage($msg->getRequestId(), $registration->getId()));

            // now that we have added a new registration, process the queue if we are using it
            if ($this->getAllowMultipleRegistrations()) {
                $this->processQueue();
            }

            return true;
        } catch (\Exception $e) {
            $registration->getSession()->sendMessage(ErrorMessage::createErrorMessageFromMessage($msg));

            return false;
        }
    }