You are here

protected function AuthenticationManager::setAccessTime in RESTful 7.2

Set the user's last access time.

Parameters

object $account: A user account.

See also

_drupal_session_write()

1 call to AuthenticationManager::setAccessTime()
AuthenticationManager::getAccount in src/Authentication/AuthenticationManager.php
Get the user account for the request.

File

src/Authentication/AuthenticationManager.php, line 193
Contains \Drupal\restful\Authentication\AuthenticationManager

Class

AuthenticationManager
Class AuthenticationManager.

Namespace

Drupal\restful\Authentication

Code

protected function setAccessTime($account) {

  // This logic is pulled directly from _drupal_session_write().
  if ($account->uid && REQUEST_TIME - $account->access > variable_get('session_write_interval', 180)) {
    db_update('users')
      ->fields(array(
      'access' => REQUEST_TIME,
    ))
      ->condition('uid', $account->uid)
      ->execute();
  }
}