// if return is true we are logged in -> redirect to the default page
if ($return === true) {
- OC_User::getManager()->get(OC_User::getUser())->updateLastLogin();
$_REQUEST['redirect_url'] = \OC_Request::requestUri();
OC_Util::redirectToDefaultPage();
exit;
$granted = OC_User::loginWithCookie(
$_COOKIE['oc_username'], $_COOKIE['oc_token']);
if($granted === true) {
- OC_User::getManager()->get(OC_User::getUser())->updateLastLogin();
OC_Util::redirectToDefaultPage();
// doesn't return
}
}
$userid = OC_User::getUser();
- OC_User::getManager()->get($userid)->updateLastLogin();
self::cleanupLoginTokens($userid);
if (!empty($_POST["remember_login"])) {
if (defined("DEBUG") && DEBUG) {
if (OC_User::login($_SERVER["PHP_AUTH_USER"], $_SERVER["PHP_AUTH_PW"])) {
//OC_Log::write('core',"Logged in with HTTP Authentication", OC_Log::DEBUG);
- OC_User::getManager()->get(OC_User::getUser())->updateLastLogin();
OC_User::unsetMagicInCookie();
$_SERVER['HTTP_REQUESTTOKEN'] = OC_Util::callRegister();
}
*/
private $config;
- /**
- * @var int $lastLogin
- */
- private $lastLogin;
-
/**
* @param string $uid
* @param \OC_User_Interface $backend
} else {
$this->enabled = true;
}
- $this->lastLogin = \OC_Preferences::getValue($uid, 'login', 'lastLogin', 0);
}
/**
$this->config->setUserValue($this->uid, 'core', 'enabled', $enabled);
}
}
-
- /**
- * returns the timestamp of the user's last login or 0 if the user did never
- * login
- *
- * @return int
- */
- public function getLastLogin() {
- return $this->lastLogin;
- }
-
- /**
- * @brief updates the timestamp of the most recent login of this user
- */
- public function updateLastLogin() {
- $this->lastLogin = time();
- \OC_Preferences::setValue($this->uid, 'login', 'lastLogin', $this->lastLogin);
- }
}