undo lastLogin changes in base and user/user as this has now been properly done in #8681
This commit is contained in:
parent
75cc16f2bd
commit
b15a5a7ca0
|
@ -882,7 +882,6 @@ class OC {
|
|||
|
||||
// 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;
|
||||
|
@ -916,7 +915,6 @@ class OC {
|
|||
$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
|
||||
}
|
||||
|
@ -954,7 +952,6 @@ class OC {
|
|||
}
|
||||
|
||||
$userid = OC_User::getUser();
|
||||
OC_User::getManager()->get($userid)->updateLastLogin();
|
||||
self::cleanupLoginTokens($userid);
|
||||
if (!empty($_POST["remember_login"])) {
|
||||
if (defined("DEBUG") && DEBUG) {
|
||||
|
@ -986,7 +983,6 @@ class OC {
|
|||
|
||||
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();
|
||||
}
|
||||
|
|
|
@ -52,11 +52,6 @@ class User {
|
|||
*/
|
||||
private $config;
|
||||
|
||||
/**
|
||||
* @var int $lastLogin
|
||||
*/
|
||||
private $lastLogin;
|
||||
|
||||
/**
|
||||
* @param string $uid
|
||||
* @param \OC_User_Interface $backend
|
||||
|
@ -74,7 +69,6 @@ class User {
|
|||
} else {
|
||||
$this->enabled = true;
|
||||
}
|
||||
$this->lastLogin = \OC_Preferences::getValue($uid, 'login', 'lastLogin', 0);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -248,22 +242,4 @@ class User {
|
|||
$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);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue