You are here

function persistent_login_user_presave in Persistent Login 7

Implements hook_user_presave().

File

./persistent_login.module, line 297
Provide a "Remember Me" checkbox in the login form.

Code

function persistent_login_user_presave(&$edit, $account, $category) {
  if (isset($account->uid) && !empty($edit['pass'])) {

    // If the password is modified, wipe all persistent logins.
    _persistent_login_invalidate('user_edit', 'uid = :uid', array(
      ':uid' => $account->uid,
    ));
    if (isset($_SESSION)) {
      unset($_SESSION['persistent_login_check']);
      unset($_SESSION['persistent_login_login']);
    }
  }
}