Expires user token with user hash.

@param string $hash
966319
public function expireUserToken($hash)
    {
        $this->repository->beginTransaction();
        try {
            $this->userHandler->expireUserToken($hash);
            $this->repository->commit();
        } catch (Exception $e) {
            $this->repository->rollback();
            throw $e;
        }
    }
1361275
public function expireAuthorizationCode($token)
    {
        $authCodeDataMapper = $this->getTokenDataMapper(Entity\AuthorizationCode::class);

        $authorizationCode = $authCodeDataMapper->findByToken($token);
        $authorizationCode->setExpiryDate(new DateTime());

        $authCodeDataMapper->save($authorizationCode);
    }
1184558
public function expire()
    {
        if (!isset($_SESSION[$this->_index]) || !is_array($_SESSION[$this->_index]) || empty($_SESSION[$this->_index])) {
            return;
        }

        unset($_SESSION[$this->_index]);

        // Calling session_destroy triggers the Session::destroy function which removes the entire session
        // from the database. To prevent logout issues between functionality that relies on $_SESSION, such
        // as Symphony authentication or the Members extension, only delete the $_SESSION if it empty!
        if (empty($_SESSION)) {
            session_destroy();
        }
    }
149795
public function needsRehash(string $hash)
    {
        if (substr($hash, 0, 1) !== "$")
            return true;

        $algorithm = $this->config->dget('algorithm', PASSWORD_DEFAULT);
        $options['cost'] = $this->config->dget('cost', 10);
        return password_needs_rehash($hash, $algorithm, $options);
    }
344975
public static function expireCache()
    {
        $handler = eZExpiryHandler::instance();
        $handler->setTimestamp( self::CACHE_SIGNATURE, time() );
        $handler->store();

        self::$wildcardsIndex = null;
    }
418058
public void removeExpiredTokens(CmsUser user, long now) {

        List<String> toRemove = Lists.newArrayList();
        for (Map.Entry<String, Object> entry : user.getAdditionalInfo().entrySet()) {
            String key = entry.getKey();
            if (key.startsWith(KEY_PREFIX)) {
                try {
                    long expiry = Long.parseLong((String)entry.getValue());
                    if (expiry < now) {
                        toRemove.add(key);
                    }
                } catch (NumberFormatException e) {
                    toRemove.add(key);
                }
            }
        }
        LOG.info("Removing " + toRemove.size() + " expired tokens for user " + user.getName());
        for (String removeKey : toRemove) {
            user.getAdditionalInfo().remove(removeKey);
        }
    }
816056
public function removeCssFile($hash)
    {
        $file = $this->getViewCssFileFromHash($hash);
        if (file_exists($file)) {
            unlink($file);
        }
    }
670546
private function setExpires(Memento\Key $key, $expires)
    {
        if (is_null($expires) || !is_integer($expires)) {
            return;
        }
        $this->__connect($key);

        $expiresKey = $this->groupKey ? $this->groupKey : $key;

        return $this->redis->expire($expiresKey->getKey(), $expires);
    }
164330
public function loadUserByToken($hash)
    {
        $query = $this->handler->createSelectQuery();
        $query->select(
            $this->handler->quoteColumn('contentobject_id', 'ezuser'),
            $this->handler->quoteColumn('login', 'ezuser'),
            $this->handler->quoteColumn('email', 'ezuser'),
            $this->handler->quoteColumn('password_hash', 'ezuser'),
            $this->handler->quoteColumn('password_hash_type', 'ezuser'),
            $this->handler->quoteColumn('is_enabled', 'ezuser_setting'),
            $this->handler->quoteColumn('max_login', 'ezuser_setting')
        )->from(
            $this->handler->quoteTable('ezuser')
        )->leftJoin(
            $this->handler->quoteTable('ezuser_setting'),
            $query->expr->eq(
                $this->handler->quoteColumn('user_id', 'ezuser_setting'),
                $this->handler->quoteColumn('contentobject_id', 'ezuser')
            )
        )->leftJoin(
            $this->handler->quoteTable('ezuser_accountkey'),
            $query->expr->eq(
                $this->handler->quoteColumn('user_id', 'ezuser_accountkey'),
                $this->handler->quoteColumn('contentobject_id', 'ezuser')
            )
        )->where(
            $query->expr->lAnd(
                $query->expr->eq(
                    $this->handler->quoteColumn('hash_key', 'ezuser_accountkey'),
                    $query->bindValue($hash, null, \PDO::PARAM_STR)
                ),
                $query->expr->gte(
                    $this->handler->quoteColumn('time', 'ezuser_accountkey'),
                    $query->bindValue(time(), null, \PDO::PARAM_INT)
                )
            )
        );

        $statement = $query->prepare();
        $statement->execute();

        return $statement->fetchAll(\PDO::FETCH_ASSOC);
    }
688129
public function cleanExpiredTokens($expiryTime)
    {
        $sql = "DELETE FROM {$this->tableName} WHERE {$this->expiresColumn} < ? ";

        $query = $this->connection->prepare($sql);
        $query->execute(array(date("Y-m-d H:i:s", $expiryTime)));
    }
539943
public function expireToken($token)
    {
        $tokenData = $this->getTokenData($token);
        if ($tokenData == false) {
            return false;
        }

        $tokenData->date_of_expiry = time() - 1;
        return $tokenData->save();
    }
7413
public function expire($key, $seconds, $cb = null)
    {
        $this->redis->expire($this->config->redisprefix->value . $key, $seconds, $cb);
    }
984304
public function rm($hash) {
		return $this->commandDisabled('rm')
			? array(elFinder::ERROR_ACCESS_DENIED)
			: $this->remove($this->decode($hash));
	}
718267
public function resetPasswordAction($hash)
    {
        $user = $this->userManager->getByResetPasswordHash($hash);

        if (empty($user)) {
            return array(
                'error' => $this->translator->trans('url_invalid', array(), 'platform'),
            );
        }

        $form = $this->formFactory->create(FormFactory::TYPE_USER_RESET_PWD, array(), $user);
        $currentTime = time();

        // the link is valid for 24h
        if ($currentTime - (3600 * 24) < $user->getHashTime()) {
            return array(
                'hash' => $hash,
                'form' => $form->createView()
            );
        }

        return array('error' => $this->translator->trans('link_outdated', array(), 'platform'));
    }
912342
public function setPasswordHash($passwordHash)
    {
        if ($passwordHash === null) {
            $this->hashedPassword = null;
            return;
        }

        // check that the password hash is valid (sanity check)
        UsersManager::checkPasswordHash($passwordHash, Piwik::translate('Login_ExceptionPasswordMD5HashExpected'));

        $this->hashedPassword = $passwordHash;
    }
466743
public function truncateHash($hash)
    {
        $offset = ord($hash[19]) & 0xf;

        return (
            ((ord($hash[$offset+0]) & 0x7f) << 24 ) |
            ((ord($hash[$offset+1]) & 0xff) << 16 ) |
            ((ord($hash[$offset+2]) & 0xff) << 8 ) |
            (ord($hash[$offset+3]) & 0xff)
        ) % pow(10, $this->getCodeLength());
    }
70446
public function delete(string $key, string $hash = '')
    {
        if (!$key && $hash) {
            $wp_using_ext_object_cache            = wp_using_ext_object_cache(false);
            $key                                  = $this->hashToKey($hash);
            $do_restore_wp_using_ext_object_cache = true; // See below.
        }
        if ($this->App->Config->§specs['§is_network_wide'] && $this->Wp->is_multisite) {
            delete_site_transient($this->App->Config->©brand['©var'].'_'.$key);
        } else {
            delete_transient($this->App->Config->©brand['©var'].'_'.$key);
        }
        if (!empty($do_restore_wp_using_ext_object_cache)) {
            wp_using_ext_object_cache($wp_using_ext_object_cache);
        }
    }