scope (like Zepto.js or document.querySelectorAll, for example) you will need
to use different names to or re-bind them at the top of each
ResourceLoader-loaded module.
+* (bug 52342) Preference "Remember my login" was removed.
==== Removed classes ====
* FakeMemCachedClient (deprecated in 1.18)
'previewontop' => 1,
'rcdays' => 7,
'rclimit' => 50,
- 'rememberpassword' => 0,
'rows' => 25,
'showhiddencats' => 0,
'shownumberswatching' => 1,
'section' => 'personal/info',
);
}
- if ( $wgCookieExpiration > 0 ) {
- $defaultPreferences['rememberpassword'] = array(
- 'type' => 'toggle',
- 'label' => $context->msg( 'tog-rememberpassword' )->numParams(
- ceil( $wgCookieExpiration / ( 3600 * 24 ) ) )->text(),
- 'section' => 'personal/info',
- );
- }
// Only show prefershttps if secure login is turned on
if ( $wgSecureLogin && wfCanIPUseHTTPS( $context->getRequest()->getIP() ) ) {
$defaultPreferences['prefershttps'] = array(
* @param $request WebRequest object to use; $wgRequest will be used if null
* is passed.
* @param bool $secure Whether to force secure/insecure cookies or use default
+ * @param bool $rememberMe Whether to add a Token cookie for elongated sessions
*/
- public function setCookies( $request = null, $secure = null ) {
+ public function setCookies( $request = null, $secure = null, $rememberMe = false ) {
if ( $request === null ) {
$request = $this->getRequest();
}
'UserID' => $this->mId,
'UserName' => $this->getName(),
);
- if ( 1 == $this->getOption( 'rememberpassword' ) ) {
+ if ( $rememberMe ) {
$cookies['Token'] = $this->mToken;
} else {
$cookies['Token'] = false;
* standard time setting, based on if rememberme was set.
*/
if ( $request->getCheck( 'wpStickHTTPS' ) || $this->requiresHTTPS() ) {
- $time = null;
- if ( ( 1 == $this->getOption( 'rememberpassword' ) ) ) {
- $time = 0; // set to $wgCookieExpiration
- }
$this->setCookie(
'forceHTTPS',
'true',
- $time,
+ $rememberMe ? 0 : null,
false,
array( 'prefix' => '' ) // no prefix
);
$priorKeys[] = $row->up_property;
}
if ( count( $priorKeys ) ) {
- // Do the DELETE by PRIMARY KEY for prior rows. A very large portion of
- // calls to this function are for setting 'rememberpassword' for new accounts.
+ // Do the DELETE by PRIMARY KEY for prior rows.
+ // In the past a very large portion of calls to this function are for setting
+ // 'rememberpassword' for new accounts (a preference that has since been removed).
// Doing a blanket per-user DELETE for new accounts with no rows in the table
- // causes gap locks on [max user ID,+infinity) which causes high contention since
- // updates will pile up on each other as they are for higher (newer) user IDs.
+ // caused gap locks on [max user ID,+infinity) which caused high contention since
+ // updates would pile up on each other as they are for higher (newer) user IDs.
+ // It might not be necessary these days, but it shouldn't hurt either.
$dbw->delete( 'user_properties',
array( 'up_user' => $userId, 'up_property' => $priorKeys ), __METHOD__ );
}
case LoginForm::SUCCESS:
$user = $context->getUser();
$this->getContext()->setUser( $user );
- $user->setOption( 'rememberpassword', 1 );
$user->setCookies( $this->getRequest() );
ApiQueryInfo::resetTokenCache();
$wgAuth->initUser( $u, $autocreate );
- $u->setOption( 'rememberpassword', $this->mRemember ? 1 : 0 );
$u->saveSettings();
// Update user count
case self::SUCCESS:
# We've verified now, update the real record
$user = $this->getUser();
- if ( (bool)$this->mRemember != $user->getBoolOption( 'rememberpassword' ) ) {
- $user->setOption( 'rememberpassword', $this->mRemember ? 1 : 0 );
- $user->saveSettings();
- } else {
- $user->invalidateCache();
- }
+ $user->invalidateCache();
if ( $user->requiresHTTPS() ) {
$this->mStickHTTPS = true;
}
if ( $wgSecureLogin && !$this->mStickHTTPS ) {
- $user->setCookies( null, false );
+ $user->setCookies( $this->mRequest, false, $this->mRemember );
} else {
- $user->setCookies();
+ $user->setCookies( $this->mRequest, null, $this->mRemember );
}
self::clearLoginToken();
$template->set( 'resetlink', $resetLink );
$template->set( 'canremember', ( $wgCookieExpiration > 0 ) );
$template->set( 'usereason', $user->isLoggedIn() );
- $template->set( 'remember', $user->getOption( 'rememberpassword' ) || $this->mRemember );
+ $template->set( 'remember', $this->mRemember );
$template->set( 'cansecurelogin', ( $wgSecureLogin === true ) );
$template->set( 'stickhttps', (int)$this->mStickHTTPS );
$template->set( 'loggedin', $user->isLoggedIn() );
"tog-showtoolbar": "Show edit toolbar",
"tog-editondblclick": "Edit pages on double click",
"tog-editsectiononrightclick": "Enable section editing by right clicking on section titles",
- "tog-rememberpassword": "Remember my login on this browser (for a maximum of $1 {{PLURAL:$1|day|days}})",
"tog-watchcreations": "Add pages I create and files I upload to my watchlist",
"tog-watchdefault": "Add pages and files I edit to my watchlist",
"tog-watchmoves": "Add pages and files I move to my watchlist",
relnamespace
remarticle
remembermypassword
-rememberpassword
removablegroups
removal
remove
'tog-showtoolbar',
'tog-editondblclick',
'tog-editsectiononrightclick',
- 'tog-rememberpassword',
'tog-watchcreations',
'tog-watchdefault',
'tog-watchmoves',