Resets the registration token without changing site identifier so site can be re-registered

@return bool
968367
public static function reset_token() {
        global $DB;
        if (!$hub = self::get_registration()) {
            return true;
        }
        $DB->delete_records('registration_hubs', array('id' => $hub->id));
        self::$registration = null;
    }
325941
public function logout() {
		// Make sure we're logged in and have a valid access token.
		if (!$this->auth_token || !$this->username) {
			return FALSE;
		}

		$timestamp = parent::timestamp();
		$result = parent::post(
			'/logout',
			array(
				'timestamp' => $timestamp,
				'username' => $this->username,
			),
			array(
				$this->auth_token,
				$timestamp,
			)
		);

		// Clear out the cache in case the instance is recycled.
		$this->cache = NULL;

		return is_null($result);
	}
1077529
public function resetPasswordAction()
    {
        if($user = $this->identity()) {
            return $this->redirect()->toRoute($this->getOptions()->getLoginRedirectRoute());
        }
    
        $user = new User;
        $form = $this->getUserFormHelper()->createUserForm($user, 'ResetPassword');
        $message = null;
        if($this->getRequest()->isPost()) {
            $form->setValidationGroup('csrf', 'captcha');
            $form->setData($this->getRequest()->getPost());
            if($form->isValid()) {
                $data = $form->getData();
                $usernameOrEmail = $this->params()->fromPost('usernameOrEmail');
                $entityManager = $this->getEntityManager();
                $user = $entityManager->createQuery("SELECT u FROM CsnUser\Entity\User u WHERE u.email = '$usernameOrEmail' OR u.username = '$usernameOrEmail'")->getResult(\Doctrine\ORM\Query::HYDRATE_OBJECT);
                $user = $user[0];
    
                if(isset($user)) {
                    try {
                        $user->setRegistrationToken(md5(uniqid(mt_rand(), true)));
                        $fullLink = $this->getBaseUrl() . $this->url()->fromRoute('user-register', array( 'action' => 'confirm-email-change-password', 'id' => $user->getRegistrationToken()));
                        $this->sendEmail(
                                $user->getEmail(),
                                $this->getTranslatorHelper()->translate('Please, confirm your request to change password!'),
                                sprintf($this->getTranslatorHelper()->translate('Hi, %s. Please, follow this link %s to confirm your request to change password.'), $user->getUsername(), $fullLink)
                        );
                        $entityManager->persist($user);
                        $entityManager->flush();
    
                        $viewModel = new ViewModel(array(
                            'email' => $user->getEmail(),
                            'navMenu' => $this->getOptions()->getNavMenu()
                        ));
    
                        $viewModel->setTemplate('csn-user/registration/password-change-success');
                        return $viewModel;
                    } catch (\Exception $e) {
                        return $this->getServiceLocator()->get('csnuser_error_view')->createErrorView(
                                $this->getTranslatorHelper()->translate('Something went wrong when trying to send activation email! Please, try again later.'),
                                $e,
                                $this->getOptions()->getDisplayExceptions(),
                                $this->getOptions()->getNavMenu()
                        );
                    }
                } else {
                    $message = 'The username or email is not valid!';
                }
            }
        }
    
        return new ViewModel(array('form' => $form, 'navMenu' => $this->getOptions()->getNavMenu(), 'message' => $message));
    }
213793
public function reset()
    {
        $this->_agent = isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : '';
        $this->_browser_name = self::BROWSER_UNKNOWN;
        $this->_version = self::VERSION_UNKNOWN;
        $this->_platform = self::PLATFORM_UNKNOWN;
        $this->_os = self::OPERATING_SYSTEM_UNKNOWN;
        $this->_is_aol = false;
        $this->_is_mobile = false;
        $this->_is_robot = false;
        $this->_aol_version = self::VERSION_UNKNOWN;
    }
1009129
protected function reset()
    {
        $this->number = null;
        $this->domain = null;
        $this->locale = null;
    }
1121463
public function clearIdentity()
    {
        $this->identity = null;
        Application::$instance->getResponse()->removeCookie(self::TOKEN_NAME);
        return $this;
    }
1266960
public function reset()
	{
		$this->uri 		   = null;
		$this->method 	   = self::GET;
		$this->headers 	   = array();
		$this->paramsGet   = array();
		$this->paramsPost  = array();
		$this->useRawData  = false;
		$this->dataRaw 	   = null;
		$this->httpVersion = self::HTTP_1;
		$this->curlOpts    = array();
		
		return $this;
	}
1120500
private function reset()
    {
        $this->uid = null;
        $this->title = null;
        $this->altTitle = null;
        $this->redirect = null;
        $this->target = null;
        $this->url = null;
        $this->site = null;
        $this->root = null;
        $this->parent = null;
        $this->layout = null;
        $this->elements = array();
        $this->itemToPushInMainZone = null;
        $this->createdAt = null;
        $this->publishedAt = null;
        $this->archiving = null;
        $this->state = null;
        $this->persist = null;
        $this->isSection = false;

        return $this;
    }
1122249
public function clearFeed() {
		// Make sure we're logged in and have a valid access token.
		if (!$this->auth_token || !$this->username) {
			return FALSE;
		}

		$timestamp = parent::timestamp();
		$result = parent::post(
			'/clear',
			array(
				'timestamp' => $timestamp,
				'username' => $this->username,
			),
			array(
				$this->auth_token,
				$timestamp,
			)
		);

		return is_null($result);
	}
1033533
public function regenerateId(): bool
    {
        $result = \session_regenerate_id(true);
        if ($result && $this->csrfToken) {
            $this->csrfToken->regenerateValue();
        }

        return $result;
    }
1235988
public function reset()
    {
        $this->html        = array(array());
        $this->hiddenHtml  = '';
        $this->errors      = array();
        $this->hasRequired = false;
        $this->groupId     = array();

        return $this;
    }
156812
public function resetUserCount()
    {
        \OxidEsales\Eshop\Core\Registry::getSession()->deleteVariable("iUserCount");
        $this->_iUserCount = null;
    }
919493
public function reset(){
    	$originalSettings = $this->settings;
    	$this->settings = array();
    	if(file_put_contents($this->cacheFileName, "{}") === FALSE){
    		$this->settings = $originalSettings;
    		return FALSE;
    	}
    	return TRUE;
    }
873953
public function resetPassword()
    {
        $user = $this->_user;
        $user->new_password = $this->password;
        $user->removePasswordResetToken();

        return $user->save(false);
    }
165870
public function reset()
	{
		$this->sources      = array();
		$this->destinations = array();
		$this->removals     = array();
		$this->patches      = array();

		return $this;
	}
443635
public function reset() : Bool
    {
        if( ! empty($this->init) )
        {
            curl_reset($this->init);

            return true;
        }

        return false;
    }
459734
public function resetPassword()
    {
        // Retrieve received token
        $token = Input::get('token');

        // Validate token
        $resetToken = $this->resetPasswordRepository->getByUnexpiredToken($token);
        if (empty($resetToken)) {
            return view('nodes.api::reset-password.invalid');
        }

        // Retrieve received e-mail
        $email = Input::get('email');

        // Validate e-mail address
        if ($resetToken->email != $email) {
            return redirect()->back()->with(['email' => $email, 'error' => 'Token does not belong to e-mail address']);
        }

        // Retrieve passwords
        $password = Input::get('password');
        $repeatPassword = Input::get('repeat-password');

        // Validate passwords
        if ($password != $repeatPassword) {
            return redirect()->back()->with(['email' => $email, 'error' => 'The two passwords does not match each other']);
        }

        // All good! Update user's password
        $status = $this->resetPasswordRepository->updatePasswordByEmail($email, $password);
        if (empty($status)) {
            return redirect()->back()->with(['email' => $email, 'error' => 'Could not change user\'s password']);
        }

        // Mark token as used
        $resetToken->markAsUsed();

        return redirect()->route('nodes.api.auth.reset-password.done')->with('success', 'Password was successfully changed');
    }