Merge "Register a default value for the timecorrection preference"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Thu, 1 Sep 2016 20:33:50 +0000 (20:33 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Thu, 1 Sep 2016 20:33:50 +0000 (20:33 +0000)
1  2 
includes/Setup.php

diff --combined includes/Setup.php
@@@ -452,6 -452,22 +452,6 @@@ if ( $wgProfileOnly ) 
        $wgDebugLogFile = '';
  }
  
 -// Disable AuthManager API modules if $wgDisableAuthManager
 -if ( $wgDisableAuthManager ) {
 -      $wgAPIModules += [
 -              'clientlogin' => 'ApiDisabled',
 -              'createaccount' => 'ApiCreateAccount', // Use the non-AuthManager version
 -              'linkaccount' => 'ApiDisabled',
 -              'unlinkaccount' => 'ApiDisabled',
 -              'changeauthenticationdata' => 'ApiDisabled',
 -              'removeauthenticationdata' => 'ApiDisabled',
 -              'resetpassword' => 'ApiDisabled',
 -      ];
 -      $wgAPIMetaModules += [
 -              'authmanagerinfo' => 'ApiQueryDisabled',
 -      ];
 -}
 -
  // Backwards compatibility with old password limits
  if ( $wgMinimalPasswordLength !== false ) {
        $wgPasswordPolicy['policies']['default']['MinimalPasswordLength'] = $wgMinimalPasswordLength;
@@@ -638,6 -654,9 +638,9 @@@ date_default_timezone_set( $wgLocaltime
  if ( is_null( $wgLocalTZoffset ) ) {
        $wgLocalTZoffset = date( 'Z' ) / 60;
  }
+ // The part after the System| is ignored, but rest of MW fills it
+ // out as the local offset.
+ $wgDefaultUserOptions['timecorrection'] = "System|$wgLocalTZoffset";
  
  if ( !$wgDBerrorLogTZ ) {
        $wgDBerrorLogTZ = $wgLocaltimezone;
@@@ -695,10 -714,12 +698,10 @@@ $wgContLang->initContLang()
  $wgRequest->interpolateTitle();
  
  if ( !is_object( $wgAuth ) ) {
 -      $wgAuth = $wgDisableAuthManager ? new AuthPlugin : new MediaWiki\Auth\AuthManagerAuthPlugin;
 +      $wgAuth = new MediaWiki\Auth\AuthManagerAuthPlugin;
        Hooks::run( 'AuthPluginSetup', [ &$wgAuth ] );
  }
 -if ( !$wgDisableAuthManager &&
 -      $wgAuth && !$wgAuth instanceof MediaWiki\Auth\AuthManagerAuthPlugin
 -) {
 +if ( $wgAuth && !$wgAuth instanceof MediaWiki\Auth\AuthManagerAuthPlugin ) {
        MediaWiki\Auth\AuthManager::singleton()->forcePrimaryAuthenticationProviders( [
                new MediaWiki\Auth\TemporaryPasswordPrimaryAuthenticationProvider( [
                        'authoritative' => false,
@@@ -834,13 -855,17 +837,13 @@@ if ( !defined( 'MW_NO_SESSION' ) && !$w
        $sessionUser = MediaWiki\Session\SessionManager::getGlobalSession()->getUser();
        if ( $sessionUser->getId() === 0 && User::isValidUserName( $sessionUser->getName() ) ) {
                $ps_autocreate = Profiler::instance()->scopedProfileIn( $fname . '-autocreate' );
 -              if ( $wgDisableAuthManager ) {
 -                      $res = MediaWiki\Session\SessionManager::autoCreateUser( $sessionUser );
 -              } else {
 -                      $res = MediaWiki\Auth\AuthManager::singleton()->autoCreateUser(
 -                              $sessionUser,
 -                              MediaWiki\Auth\AuthManager::AUTOCREATE_SOURCE_SESSION,
 -                              true
 -                      );
 -              }
 +              $res = MediaWiki\Auth\AuthManager::singleton()->autoCreateUser(
 +                      $sessionUser,
 +                      MediaWiki\Auth\AuthManager::AUTOCREATE_SOURCE_SESSION,
 +                      true
 +              );
                Profiler::instance()->scopedProfileOut( $ps_autocreate );
 -              \MediaWiki\Logger\LoggerFactory::getInstance( 'authmanager' )->info( 'Autocreation attempt', [
 +              \MediaWiki\Logger\LoggerFactory::getInstance( 'authevents' )->info( 'Autocreation attempt', [
                        'event' => 'autocreate',
                        'status' => $res,
                ] );