Hi,

I'm desperately trying to install CentralAuth for months now and I
almost did it.

I'm running 12 language wikis and one pool wiki.

I renamed all databases from something cryptic like "usr_web123_4" to
"languagecodewiki" via phpMyAdmin.

I created database centralauth and ran centralauth.sql.

I ran php extensions/CentralAuth/maintenance/migratePass0.php and php
extensions/CentralAuth/maintenance/migratePass0.php (from /path/to/w/).

I also ran migrateStewards.php and on the wikis without stewards it gave
me the following output (but I guess that's okay):

"Populating global groups table with stewards...
Fetched 0 from local database... Checking for attached ones
A database query error has occurred.
Query: SELECT  gu_name,gu_id  FROM `globaluser`,`localuser`   WHERE
(gu_name = lu_name) AND lu_wiki = 'cswiki' AND (gu_name IN ())
Function: migrateStewards.php
Error: 1064 You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to use
near '))' at line 1 (1.2.3.4)"

On the wiki with steward it worked fine however:

"Populating global groups table with stewards...
Fetched 1 from local database... Checking for attached ones
Fetched 1 SULed stewards... Adding them in group
Added Till Kraemer"

Special:GlobalUsers now lists all users of all wikis.

I have a user named "Till Kraemer" manually registered on all 13 wikis.
If I go to Special:MergeAccount, I can see that all 13 accounts are
merged into one global account and everything is fine. 13 local wikis
are shown on Special:CentralAuth/Till_Kraemer.

I have a user named "Bot" manually registered on only 4 wikis. I can
only use this account on those 4 wikis. Only 4 local wikis are shown on
Special:MergeAccount and Special:CentralAuth/Bot. If I try to log in
with this account on one of the other 9 wikis, I get an error that the
user "Bot" doesn't exist. However, if I try to manually register the
user "Bot" on one of the 9 other wikis, it gives me the error, that
there is already a global user named "Bot".

I can manually create local user "Bot" on the other wikis via php
CentralAuth/maintenance/createLocalAccount.php, but there should be a
way to do this automatically.

I registered a new account on one of the wikis and that account also can
be only used on one wiki. Although I've set $wgCentralAuthAutoNew =
true; it seems to create just a local account but that isn't entirely
true because that user can be found in table localuser and globaluser of
database centralauth.

Any suggestions would be great, since I really don't know what else I
could try :/

Have a nice weekend!

Thanks and cheers,

Till


Installed software:

MediaWiki 1.22.0
PHP       5.3.14 (apache)
MySQL     5.1.63-log

Entry point URLs:

Article path /wiki/$1
Script path  /w
index.php    /w/index.php
api.php      /w/api.php
load.php     /w/load.php


LocalSettings.php:

require_once ("$IP/extensions/CentralAuth/CentralAuth.php");

$wgConf = new SiteConfiguration;

# Read wiki lists

#$wgLocalDatabases = array( 'meta_wiki', 'test_wiki', 'cod_wiki' );
//all wiki databases, as an array. Important to change.
#$wgLocalDatabases = array( $cs_db_name, $de_db_name, $en_db_name,
$es_db_name, $fr_db_name, $hu_db_name, $pl_db_name, $pool_db_name,
$pt_db_name, $sv_db_name ); //all wiki databases, as array

$wgLocalDatabases = array( 'cswiki', 'dewiki', 'enwiki', 'eswiki',
'frwiki', 'huwiki', 'hywiki', 'nlwiki', 'plwiki', 'poolwiki', 'ptwiki',
'ruwiki', 'svwiki' ); //all wiki databases, as array

$wgConf->wikis = $wgLocalDatabases;
$wgConf->suffixes = array(
        'wiki'
); //We have the same suffix of wiki
//all databases have suffix wiki
$wgConf->suffixes = $wgLocalDatabases;

#$wgConf->localVHosts = array( 'localhost' ); //your database server.
could be example.com or IP address. no http://
#$wgConf->localVHosts = array( $db_host ); //your database server. could
be example.com or IP address. no http://

$wgConf->localVHosts = array( '1.2.3.4' ); //your database server. could
be example.com or IP address. no http://

$wgConf->fullLoadCallback = 'wmfLoadInitialiseSettings';

$wgConf->siteParamsCallback = 'efGetSiteParams';
$wgConf->extractAllGlobals( $wgDBname );

$wgConf->settings = array(

'wgServer' => array(
#    'default' => 'http://localhost', //default means applied to all
wikis.this might be http://www.example.com, for example.

    'cswiki' => 'http://cs.example.com',
     'dewiki' => 'http://de.example.com',
     'enwiki' => 'http://en.example.com',
     'eswiki' => 'http://es.example.com',
     'frwiki' => 'http://fr.example.com',
     'huwiki' => 'http://hu.example.com',
     'hywiki' => 'http://hy.example.com',
     'nlwiki' => 'http://nl.example.com',
     'plwiki' => 'http://pl.example.com',
     'poolwiki' => 'http://pool.example.com',
     'ptwiki' => 'http://pt.example.com',
     'ruwiki' => 'http://ru.example.com',
     'svwiki' => 'http://sv.example.com',
),

'wgScriptPath' => array(
#    'meta_wiki' => '/metawiki', //script path, where index.php is
located for meta
#'test_wiki' => '/testwiki', //test
#'cod_wiki' => '/codwiki', //cod
    'default' => '/w', //script path, where index.php is located for meta
),

'wgArticlePath' => array(
#    'meta_wiki' => '/meta/$1', //for short urls
#'test_wiki' => '/test/$1',
#'cod_wiki' => '/cod/$1',
    'default' => '/wiki/$1', //for short urls
),

//the above may confuse some. if you're having problems, keep
articlepath the same as scriptpath, with /$1 at the end, k???

'wgLanguageCode' => array( //dont change, if all wikis are english *BE
careful not to alter this line if you use RegEx to replace COD with your
wiki name!
#    'default' => '$lang',
    'cswiki' => 'cs',
    'dewiki' => 'de',
    'enwiki' => 'en',
    'eswiki' => 'es',
    'frwiki' => 'fr',
    'huwiki' => 'hu',
    'hywiki' => 'hy',
    'nlwiki' => 'nl',
    'plwiki' => 'pl',
    'poolwiki' => 'en',
    'ptwiki' => 'pt',
    'ruwiki' => 'ru',
    'svwiki' => 'sv',
),

'wgLocalInterwiki' => array(
#    'default' => '$lang',
    'cswiki' => 'cs',
    'dewiki' => 'de',
    'enwiki' => 'en',
    'eswiki' => 'es',
    'frwiki' => 'fr',
    'huwiki' => 'hu',
    'hywiki' => 'hy',
    'nlwiki' => 'nl',
    'plwiki' => 'pl',
    'poolwiki' => 'en',
    'ptwiki' => 'pt',
    'ruwiki' => 'ru',
    'svwiki' => 'sv',
),

'wgSitename'=>array(
    'cswiki' => 'Example Wiki',
    'dewiki' => 'Example Wiki',
    'enwiki' => 'Example Wiki',
    'eswiki' => 'Example Wiki',
    'frwiki' => 'Example Wiki',
    'huwiki' => 'Example Wiki',
    'hywiki' => 'Example Wiki',
    'nlwiki' => 'Example Wiki',
    'plwiki' => 'Example Wiki',
    'poolwiki' => 'Example Wiki',
    'ptwiki' => 'Example Wiki',
    'ruwiki' => 'Example Wiki',
    'svwiki' => 'Example Wiki',
),
);

function efGetSiteParams( $conf, $wiki ) {
    $site = null;
    $lang = null;
    foreach( $conf->suffixes as $suffix ) {
        if ( substr( $wiki, -strlen( $suffix ) ) == $suffix ) {
            $site = $suffix;
            $lang = substr( $wiki, 0, -strlen( $suffix ) );
            break;
        }
    }
    return array(
        'suffix' => $site,
        'lang' => $lang,
        'params' => array(
            'lang' => $lang,
            'site' => $site,
            'wiki' => $wiki,
        ),
        'tags' => array(),
    );
}

$wgCentralAuthDryRun = false;
$wgCentralAuthCookies = true;
$wgCentralAuthAutoNew = true;
$wgCentralAuthAutoMigrate = true;
$wgCentralAuthAutoLoginWikis = array(
    # Mapping from domain name to wiki id for other wikis to
automatically login into
        'cs.example.com' => 'cswiki',
        'de.example.com' => 'dewiki',
        'en.example.com' => 'enwiki',
        'es.example.com' => 'eswiki',
        'fr.example.com' => 'frwiki',
        'hu.example.com' => 'huwiki',
        'hy.example.com' => 'hywiki',
        'nl.example.com' => 'nlwiki',
        'pl.example.com' => 'plwiki',
        'pool.example.com' => 'poolwiki',
        'pt.example.com' => 'ptwiki',
        'ru.example.com' => 'ruwiki',
        'sv.example.com' => 'svwiki',
);
# Skips the "login success" page
$wgCentralAuthSilentLogin = true;
$wgCentralAuthCreateOnView = true;
# Activates the redirect to the "central login wiki"
#$wgCentralAuthLoginWiki = 'poolwiki';

_______________________________________________
MediaWiki-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l

Reply via email to