/**
     * Register process
     */
    protected function _register()
    {
        // Can't access if already logged in as Member
        if (\CPFCMembers\Auth::isLoggedIn()) {
            wp_redirect(cpfc_home_url(CPFC_MEMBERS_HOME_URL, CPFC_MEMBERS_HTTP_MODE), 301);
            exit();
        }

        if (Input::isPost()) {
            $form = \CPFCMembers\RegistrationForm::getInstance();
            $form->setValues(Input::post());
            $form->validate();

            if ($form->isValid()) {
                $User = new \CPFCMembers\UserModel();
                $User->populateFromArray($form->getValues());
                $User->setRegistrationStatus('unverified');
                $User->setStatus('active');
                $User->setMembershipLevel('free');
                $User->setRegisteredDate(date('Y-m-d H:i:s'));
                $User->setSource('website');
                $User->generateAndStoreVerificationCode();
                if ($User->save(true)) {
                    $email = new \CPFCMembers\Email('email_templates/initial_registration', array('User'=>$User));
                    $email->send($User->getEmailAddress(), 'Your Account has been created');

                    // Log User in automatically
                    $Auth = \CPFCMembers\Auth::getInstance();
                    $Auth->authenticate($User->getEmailAddress(), $User->getPassword(), $remember);

					if($loginRedirect = \CPFCMembers\Session::get('login_redirect')){
						\CPFCMembers\Session::delete('login_redirect');
					}
					else{
						$loginRedirect = cpfc_home_url(CPFC_MEMBERS_HOME_URL, CPFC_MEMBERS_HTTP_MODE) . '?registered';
					}

                    if ($loginRedirect == '' || $loginRedirect == '/') {
                        $loginRedirect .= '?registered';
                    }

					wp_redirect($loginRedirect, 301);
                    exit();
                } else {
                    $form->addError('form', 'Your registration could not be completed at this time');
                }
            }
        }
    }