Go to the documentation of this file.
28 use Psr\Log\LoggerAwareInterface;
29 use Psr\Log\LoggerInterface;
147 if ( self::$instance ===
null ) {
148 self::$instance =
new self(
187 $this->logger->warning(
"Overriding AuthManager primary authn because $why" );
189 if ( $this->primaryAuthenticationProviders !==
null ) {
190 $this->logger->warning(
191 'PrimaryAuthenticationProviders have already been accessed! I hope nothing breaks.'
194 $this->allAuthenticationProviders = array_diff_key(
195 $this->allAuthenticationProviders,
196 $this->primaryAuthenticationProviders
198 $session = $this->
request->getSession();
199 $session->remove(
'AuthManager::authnState' );
200 $session->remove(
'AuthManager::accountCreationState' );
201 $session->remove(
'AuthManager::accountLinkState' );
202 $this->createdAccountAuthenticationRequests = [];
205 $this->primaryAuthenticationProviders = [];
206 foreach ( $providers
as $provider ) {
208 throw new \RuntimeException(
209 'Expected instance of MediaWiki\\Auth\\PrimaryAuthenticationProvider, got ' .
210 get_class( $provider )
213 $provider->setLogger( $this->logger );
214 $provider->setManager( $this );
215 $provider->setConfig( $this->config );
216 $id = $provider->getUniqueId();
217 if ( isset( $this->allAuthenticationProviders[$id] ) ) {
218 throw new \RuntimeException(
219 "Duplicate specifications for id $id (classes " .
220 get_class( $provider ) .
' and ' .
221 get_class( $this->allAuthenticationProviders[$id] ) .
')'
224 $this->allAuthenticationProviders[$id] = $provider;
225 $this->primaryAuthenticationProviders[$id] = $provider;
262 return $this->
request->getSession()->canSetUser();
284 $session = $this->
request->getSession();
285 if ( !$session->canSetUser() ) {
287 $session->remove(
'AuthManager::authnState' );
288 throw new \LogicException(
'Authentication is not possible now' );
291 $guessUserName =
null;
292 foreach ( $reqs
as $req ) {
293 $req->returnToUrl = $returnToUrl;
295 if (
$req->username !==
null &&
$req->username !==
'' ) {
296 if ( $guessUserName ===
null ) {
297 $guessUserName =
$req->username;
298 } elseif ( $guessUserName !==
$req->username ) {
299 $guessUserName =
null;
311 if ( !in_array(
$req, $this->createdAccountAuthenticationRequests,
true ) ) {
312 throw new \LogicException(
313 'CreatedAccountAuthenticationRequests are only valid on ' .
314 'the same AuthManager that created the account'
321 throw new \UnexpectedValueException(
322 "CreatedAccountAuthenticationRequest had invalid username \"{$req->username}\""
324 } elseif (
$user->getId() !=
$req->id ) {
325 throw new \UnexpectedValueException(
326 "ID for \"{$req->username}\" was {$user->getId()}, expected {$req->id}"
331 $this->logger->info(
'Logging in {user} after account creation', [
332 'user' =>
$user->getName(),
337 $session->remove(
'AuthManager::authnState' );
345 $status = $provider->testForAuthentication( $reqs );
347 $this->logger->debug(
'Login failed in pre-authentication by ' . $provider->getUniqueId() );
354 \Hooks::run(
'AuthManagerLoginAuthenticateAudit', [
$ret,
null, $guessUserName ] );
361 'returnToUrl' => $returnToUrl,
362 'guessUserName' => $guessUserName,
364 'primaryResponse' =>
null,
367 'continueRequests' => [],
375 $state[
'maybeLink'] =
$req->maybeLink;
378 $session = $this->
request->getSession();
379 $session->setSecret(
'AuthManager::authnState', $state );
408 $session = $this->
request->getSession();
410 if ( !$session->canSetUser() ) {
413 throw new \LogicException(
'Authentication is not possible now' );
417 $state = $session->getSecret(
'AuthManager::authnState' );
418 if ( !is_array( $state ) ) {
420 wfMessage(
'authmanager-authn-not-in-progress' )
423 $state[
'continueRequests'] = [];
425 $guessUserName = $state[
'guessUserName'];
427 foreach ( $reqs
as $req ) {
428 $req->returnToUrl = $state[
'returnToUrl'];
433 if ( $state[
'primary'] ===
null ) {
436 $guessUserName =
null;
437 foreach ( $reqs
as $req ) {
438 if (
$req->username !==
null &&
$req->username !==
'' ) {
439 if ( $guessUserName ===
null ) {
440 $guessUserName =
$req->username;
441 } elseif ( $guessUserName !==
$req->username ) {
442 $guessUserName =
null;
447 $state[
'guessUserName'] = $guessUserName;
449 $state[
'reqs'] = $reqs;
452 $res = $provider->beginPrimaryAuthentication( $reqs );
453 switch (
$res->status ) {
455 $state[
'primary'] = $id;
456 $state[
'primaryResponse'] =
$res;
457 $this->logger->debug(
"Primary login with $id succeeded" );
460 $this->logger->debug(
"Login failed in primary authentication by $id" );
461 if (
$res->createRequest || $state[
'maybeLink'] ) {
463 $res->createRequest, $state[
'maybeLink']
469 $session->remove(
'AuthManager::authnState' );
470 \Hooks::run(
'AuthManagerLoginAuthenticateAudit', [
$res,
null, $guessUserName ] );
477 $this->logger->debug(
"Primary login with $id returned $res->status" );
478 $this->
fillRequests(
$res->neededRequests, self::ACTION_LOGIN, $guessUserName );
479 $state[
'primary'] = $id;
480 $state[
'continueRequests'] =
$res->neededRequests;
481 $session->setSecret(
'AuthManager::authnState', $state );
486 throw new \DomainException(
487 get_class( $provider ) .
"::beginPrimaryAuthentication() returned $res->status"
492 if ( $state[
'primary'] ===
null ) {
493 $this->logger->debug(
'Login failed in primary authentication because no provider accepted' );
495 wfMessage(
'authmanager-authn-no-primary' )
500 $session->remove(
'AuthManager::authnState' );
503 } elseif ( $state[
'primaryResponse'] ===
null ) {
509 wfMessage(
'authmanager-authn-not-in-progress' )
514 $session->remove(
'AuthManager::authnState' );
518 $id = $provider->getUniqueId();
519 $res = $provider->continuePrimaryAuthentication( $reqs );
520 switch (
$res->status ) {
522 $state[
'primaryResponse'] =
$res;
523 $this->logger->debug(
"Primary login with $id succeeded" );
526 $this->logger->debug(
"Login failed in primary authentication by $id" );
527 if (
$res->createRequest || $state[
'maybeLink'] ) {
529 $res->createRequest, $state[
'maybeLink']
535 $session->remove(
'AuthManager::authnState' );
536 \Hooks::run(
'AuthManagerLoginAuthenticateAudit', [
$res,
null, $guessUserName ] );
540 $this->logger->debug(
"Primary login with $id returned $res->status" );
541 $this->
fillRequests(
$res->neededRequests, self::ACTION_LOGIN, $guessUserName );
542 $state[
'continueRequests'] =
$res->neededRequests;
543 $session->setSecret(
'AuthManager::authnState', $state );
546 throw new \DomainException(
547 get_class( $provider ) .
"::continuePrimaryAuthentication() returned $res->status"
552 $res = $state[
'primaryResponse'];
553 if (
$res->username ===
null ) {
559 wfMessage(
'authmanager-authn-not-in-progress' )
564 $session->remove(
'AuthManager::authnState' );
574 $state[
'maybeLink'][
$res->linkRequest->getUniqueId()] =
$res->linkRequest;
575 $msg =
'authmanager-authn-no-local-user-link';
577 $msg =
'authmanager-authn-no-local-user';
579 $this->logger->debug(
580 "Primary login with {$provider->getUniqueId()} succeeded, but returned no user"
588 if (
$res->createRequest || $state[
'maybeLink'] ) {
590 $res->createRequest, $state[
'maybeLink']
592 $ret->neededRequests[] =
$ret->createRequest;
594 $this->
fillRequests(
$ret->neededRequests, self::ACTION_LOGIN,
null,
true );
595 $session->setSecret(
'AuthManager::authnState', [
598 'primaryResponse' =>
null,
600 'continueRequests' =>
$ret->neededRequests,
611 throw new \DomainException(
612 get_class( $provider ) .
" returned an invalid username: {$res->username}"
615 if (
$user->getId() === 0 ) {
617 $this->logger->info(
'Auto-creating {user} on login', [
618 'user' =>
$user->getName(),
626 $session->remove(
'AuthManager::authnState' );
634 $beginReqs = $state[
'reqs'];
637 if ( !isset( $state[
'secondary'][$id] ) ) {
641 $func =
'beginSecondaryAuthentication';
642 $res = $provider->beginSecondaryAuthentication(
$user, $beginReqs );
643 } elseif ( !$state[
'secondary'][$id] ) {
644 $func =
'continueSecondaryAuthentication';
645 $res = $provider->continueSecondaryAuthentication(
$user, $reqs );
649 switch (
$res->status ) {
651 $this->logger->debug(
"Secondary login with $id succeeded" );
654 $state[
'secondary'][$id] =
true;
657 $this->logger->debug(
"Login failed in secondary authentication by $id" );
659 $session->remove(
'AuthManager::authnState' );
664 $this->logger->debug(
"Secondary login with $id returned " .
$res->status );
665 $this->
fillRequests( $res->neededRequests, self::ACTION_LOGIN,
$user->getName() );
666 $state[
'secondary'][$id] =
false;
667 $state[
'continueRequests'] =
$res->neededRequests;
668 $session->setSecret(
'AuthManager::authnState', $state );
673 throw new \DomainException(
674 get_class( $provider ) .
"::{$func}() returned $res->status"
683 $this->logger->info(
'Login for {user} succeeded from {clientip}', [
684 'user' =>
$user->getName(),
685 'clientip' => $this->
request->getIP(),
694 $session->remove(
'AuthManager::authnState' );
698 }
catch ( \Exception $ex ) {
699 $session->remove(
'AuthManager::authnState' );
718 $this->logger->debug( __METHOD__ .
": Checking $operation" );
720 $session = $this->
request->getSession();
721 $aId = $session->getUser()->getId();
725 $this->logger->info( __METHOD__ .
": Not logged in! $operation is $status" );
729 if ( $session->canSetUser() ) {
730 $id = $session->get(
'AuthManager:lastAuthId' );
731 $last = $session->get(
'AuthManager:lastAuthTimestamp' );
732 if ( $id !== $aId ||
$last ===
null ) {
733 $timeSinceLogin = PHP_INT_MAX;
735 $timeSinceLogin = max( 0, time() -
$last );
738 $thresholds = $this->config->get(
'ReauthenticateTime' );
739 if ( isset( $thresholds[$operation] ) ) {
740 $threshold = $thresholds[$operation];
741 } elseif ( isset( $thresholds[
'default'] ) ) {
742 $threshold = $thresholds[
'default'];
744 throw new \UnexpectedValueException(
'$wgReauthenticateTime lacks a default' );
747 if ( $threshold >= 0 && $timeSinceLogin > $threshold ) {
751 $timeSinceLogin = -1;
753 $pass = $this->config->get(
'AllowSecuritySensitiveOperationIfCannotReauthenticate' );
754 if ( isset( $pass[$operation] ) ) {
756 } elseif ( isset( $pass[
'default'] ) ) {
759 throw new \UnexpectedValueException(
760 '$wgAllowSecuritySensitiveOperationIfCannotReauthenticate lacks a default'
766 &
$status, $operation, $session, $timeSinceLogin
774 $this->logger->info( __METHOD__ .
": $operation is $status" );
790 if ( $provider->testUserCanAuthenticate(
$username ) ) {
814 $normalized = $provider->providerNormalizeUsername(
$username );
815 if ( $normalized !==
null ) {
816 $ret[$normalized] =
true;
819 return array_keys(
$ret );
837 $this->logger->info(
'Revoking access for {user}', [
856 foreach ( $providers
as $provider ) {
857 $status = $provider->providerAllowsAuthenticationDataChange(
$req, $checkData );
861 $any = $any ||
$status->value !==
'ignored';
865 $status->warning(
'authmanager-change-not-supported' );
886 $this->logger->info(
'Changing authentication data for {user} class {what}', [
887 'user' => is_string(
$req->username ) ?
$req->username :
'<no name>',
888 'what' => get_class(
$req ),
911 switch ( $provider->accountCreationType() ) {
934 'flags' => User::READ_NORMAL,
948 if ( !is_object(
$user ) ) {
952 if (
$user->getId() !== 0 ) {
961 foreach ( $providers
as $provider ) {
984 ->getUserPermissionsErrors(
'createaccount', $creator,
'secure' );
987 foreach ( $permErrors
as $args ) {
997 $block->mReason ?:
wfMessage(
'blockednoreason' )->text(),
1002 $errorMessage =
'cantcreateaccount-range-text';
1003 $errorParams[] = $this->
getRequest()->getIP();
1005 $errorMessage =
'cantcreateaccount-text';
1039 $session = $this->
request->getSession();
1042 $session->remove(
'AuthManager::accountCreationState' );
1043 throw new \LogicException(
'Account creation is not possible' );
1048 }
catch ( \UnexpectedValueException $ex ) {
1052 $this->logger->debug( __METHOD__ .
': No username provided' );
1059 $this->logger->debug( __METHOD__ .
': {creator} cannot create users: {reason}', [
1061 'creator' => $creator->
getName(),
1062 'reason' =>
$status->getWikiText(
null,
null,
'en' )
1071 $this->logger->debug( __METHOD__ .
': {user} cannot be created: {reason}', [
1073 'creator' => $creator->
getName(),
1074 'reason' =>
$status->getWikiText(
null,
null,
'en' )
1080 foreach ( $reqs
as $req ) {
1082 $req->returnToUrl = $returnToUrl;
1087 $session->remove(
'AuthManager::accountCreationState' );
1088 $this->logger->debug( __METHOD__ .
': UserData is invalid: {reason}', [
1089 'user' =>
$user->getName(),
1090 'creator' => $creator->
getName(),
1091 'reason' =>
$status->getWikiText(
null,
null,
'en' ),
1103 'creatorid' => $creator->
getId(),
1104 'creatorname' => $creator->
getName(),
1106 'returnToUrl' => $returnToUrl,
1108 'primaryResponse' =>
null,
1110 'continueRequests' => [],
1112 'ranPreTests' =>
false,
1120 $state[
'maybeLink'] =
$req->maybeLink;
1122 if (
$req->createRequest ) {
1123 $reqs[] =
$req->createRequest;
1124 $state[
'reqs'][] =
$req->createRequest;
1128 $session->setSecret(
'AuthManager::accountCreationState', $state );
1129 $session->persist();
1140 $session = $this->
request->getSession();
1144 $session->remove(
'AuthManager::accountCreationState' );
1145 throw new \LogicException(
'Account creation is not possible' );
1148 $state = $session->getSecret(
'AuthManager::accountCreationState' );
1149 if ( !is_array( $state ) ) {
1151 wfMessage(
'authmanager-create-not-in-progress' )
1154 $state[
'continueRequests'] = [];
1159 if ( !is_object(
$user ) ) {
1160 $session->remove(
'AuthManager::accountCreationState' );
1161 $this->logger->debug( __METHOD__ .
': Invalid username', [
1162 'user' => $state[
'username'],
1167 if ( $state[
'creatorid'] ) {
1170 $creator =
new User;
1171 $creator->setName( $state[
'creatorname'] );
1176 $lock =
$cache->getScopedLock(
$cache->makeGlobalKey(
'account', md5(
$user->getName() ) ) );
1180 $this->logger->debug( __METHOD__ .
': Could not acquire account creation lock', [
1181 'user' =>
$user->getName(),
1182 'creator' => $creator->getName(),
1190 $this->logger->debug( __METHOD__ .
': {creator} cannot create users: {reason}', [
1191 'user' =>
$user->getName(),
1192 'creator' => $creator->getName(),
1193 'reason' =>
$status->getWikiText(
null,
null,
'en' )
1197 $session->remove(
'AuthManager::accountCreationState' );
1204 if ( $state[
'userid'] === 0 ) {
1205 if (
$user->getId() != 0 ) {
1206 $this->logger->debug( __METHOD__ .
': User exists locally', [
1207 'user' =>
$user->getName(),
1208 'creator' => $creator->getName(),
1212 $session->remove(
'AuthManager::accountCreationState' );
1216 if (
$user->getId() == 0 ) {
1217 $this->logger->debug( __METHOD__ .
': User does not exist locally when it should', [
1218 'user' =>
$user->getName(),
1219 'creator' => $creator->getName(),
1220 'expected_id' => $state[
'userid'],
1222 throw new \UnexpectedValueException(
1223 "User \"{$state['username']}\" should exist now, but doesn't!"
1226 if (
$user->getId() != $state[
'userid'] ) {
1227 $this->logger->debug( __METHOD__ .
': User ID/name mismatch', [
1228 'user' =>
$user->getName(),
1229 'creator' => $creator->getName(),
1230 'expected_id' => $state[
'userid'],
1231 'actual_id' =>
$user->getId(),
1233 throw new \UnexpectedValueException(
1234 "User \"{$state['username']}\" exists, but " .
1235 "ID {$user->getId()} != {$state['userid']}!"
1239 foreach ( $state[
'reqs']
as $req ) {
1245 $this->logger->debug( __METHOD__ .
': UserData is invalid: {reason}', [
1246 'user' =>
$user->getName(),
1247 'creator' => $creator->getName(),
1248 'reason' =>
$status->getWikiText(
null,
null,
'en' ),
1252 $session->remove(
'AuthManager::accountCreationState' );
1258 foreach ( $reqs
as $req ) {
1259 $req->returnToUrl = $state[
'returnToUrl'];
1260 $req->username = $state[
'username'];
1264 if ( !$state[
'ranPreTests'] ) {
1268 foreach ( $providers
as $id => $provider ) {
1269 $status = $provider->testForAccountCreation(
$user, $creator, $reqs );
1271 $this->logger->debug( __METHOD__ .
": Fail in pre-authentication by $id", [
1272 'user' =>
$user->getName(),
1273 'creator' => $creator->getName(),
1279 $session->remove(
'AuthManager::accountCreationState' );
1284 $state[
'ranPreTests'] =
true;
1289 if ( $state[
'primary'] ===
null ) {
1295 $res = $provider->beginPrimaryAccountCreation(
$user, $creator, $reqs );
1296 switch (
$res->status ) {
1298 $this->logger->debug( __METHOD__ .
": Primary creation passed by $id", [
1299 'user' =>
$user->getName(),
1300 'creator' => $creator->getName(),
1302 $state[
'primary'] = $id;
1303 $state[
'primaryResponse'] =
$res;
1306 $this->logger->debug( __METHOD__ .
": Primary creation failed by $id", [
1307 'user' =>
$user->getName(),
1308 'creator' => $creator->getName(),
1311 $session->remove(
'AuthManager::accountCreationState' );
1318 $this->logger->debug( __METHOD__ .
": Primary creation $res->status by $id", [
1319 'user' =>
$user->getName(),
1320 'creator' => $creator->getName(),
1323 $state[
'primary'] = $id;
1324 $state[
'continueRequests'] =
$res->neededRequests;
1325 $session->setSecret(
'AuthManager::accountCreationState', $state );
1330 throw new \DomainException(
1331 get_class( $provider ) .
"::beginPrimaryAccountCreation() returned $res->status"
1336 if ( $state[
'primary'] ===
null ) {
1337 $this->logger->debug( __METHOD__ .
': Primary creation failed because no provider accepted', [
1338 'user' =>
$user->getName(),
1339 'creator' => $creator->getName(),
1342 wfMessage(
'authmanager-create-no-primary' )
1345 $session->remove(
'AuthManager::accountCreationState' );
1348 } elseif ( $state[
'primaryResponse'] ===
null ) {
1354 wfMessage(
'authmanager-create-not-in-progress' )
1357 $session->remove(
'AuthManager::accountCreationState' );
1361 $id = $provider->getUniqueId();
1362 $res = $provider->continuePrimaryAccountCreation(
$user, $creator, $reqs );
1363 switch (
$res->status ) {
1365 $this->logger->debug( __METHOD__ .
": Primary creation passed by $id", [
1366 'user' =>
$user->getName(),
1367 'creator' => $creator->getName(),
1369 $state[
'primaryResponse'] =
$res;
1372 $this->logger->debug( __METHOD__ .
": Primary creation failed by $id", [
1373 'user' =>
$user->getName(),
1374 'creator' => $creator->getName(),
1377 $session->remove(
'AuthManager::accountCreationState' );
1381 $this->logger->debug( __METHOD__ .
": Primary creation $res->status by $id", [
1382 'user' =>
$user->getName(),
1383 'creator' => $creator->getName(),
1386 $state[
'continueRequests'] =
$res->neededRequests;
1387 $session->setSecret(
'AuthManager::accountCreationState', $state );
1390 throw new \DomainException(
1391 get_class( $provider ) .
"::continuePrimaryAccountCreation() returned $res->status"
1399 if ( $state[
'userid'] === 0 ) {
1400 $this->logger->info(
'Creating user {user} during account creation', [
1401 'user' =>
$user->getName(),
1402 'creator' => $creator->getName(),
1409 $session->remove(
'AuthManager::accountCreationState' );
1415 $user->saveSettings();
1416 $state[
'userid'] =
$user->getId();
1425 $logSubtype = $provider->finishAccountCreation(
$user, $creator, $state[
'primaryResponse'] );
1428 if ( $this->config->get(
'NewUserLog' ) ) {
1429 $isAnon = $creator->isAnon();
1430 $logEntry = new \ManualLogEntry(
1432 $logSubtype ?: ( $isAnon ?
'create' :
'create2' )
1434 $logEntry->setPerformer( $isAnon ?
$user : $creator );
1435 $logEntry->setTarget(
$user->getUserPage() );
1440 $logEntry->setComment(
$req ?
$req->reason :
'' );
1441 $logEntry->setParameters( [
1442 '4::userid' =>
$user->getId(),
1444 $logid = $logEntry->insert();
1445 $logEntry->publish( $logid );
1451 $beginReqs = $state[
'reqs'];
1454 if ( !isset( $state[
'secondary'][$id] ) ) {
1458 $func =
'beginSecondaryAccountCreation';
1459 $res = $provider->beginSecondaryAccountCreation(
$user, $creator, $beginReqs );
1460 } elseif ( !$state[
'secondary'][$id] ) {
1461 $func =
'continueSecondaryAccountCreation';
1462 $res = $provider->continueSecondaryAccountCreation(
$user, $creator, $reqs );
1466 switch (
$res->status ) {
1468 $this->logger->debug( __METHOD__ .
": Secondary creation passed by $id", [
1469 'user' =>
$user->getName(),
1470 'creator' => $creator->getName(),
1474 $state[
'secondary'][$id] =
true;
1478 $this->logger->debug( __METHOD__ .
": Secondary creation $res->status by $id", [
1479 'user' =>
$user->getName(),
1480 'creator' => $creator->getName(),
1483 $state[
'secondary'][$id] =
false;
1484 $state[
'continueRequests'] =
$res->neededRequests;
1485 $session->setSecret(
'AuthManager::accountCreationState', $state );
1488 throw new \DomainException(
1489 get_class( $provider ) .
"::{$func}() returned $res->status." .
1490 ' Secondary providers are not allowed to fail account creation, that' .
1491 ' should have been done via testForAccountCreation().'
1495 throw new \DomainException(
1496 get_class( $provider ) .
"::{$func}() returned $res->status"
1502 $id =
$user->getId();
1507 $this->createdAccountAuthenticationRequests[] =
$req;
1509 $this->logger->info( __METHOD__ .
': Account creation succeeded for {user}', [
1510 'user' =>
$user->getName(),
1511 'creator' => $creator->getName(),
1515 $session->remove(
'AuthManager::accountCreationState' );
1518 }
catch ( \Exception $ex ) {
1519 $session->remove(
'AuthManager::accountCreationState' );
1540 if (
$source !== self::AUTOCREATE_SOURCE_SESSION &&
1543 throw new \InvalidArgumentException(
"Unknown auto-creation source: $source" );
1550 $flags = User::READ_NORMAL;
1555 if ( !$localId &&
wfGetLB()->getReaderIndex() != 0 ) {
1557 $flags = User::READ_LATEST;
1562 $this->logger->debug( __METHOD__ .
': {username} already exists locally', [
1565 $user->setId( $localId );
1571 $status->warning(
'userexists' );
1577 $this->logger->debug( __METHOD__ .
': denied by wfReadOnly(): {reason}', [
1582 $user->loadFromId();
1588 $session = $this->
request->getSession();
1589 if ( $session->get(
'AuthManager::AutoCreateBlacklist' ) ) {
1590 $this->logger->debug( __METHOD__ .
': blacklisted in session {sessionid}', [
1592 'sessionid' => $session->getId(),
1595 $user->loadFromId();
1596 $reason = $session->get(
'AuthManager::AutoCreateBlacklist' );
1606 $this->logger->debug( __METHOD__ .
': name "{username}" is not creatable', [
1609 $session->set(
'AuthManager::AutoCreateBlacklist',
'noname' );
1611 $user->loadFromId();
1617 if ( !$anon->isAllowedAny(
'createaccount',
'autocreateaccount' ) ) {
1618 $this->logger->debug( __METHOD__ .
': IP lacks the ability to create or autocreate accounts', [
1620 'ip' => $anon->getName(),
1622 $session->set(
'AuthManager::AutoCreateBlacklist',
'authmanager-autocreate-noperm' );
1623 $session->persist();
1625 $user->loadFromId();
1633 $this->logger->debug( __METHOD__ .
': Could not acquire account creation lock', [
1637 $user->loadFromId();
1643 'flags' => User::READ_LATEST,
1649 foreach ( $providers
as $provider ) {
1653 $this->logger->debug( __METHOD__ .
': Provider denied creation of {username}: {reason}', [
1655 'reason' =>
$ret->getWikiText(
null,
null,
'en' ),
1657 $session->set(
'AuthManager::AutoCreateBlacklist',
$status );
1659 $user->loadFromId();
1664 $backoffKey =
$cache->makeKey(
'AuthManager',
'autocreate-failed', md5(
$username ) );
1665 if (
$cache->get( $backoffKey ) ) {
1666 $this->logger->debug( __METHOD__ .
': {username} denied by prior creation attempt failures', [
1670 $user->loadFromId();
1675 $from = isset( $_SERVER[
'REQUEST_URI'] ) ? $_SERVER[
'REQUEST_URI'] :
'CLI';
1676 $this->logger->info( __METHOD__ .
': creating new user ({username}) - from: {from}', [
1683 $old = $trxProfiler->setSilenced(
true );
1689 if (
$user->getId() ) {
1690 $this->logger->info( __METHOD__ .
': {username} already exists locally (race)', [
1697 $status->warning(
'userexists' );
1699 $this->logger->error( __METHOD__ .
': {username} failed with message {msg}', [
1701 'msg' =>
$status->getWikiText(
null,
null,
'en' )
1704 $user->loadFromId();
1708 }
catch ( \Exception $ex ) {
1709 $trxProfiler->setSilenced( $old );
1710 $this->logger->error( __METHOD__ .
': {username} failed with exception {exception}', [
1715 $cache->set( $backoffKey, 1, 600 );
1727 $user->saveSettings();
1737 if ( $this->config->get(
'NewUserLog' ) ) {
1738 $logEntry = new \ManualLogEntry(
'newusers',
'autocreate' );
1739 $logEntry->setPerformer(
$user );
1740 $logEntry->setTarget(
$user->getUserPage() );
1741 $logEntry->setComment(
'' );
1742 $logEntry->setParameters( [
1743 '4::userid' =>
$user->getId(),
1745 $logEntry->insert();
1748 $trxProfiler->setSilenced( $old );
1787 $session = $this->
request->getSession();
1788 $session->remove(
'AuthManager::accountLinkState' );
1792 throw new \LogicException(
'Account linking is not possible' );
1795 if (
$user->getId() === 0 ) {
1799 $msg =
wfMessage(
'authmanager-userdoesnotexist',
$user->getName() );
1803 foreach ( $reqs
as $req ) {
1805 $req->returnToUrl = $returnToUrl;
1811 foreach ( $providers
as $id => $provider ) {
1814 $this->logger->debug( __METHOD__ .
": Account linking pre-check failed by $id", [
1815 'user' =>
$user->getName(),
1826 'username' =>
$user->getName(),
1827 'userid' =>
$user->getId(),
1828 'returnToUrl' => $returnToUrl,
1830 'continueRequests' => [],
1834 foreach ( $providers
as $id => $provider ) {
1839 $res = $provider->beginPrimaryAccountLink(
$user, $reqs );
1840 switch (
$res->status ) {
1842 $this->logger->info(
"Account linked to {user} by $id", [
1843 'user' =>
$user->getName(),
1849 $this->logger->debug( __METHOD__ .
": Account linking failed by $id", [
1850 'user' =>
$user->getName(),
1861 $this->logger->debug( __METHOD__ .
": Account linking $res->status by $id", [
1862 'user' =>
$user->getName(),
1865 $state[
'primary'] = $id;
1866 $state[
'continueRequests'] =
$res->neededRequests;
1867 $session->setSecret(
'AuthManager::accountLinkState', $state );
1868 $session->persist();
1873 throw new \DomainException(
1874 get_class( $provider ) .
"::beginPrimaryAccountLink() returned $res->status"
1880 $this->logger->debug( __METHOD__ .
': Account linking failed because no provider accepted', [
1881 'user' =>
$user->getName(),
1884 wfMessage(
'authmanager-link-no-primary' )
1896 $session = $this->
request->getSession();
1900 $session->remove(
'AuthManager::accountLinkState' );
1901 throw new \LogicException(
'Account linking is not possible' );
1904 $state = $session->getSecret(
'AuthManager::accountLinkState' );
1905 if ( !is_array( $state ) ) {
1907 wfMessage(
'authmanager-link-not-in-progress' )
1910 $state[
'continueRequests'] = [];
1915 if ( !is_object(
$user ) ) {
1916 $session->remove(
'AuthManager::accountLinkState' );
1919 if (
$user->getId() != $state[
'userid'] ) {
1920 throw new \UnexpectedValueException(
1921 "User \"{$state['username']}\" is valid, but " .
1922 "ID {$user->getId()} != {$state['userid']}!"
1926 foreach ( $reqs
as $req ) {
1927 $req->username = $state[
'username'];
1928 $req->returnToUrl = $state[
'returnToUrl'];
1938 wfMessage(
'authmanager-link-not-in-progress' )
1941 $session->remove(
'AuthManager::accountLinkState' );
1945 $id = $provider->getUniqueId();
1946 $res = $provider->continuePrimaryAccountLink(
$user, $reqs );
1947 switch (
$res->status ) {
1949 $this->logger->info(
"Account linked to {user} by $id", [
1950 'user' =>
$user->getName(),
1953 $session->remove(
'AuthManager::accountLinkState' );
1956 $this->logger->debug( __METHOD__ .
": Account linking failed by $id", [
1957 'user' =>
$user->getName(),
1960 $session->remove(
'AuthManager::accountLinkState' );
1964 $this->logger->debug( __METHOD__ .
": Account linking $res->status by $id", [
1965 'user' =>
$user->getName(),
1968 $state[
'continueRequests'] =
$res->neededRequests;
1969 $session->setSecret(
'AuthManager::accountLinkState', $state );
1972 throw new \DomainException(
1973 get_class( $provider ) .
"::continuePrimaryAccountLink() returned $res->status"
1976 }
catch ( \Exception $ex ) {
1977 $session->remove(
'AuthManager::accountLinkState' );
2021 $state = $this->
request->getSession()->getSecret(
'AuthManager::authnState' );
2022 return is_array( $state ) ? $state[
'continueRequests'] : [];
2025 $state = $this->
request->getSession()->getSecret(
'AuthManager::accountCreationState' );
2026 return is_array( $state ) ? $state[
'continueRequests'] : [];
2044 $state = $this->
request->getSession()->getSecret(
'AuthManager::accountLinkState' );
2045 return is_array( $state ) ? $state[
'continueRequests'] : [];
2055 throw new \DomainException( __METHOD__ .
": Invalid action \"$action\"" );
2079 foreach ( $providers
as $provider ) {
2081 foreach ( $provider->getAuthenticationRequests( $providerAction,
$options )
as $req ) {
2082 $id =
$req->getUniqueId();
2086 if (
$req->required ) {
2092 !isset( $reqs[$id] )
2102 switch ( $providerAction ) {
2110 if (
$options[
'username'] !==
null ) {
2121 if ( $providerAction === self::ACTION_CHANGE || $providerAction === self::ACTION_REMOVE ) {
2122 $reqs = array_filter( $reqs,
function (
$req ) {
2127 return array_values( $reqs );
2138 foreach ( $reqs
as $req ) {
2139 if ( !
$req->action || $forceAction ) {
2142 if (
$req->username ===
null ) {
2178 foreach ( $providers
as $provider ) {
2179 if ( !$provider->providerAllowsPropertyChange(
$property ) ) {
2196 if ( isset( $this->allAuthenticationProviders[$id] ) ) {
2197 return $this->allAuthenticationProviders[$id];
2202 if ( isset( $providers[$id] ) ) {
2203 return $providers[$id];
2206 if ( isset( $providers[$id] ) ) {
2207 return $providers[$id];
2210 if ( isset( $providers[$id] ) ) {
2211 return $providers[$id];
2231 $session = $this->
request->getSession();
2232 $arr = $session->getSecret(
'authData' );
2233 if ( !is_array( $arr ) ) {
2237 $session->setSecret(
'authData', $arr );
2248 $arr = $this->
request->getSession()->getSecret(
'authData' );
2249 if ( is_array( $arr ) && array_key_exists( $key, $arr ) ) {
2262 $session = $this->
request->getSession();
2263 if ( $key ===
null ) {
2264 $session->remove(
'authData' );
2266 $arr = $session->getSecret(
'authData' );
2267 if ( is_array( $arr ) && array_key_exists( $key, $arr ) ) {
2268 unset( $arr[$key] );
2269 $session->setSecret(
'authData', $arr );
2282 foreach ( $specs
as &$spec ) {
2283 $spec = [
'sort2' => $i++ ] + $spec + [
'sort' => 0 ];
2286 usort( $specs,
function ( $a, $b ) {
2287 return ( (
int)$a[
'sort'] ) - ( (
int)$b[
'sort'] )
2288 ?: $a[
'sort2'] - $b[
'sort2'];
2292 foreach ( $specs
as $spec ) {
2294 if ( !$provider instanceof $class ) {
2295 throw new \RuntimeException(
2296 "Expected instance of $class, got " . get_class( $provider )
2299 $provider->setLogger( $this->logger );
2300 $provider->setManager( $this );
2301 $provider->setConfig( $this->config );
2302 $id = $provider->getUniqueId();
2303 if ( isset( $this->allAuthenticationProviders[$id] ) ) {
2304 throw new \RuntimeException(
2305 "Duplicate specifications for id $id (classes " .
2306 get_class( $provider ) .
' and ' .
2307 get_class( $this->allAuthenticationProviders[$id] ) .
')'
2310 $this->allAuthenticationProviders[$id] = $provider;
2311 $ret[$id] = $provider;
2321 return $this->config->get(
'AuthManagerConfig' ) ?: $this->config->get(
'AuthManagerAutoConfig' );
2329 if ( $this->preAuthenticationProviders ===
null ) {
2343 if ( $this->primaryAuthenticationProviders ===
null ) {
2357 if ( $this->secondaryAuthenticationProviders ===
null ) {
2372 $session = $this->
request->getSession();
2373 $delay = $session->delaySave();
2375 $session->resetId();
2376 $session->resetAllTokens();
2377 if ( $session->canSetUser() ) {
2378 $session->setUser(
$user );
2380 if ( $remember !==
null ) {
2381 $session->setRememberUser( $remember );
2383 $session->set(
'AuthManager:lastAuthId',
$user->getId() );
2384 $session->set(
'AuthManager:lastAuthTimestamp', time() );
2385 $session->persist();
2387 \Wikimedia\ScopedCallback::consume( $delay );
2402 $user->setOption(
'language',
$lang->getPreferredVariant() );
2425 foreach ( $providers
as $provider ) {
2426 call_user_func_array( [ $provider, $method ],
$args );
2435 if ( !defined(
'MW_PHPUNIT_TEST' ) ) {
2437 throw new \MWException( __METHOD__ .
' may only be called from unit tests!' );
2441 self::$instance =
null;
please add to it if you re going to add events to the MediaWiki code where normally authentication against an external auth plugin would be creating a account $user
static newFromId( $id)
Static factory method for creation from a given user ID.
Generic operation result class Has warning/error list, boolean status and arbitrary value.
static getLocalClusterInstance()
Get the main cluster-local cache object.
getId()
Get the user's ID.
static instance()
Singleton.
if(!isset( $args[0])) $lang
wfGetLB( $wiki=false)
Get a load balancer object.
Status::newGood()` to allow deletion, and then `return false` from the hook function. Ensure you consume the 'ChangeTagAfterDelete' hook to carry out custom deletion actions. $tag:name of the tag $user:user initiating the action & $status:Status object. See above. 'ChangeTagsListActive':Allows you to nominate which of the tags your extension uses are in active use. & $tags:list of all active tags. Append to this array. 'ChangeTagsAfterUpdateTags':Called after tags have been updated with the ChangeTags::updateTags function. Params:$addedTags:tags effectively added in the update $removedTags:tags effectively removed in the update $prevTags:tags that were present prior to the update $rc_id:recentchanges table id $rev_id:revision table id $log_id:logging table id $params:tag params $rc:RecentChange being tagged when the tagging accompanies the action or null $user:User who performed the tagging when the tagging is subsequent to the action or null 'ChangeTagsAllowedAdd':Called when checking if a user can add tags to a change. & $allowedTags:List of all the tags the user is allowed to add. Any tags the user wants to add( $addTags) that are not in this array will cause it to fail. You may add or remove tags to this array as required. $addTags:List of tags user intends to add. $user:User who is adding the tags. 'ChangeUserGroups':Called before user groups are changed. $performer:The User who will perform the change $user:The User whose groups will be changed & $add:The groups that will be added & $remove:The groups that will be removed 'Collation::factory':Called if $wgCategoryCollation is an unknown collation. $collationName:Name of the collation in question & $collationObject:Null. Replace with a subclass of the Collation class that implements the collation given in $collationName. 'ConfirmEmailComplete':Called after a user 's email has been confirmed successfully. $user:user(object) whose email is being confirmed 'ContentAlterParserOutput':Modify parser output for a given content object. Called by Content::getParserOutput after parsing has finished. Can be used for changes that depend on the result of the parsing but have to be done before LinksUpdate is called(such as adding tracking categories based on the rendered HTML). $content:The Content to render $title:Title of the page, as context $parserOutput:ParserOutput to manipulate 'ContentGetParserOutput':Customize parser output for a given content object, called by AbstractContent::getParserOutput. May be used to override the normal model-specific rendering of page content. $content:The Content to render $title:Title of the page, as context $revId:The revision ID, as context $options:ParserOptions for rendering. To avoid confusing the parser cache, the output can only depend on parameters provided to this hook function, not on global state. $generateHtml:boolean, indicating whether full HTML should be generated. If false, generation of HTML may be skipped, but other information should still be present in the ParserOutput object. & $output:ParserOutput, to manipulate or replace 'ContentHandlerDefaultModelFor':Called when the default content model is determined for a given title. May be used to assign a different model for that title. $title:the Title in question & $model:the model name. Use with CONTENT_MODEL_XXX constants. 'ContentHandlerForModelID':Called when a ContentHandler is requested for a given content model name, but no entry for that model exists in $wgContentHandlers. Note:if your extension implements additional models via this hook, please use GetContentModels hook to make them known to core. $modeName:the requested content model name & $handler:set this to a ContentHandler object, if desired. 'ContentModelCanBeUsedOn':Called to determine whether that content model can be used on a given page. This is especially useful to prevent some content models to be used in some special location. $contentModel:ID of the content model in question $title:the Title in question. & $ok:Output parameter, whether it is OK to use $contentModel on $title. Handler functions that modify $ok should generally return false to prevent further hooks from further modifying $ok. 'ContribsPager::getQueryInfo':Before the contributions query is about to run & $pager:Pager object for contributions & $queryInfo:The query for the contribs Pager 'ContribsPager::reallyDoQuery':Called before really executing the query for My Contributions & $data:an array of results of all contribs queries $pager:The ContribsPager object hooked into $offset:Index offset, inclusive $limit:Exact query limit $descending:Query direction, false for ascending, true for descending 'ContributionsLineEnding':Called before a contributions HTML line is finished $page:SpecialPage object for contributions & $ret:the HTML line $row:the DB row for this line & $classes:the classes to add to the surrounding< li > & $attribs:associative array of other HTML attributes for the< li > element. Currently only data attributes reserved to MediaWiki are allowed(see Sanitizer::isReservedDataAttribute). 'ContributionsToolLinks':Change tool links above Special:Contributions $id:User identifier $title:User page title & $tools:Array of tool links $specialPage:SpecialPage instance for context and services. Can be either SpecialContributions or DeletedContributionsPage. Extensions should type hint against a generic SpecialPage though. 'ConvertContent':Called by AbstractContent::convert when a conversion to another content model is requested. Handler functions that modify $result should generally return false to disable further attempts at conversion. $content:The Content object to be converted. $toModel:The ID of the content model to convert to. $lossy:boolean indicating whether lossy conversion is allowed. & $result:Output parameter, in case the handler function wants to provide a converted Content object. Note that $result->getContentModel() must return $toModel. 'CustomEditor':When invoking the page editor Return true to allow the normal editor to be used, or false if implementing a custom editor, e.g. for a special namespace, etc. $article:Article being edited $user:User performing the edit 'DatabaseOraclePostInit':Called after initialising an Oracle database $db:the DatabaseOracle object 'DeletedContribsPager::reallyDoQuery':Called before really executing the query for Special:DeletedContributions Similar to ContribsPager::reallyDoQuery & $data:an array of results of all contribs queries $pager:The DeletedContribsPager object hooked into $offset:Index offset, inclusive $limit:Exact query limit $descending:Query direction, false for ascending, true for descending 'DeletedContributionsLineEnding':Called before a DeletedContributions HTML line is finished. Similar to ContributionsLineEnding $page:SpecialPage object for DeletedContributions & $ret:the HTML line $row:the DB row for this line & $classes:the classes to add to the surrounding< li > & $attribs:associative array of other HTML attributes for the< li > element. Currently only data attributes reserved to MediaWiki are allowed(see Sanitizer::isReservedDataAttribute). 'DifferenceEngineAfterLoadNewText':called in DifferenceEngine::loadNewText() after the new revision 's content has been loaded into the class member variable $differenceEngine->mNewContent but before returning true from this function. $differenceEngine:DifferenceEngine object 'DifferenceEngineLoadTextAfterNewContentIsLoaded':called in DifferenceEngine::loadText() after the new revision 's content has been loaded into the class member variable $differenceEngine->mNewContent but before checking if the variable 's value is null. This hook can be used to inject content into said class member variable. $differenceEngine:DifferenceEngine object 'DifferenceEngineMarkPatrolledLink':Allows extensions to change the "mark as patrolled" link which is shown both on the diff header as well as on the bottom of a page, usually wrapped in a span element which has class="patrollink". $differenceEngine:DifferenceEngine object & $markAsPatrolledLink:The "mark as patrolled" link HTML(string) $rcid:Recent change ID(rc_id) for this change(int) 'DifferenceEngineMarkPatrolledRCID':Allows extensions to possibly change the rcid parameter. For example the rcid might be set to zero due to the user being the same as the performer of the change but an extension might still want to show it under certain conditions. & $rcid:rc_id(int) of the change or 0 $differenceEngine:DifferenceEngine object $change:RecentChange object $user:User object representing the current user 'DifferenceEngineNewHeader':Allows extensions to change the $newHeader variable, which contains information about the new revision, such as the revision 's author, whether the revision was marked as a minor edit or not, etc. $differenceEngine:DifferenceEngine object & $newHeader:The string containing the various #mw-diff-otitle[1-5] divs, which include things like revision author info, revision comment, RevisionDelete link and more $formattedRevisionTools:Array containing revision tools, some of which may have been injected with the DiffRevisionTools hook $nextlink:String containing the link to the next revision(if any) $status
as see the revision history and available at free of to any person obtaining a copy of this software and associated documentation to deal in the Software without including without limitation the rights to use
this hook is for auditing only $req
static addUpdate(DeferrableUpdate $update, $stage=self::POSTSEND)
Add an update to the deferred list to be run later by execute()
static newFatal( $message)
Factory function for fatal errors.
wfReadOnly()
Check whether the wiki is in read-only mode.
static newFromName( $name, $validate='valid')
Static factory method for creation from username.
static getTitleFor( $name, $subpage=false, $fragment='')
Get a localised Title object for a specified special page name If you don't need a full Title object,...
Allows to change the fields on the form that will be generated $name
injection txt This is an overview of how MediaWiki makes use of dependency injection The design described here grew from the discussion of RFC T384 The term dependency this means that anything an object needs to operate should be injected from the the object itself should only know narrow no concrete implementation of the logic it relies on The requirement to inject everything typically results in an architecture that based on two main types of and essentially stateless service objects that use other service objects to operate on the value objects As of the beginning MediaWiki is only starting to use the DI approach Much of the code still relies on global state or direct resulting in a highly cyclical dependency which acts as the top level factory for services in MediaWiki which can be used to gain access to default instances of various services MediaWikiServices however also allows new services to be defined and default services to be redefined Services are defined or redefined by providing a callback the instantiator that will return a new instance of the service When it will create an instance of MediaWikiServices and populate it with the services defined in the files listed by thereby bootstrapping the DI framework Per $wgServiceWiringFiles lists includes ServiceWiring php
const READ_LOCKING
Constants for object loading bitfield flags (higher => higher QoS)
Generic operation result class Has warning/error list, boolean status and arbitrary value.
Interface for configuration instances.
static addCallableUpdate( $callable, $stage=self::POSTSEND, IDatabase $dbw=null)
Add a callable update.
static wrap( $sv)
Succinct helper method to wrap a StatusValue.
div flags Integer display flags(NO_ACTION_LINK, NO_EXTRA_USER_LINKS) 'LogException' returning false will NOT prevent logging a wrapping ErrorException instead of letting the login form give the generic error message that the account does not exist For when the account has been renamed or deleted or an array to pass a message key and parameters create2 Corresponds to logging log_action database field and which is displayed in the UI similar to $comment this hook should only be used to add variables that depend on the current page request
when a variable name is used in a it is silently declared as a new masking the global
Class for handling updates to the site_stats table.
static newGood( $value=null)
Factory function for good results.
isDnsBlacklisted( $ip, $checkWhitelist=false)
Whether the given IP is in a DNS blacklist.
static invalidateAllPasswordsForUser( $username)
Invalidate all passwords for a user, by name.
null means default in associative array with keys and values unescaped Should be merged with default with a value of false meaning to suppress the attribute in associative array with keys and values unescaped noclasses & $ret
static getObjectFromSpec( $spec)
Instantiate an object based on a specification array.
static getMain()
Static methods.
The WebRequest class encapsulates getting at data passed in the URL or via a POSTed form stripping il...
wfReadOnlyReason()
Check if the site is in read-only mode and return the message if so.
null means default in associative array with keys and values unescaped Should be merged with default with a value of false meaning to suppress the attribute in associative array with keys and values unescaped & $options
static idFromName( $name, $flags=self::READ_NORMAL)
Get database id given a user name.
This document is intended to provide useful advice for parties seeking to redistribute MediaWiki to end users It s targeted particularly at maintainers for Linux since it s been observed that distribution packages of MediaWiki often break We ve consistently had to recommend that users seeking support use official tarballs instead of their distribution s and this often solves whatever problem the user is having It would be nice if this could such as
either a unescaped string or a HtmlArmor object after in associative array form externallinks including delete and has completed for all link tables whether this was an auto creation default is conds Array Extra conditions for the No matching items in log is displayed if loglist is empty msgKey Array If you want a nice box with a set this to the key of the message First element is the message additional optional elements are parameters for the key that are processed with wfMessage() -> params() ->parseAsBlock() - offset Set to overwrite offset parameter in $wgRequest set to '' to unset offset - wrap String Wrap the message in html(usually something like "<
you have access to all of the normal MediaWiki so you can get a DB use the etc For full docs on the Maintenance class
$wgAuth $wgAuth
Authentication plugin.
injection txt This is an overview of how MediaWiki makes use of dependency injection The design described here grew from the discussion of RFC T384 The term dependency this means that anything an object needs to operate should be injected from the the object itself should only know narrow no concrete implementation of the logic it relies on The requirement to inject everything typically results in an architecture that based on two main types of and essentially stateless service objects that use other service objects to operate on the value objects As of the beginning MediaWiki is only starting to use the DI approach Much of the code still relies on global state or direct resulting in a highly cyclical dependency MediaWikiServices
static isUsableName( $name)
Usernames which fail to pass this function will be blocked from user login and new account registrati...
isBlockedFromCreateAccount()
Get whether the user is explicitly blocked from account creation.
The User object encapsulates all of the user-specific settings (user_id, name, rights,...
static run( $event, array $args=[], $deprecatedVersion=null)
Call hook functions defined in Hooks::register and $wgHooks.
this hook is for auditing only or null if authentication failed before getting that far $username
getName()
Get the user name, or the IP of an anonymous user.
static isCreatableName( $name)
Usernames which fail to pass this function will be blocked from new account registrations,...
it s the revision text itself In either if gzip is the revision text is gzipped $flags
the array() calling protocol came about after MediaWiki 1.4rc1.
this class mediates it Skin Encapsulates a look and feel for the wiki All of the functions that render HTML and make choices about how to render it are here and are called from various other places when and is meant to be subclassed with other skins that may override some of its functions The User object contains a reference to a and so rather than having a global skin object we just rely on the global User and get the skin with $wgUser and also has some character encoding functions and other locale stuff The current user interface language is instantiated as and the content language as $wgContLang