Update for MW 1.42.0

master
落雨楓 1 month ago
parent ec85da6f9a
commit 5b1e46a762

@ -8,7 +8,7 @@
"license-name": "MIT",
"type": "other",
"requires": {
"MediaWiki": ">= 1.35.0"
"MediaWiki": ">= 1.40.0"
},
"MessagesDirs": {
"IsekaiOIDC": [

@ -2,13 +2,9 @@
namespace Isekai\OIDC;
use ApiBase;
use ApiQueryBase;
use Exception;
use Exif;
use MediaWiki\MediaWikiServices;
use Wikimedia\ParamValidator\ParamValidator;
use User;
class ApiOIDCAvatar extends ApiQueryBase {
public function __construct( $main, $method ) {

@ -9,12 +9,13 @@ use MediaWiki\Auth\AuthenticationResponse;
use MediaWiki\Auth\AuthManager;
use MediaWiki\MediaWikiServices;
use MediaWiki\Session\SessionManager;
use MediaWiki\User\User;
use MediaWiki\Title\Title;
use MediaWiki\SpecialPage\SpecialPage;
use MediaWiki\Parser\Sanitizer;
use MediaWiki\Context\RequestContext;
use MediaWiki\Message\Message;
use StatusValue;
use User;
use Title;
use SpecialPage;
use Sanitizer;
use RequestContext;
class IsekaiOIDCAuth extends AbstractPrimaryAuthenticationProvider {
@ -164,7 +165,8 @@ class IsekaiOIDCAuth extends AbstractPrimaryAuthenticationProvider {
$authManager->setAuthenticationSessionData(self::USERNAME_SESSION_KEY, $username);
return AuthenticationResponse::newPass($username);
} else {
return AuthenticationResponse::newFail(wfMessage('isekaioidc-login-failed'));
$message = Message::newFromSpecifier('isekaioidc-login-failed');
return AuthenticationResponse::newFail($message);
}
}
@ -580,7 +582,6 @@ class IsekaiOIDCAuth extends AbstractPrimaryAuthenticationProvider {
$userIdentityLookup = MediaWikiServices::getInstance()->getUserIdentityLookup();
$userIdentity = $userIdentityLookup->getUserIdentityByName( $preferred_username );
if ( !$userIdentity || !$userIdentity->isRegistered() ) {
return $preferred_username;
}

@ -1,11 +1,12 @@
<?php
namespace Isekai\OIDC;
use Html;
use MediaWiki\MediaWikiServices;
use OutputPage;
use RequestContext;
use Title;
use MediaWiki\Html\Html;
use MediaWiki\Output\OutputPage;
use MediaWiki\Context\RequestContext;
use MediaWiki\Title\Title;
use MediaWiki\User\User;
class IsekaiOIDCAuthHooks {
const SYNLOGIN_SESSIONKEY = 'IsekaiOIDCSyncLogin';
@ -97,7 +98,7 @@ class IsekaiOIDCAuthHooks {
$request->response()->setCookie(self::SYNLOGOUT_SESSIONKEY, 1);
}
public static function onGetPreferences(\User $user, &$preferences) {
public static function onGetPreferences(User $user, &$preferences) {
$services = MediaWikiServices::getInstance();
$wgIsekaiOIDC = $services->getMainConfig()->get('IsekaiOIDC');

@ -3,7 +3,7 @@ namespace Isekai\OIDC;
use MediaWiki\Auth\AuthManager;
use MediaWiki\Logger\LoggerFactory;
use LoginSignupSpecialPage;
use MediaWiki\SpecialPage\LoginSignupSpecialPage;
use LoginHelper;
class SpecialIsekaiOIDCCallback extends LoginSignupSpecialPage {

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save