CentralAuth

From Freephile Wiki
Revision as of 19:35, 22 November 2017 by Freephile (talk | contribs) (Created page with "<source lang="php"> wfLoadExtension( "CentralAuth" ); /////////////////////////////////// # General CentralAuth configuration /////////////////////////////////// $wgJobRunRat...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
wfLoadExtension( "CentralAuth" );
///////////////////////////////////
# General CentralAuth configuration
///////////////////////////////////

$wgJobRunRate = 0;

// All the permissions relative to this extension
unset( $wgGroupPermissions['*']['centralauth-merge'] );
$wgGroupPermissions['sysop']['centralauth-merge'] = true;
$wgGroupPermissions['sysop']['centralauth-unmerge'] = true;
$wgGroupPermissions['sysop']['centralauth-lock'] = true;
$wgGroupPermissions['sysop']['centralauth-oversight'] = true;
$wgGroupPermissions['sysop']['globalgrouppermissions'] = true;
$wgGroupPermissions['sysop']['globalgroupmembership'] = true;
$wgGroupPermissions['sysop']['centralauth-rename'] = true;
$wgGroupPermissions['sysop']['centralauth-usermerge'] = true;


// If true, global session and token cookies will be set alongside the per-wiki session and login tokens when users log in with a global account.
// This allows other wikis on the same domain to transparently log them in.
$wgCentralAuthCookies = true;
$wgCentralAuthDatabase = 'centralauth';

// If true, existing unattached accounts will be automatically migrated if possible at first login.
// Any new account creations will be required to attach.
// If false, unattached accounts will not be harassed unless the individual account has opted in to migration.
$wgCentralAuthAutoMigrate = true;

// If true, existing unattached accounts where no global account exists will be compared to see if a merge can be made based on passwords and emails with no clashes (all accounts merge).
$wgCentralAuthAutoMigrateNonGlobalAccounts = true;

$wgCentralAuthCookieDomain = '.esportspedia.com';

// Mapping from domain name to wiki id for other wikis to automatically login into
// Do we need 'wiki_login' here?  What is meant by 'other'?
$wgCentralAuthAutoLoginWikis = array (
        'https://staging.base.esportspedia.com' => 'wiki_base',
        'https://staging.cod.esportspedia.com' => 'wiki_cod',
        'https://staging.collegiate.esportspedia.com' => 'wiki_collegiate',
        'https://staging.demo.esportspedia.com' => 'wiki_demo',
        'https://staging.halo.esportspedia.com' => 'wiki_halo',
//        'https://staging.login.esportspedia.com' => 'wiki_login',
        'https://staging.lol.esportspedia.com' => 'wiki_lol',
        'https://staging.smite.esportspedia.com' => 'wiki_smite'
);

// Create the local account on pageview, set false to require a local login to create it.
$wgCentralAuthCreateOnView = true;

// Don't autologin to this wiki
if( ( $key = array_search( $wgDBname, $wgCentralAuthAutoLoginWikis ) ) !== false ) {
//    unset( $wgCentralAuthAutoLoginWikis[$key] );
}
// Activates the redirect to the "central login wiki"
$wgCentralAuthLoginWiki = 'wiki_login';
# Skips the "login success" page
### $wgCentralAuthSilentLogin = true;
$wgCentralAuthDryRun = false;
$wgConf = new SiteConfiguration;
# Read wiki lists
$wgLocalDatabases = array( 'wiki_base', 'wiki_cod', 'wiki_collegiate', 'wiki_demo', 'wiki_halo', 'wiki_login', 'wiki_lol', 'wiki_smite' );
## $wgLocalDatabases = array( 'wiki_base', 'wiki_cod', 'wiki_collegiate', 'wiki_demo', 'wiki_halo', 'wiki_lol', 'wiki_smite' );
$wgConf->wikis = $wgLocalDatabases;
//$wgConf->suffixes = array( '_wiki' );

$wgConf->settings = array(
    'wgServer' => array(
        'default'    => ( PHP_SAPI == 'cli' )? 'localhost' : '//' . $_SERVER['HTTP_HOST'],
        'wiki_base'       => 'https://staging.base.esportspedia.com',
        'wiki_cod'        => 'https://staging.cod.esportspedia.com',
        'wiki_collegiate' => 'https://staging.collegiate.esportspedia.com',
        'wiki_demo'       => 'https://staging.demo.esportspedia.com',
        'wiki_halo'       => 'https://staging.halo.esportspedia.com',
        'wiki_login'      => 'https://staging.login.esportspedia.com',
        'wiki_lol'        => 'https://staging.lol.esportspedia.com',
        'wiki_smite'      => 'https://staging.smite.esportspedia.com'
    ),
    'wgCanonicalServer' => array(
        'default'    => "$wgServer",
        'wiki_base'       => 'https://staging.base.esportspedia.com',
        'wiki_cod'        => 'https://staging.cod.esportspedia.com',
        'wiki_collegiate' => 'https://staging.collegiate.esportspedia.com',
        'wiki_demo'       => 'https://staging.demo.esportspedia.com',
        'wiki_halo'       => 'https://staging.halo.esportspedia.com',
        'wiki_login'      => 'https://staging.login.esportspedia.com',
        'wiki_lol'        => 'https://staging.lol.esportspedia.com',
        'wiki_smite'      => 'https://staging.smite.esportspedia.com'
    ),
    'wgArticlePath' => array(
        'default'   => '/wiki/$1'
    )

);

$wgConf->extractAllGlobals( $wgDBname );