X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fspecialpage%2FLoginSignupSpecialPage.php;h=8a2e0d65b014467019b0b92ed6a212667180532a;hb=854a462dc0aef59e1c26c057792b8a9214449af5;hp=5dab221019fd65fb590c07f06c2f3763cff37bb6;hpb=78c1c6de078e227bc5fab39a89abd3dfcbcf0bd0;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/specialpage/LoginSignupSpecialPage.php b/includes/specialpage/LoginSignupSpecialPage.php index 5dab221019..8a2e0d65b0 100644 --- a/includes/specialpage/LoginSignupSpecialPage.php +++ b/includes/specialpage/LoginSignupSpecialPage.php @@ -1342,196 +1342,12 @@ class FakeAuthTemplate extends BaseTemplate { } } -/** - * A horrible hack to handle AuthManager's feature flag. For other special pages this is done in - * SpecialPageFactory, but LoginForm is used directly by some extensions. Will be killed as soon - * as AuthManager is stable. - */ -class LoginForm extends SpecialPage { - private $realLoginForm; - - public function __construct( $request = null ) { - global $wgDisableAuthManager; - if ( $wgDisableAuthManager ) { - $this->realLoginForm = new LoginFormPreAuthManager( $request ); - } else { - $this->realLoginForm = new LoginFormAuthManager( $request ); - } - } - - // proxy everything - - public function __get( $name ) { - return $this->realLoginForm->$name; - } - - public function __set( $name, $value ) { - $this->realLoginForm->$name = $value; - } - - public function __call( $name, $args ) { - return call_user_func_array( [ $this->realLoginForm, $name ], $args ); - } - - public static function __callStatic( $name, $args ) { - global $wgDisableAuthManager; - return call_user_func_array( [ $wgDisableAuthManager ? LoginFormPreAuthManager::class - : LoginFormAuthManager::class, $name ], $args ); - } - - // all public SpecialPage methods need to be proxied explicitly - - public function getName() { - return call_user_func_array( [ $this->realLoginForm, __FUNCTION__ ], func_get_args() ); - } - public function getRestriction() { - return call_user_func_array( [ $this->realLoginForm, __FUNCTION__ ], func_get_args() ); - } - public function isListed() { - return call_user_func_array( [ $this->realLoginForm, __FUNCTION__ ], func_get_args() ); - } - public function setListed( $listed ) { - return call_user_func_array( [ $this->realLoginForm, __FUNCTION__ ], func_get_args() ); - } - public function listed( $x = null ) { - return call_user_func_array( [ $this->realLoginForm, __FUNCTION__ ], func_get_args() ); - } - public function isIncludable() { - return call_user_func_array( [ $this->realLoginForm, __FUNCTION__ ], func_get_args() ); - } - public function including( $x = null ) { - return call_user_func_array( [ $this->realLoginForm, __FUNCTION__ ], func_get_args() ); - } - public function getLocalName() { - return call_user_func_array( [ $this->realLoginForm, __FUNCTION__ ], func_get_args() ); - } - public function isExpensive() { - return call_user_func_array( [ $this->realLoginForm, __FUNCTION__ ], func_get_args() ); - } - public function isCached() { - return call_user_func_array( [ $this->realLoginForm, __FUNCTION__ ], func_get_args() ); - } - public function isRestricted() { - return call_user_func_array( [ $this->realLoginForm, __FUNCTION__ ], func_get_args() ); - } - public function userCanExecute( User $user ) { - return call_user_func_array( [ $this->realLoginForm, __FUNCTION__ ], func_get_args() ); - } - public function displayRestrictionError() { - return call_user_func_array( [ $this->realLoginForm, __FUNCTION__ ], func_get_args() ); - } - public function checkPermissions() { - return call_user_func_array( [ $this->realLoginForm, __FUNCTION__ ], func_get_args() ); - } - public function checkReadOnly() { - return call_user_func_array( [ $this->realLoginForm, __FUNCTION__ ], func_get_args() ); - } - public function requireLogin( - $reasonMsg = 'exception-nologin-text', $titleMsg = 'exception-nologin' - ) { - return call_user_func_array( [ $this->realLoginForm, __FUNCTION__ ], func_get_args() ); - } - public function prefixSearchSubpages( $search, $limit, $offset ) { - return call_user_func_array( [ $this->realLoginForm, __FUNCTION__ ], func_get_args() ); - } - public function execute( $subPage ) { - return call_user_func_array( [ $this->realLoginForm, __FUNCTION__ ], func_get_args() ); - } - public function getDescription() { - return call_user_func_array( [ $this->realLoginForm, __FUNCTION__ ], func_get_args() ); - } - function getTitle( $subpage = false ) { - return call_user_func_array( [ $this->realLoginForm, __FUNCTION__ ], func_get_args() ); - } - function getPageTitle( $subpage = false ) { - return call_user_func_array( [ $this->realLoginForm, __FUNCTION__ ], func_get_args() ); - } - public function setContext( $context ) { - return call_user_func_array( [ $this->realLoginForm, __FUNCTION__ ], func_get_args() ); - } - public function getContext() { - return call_user_func_array( [ $this->realLoginForm, __FUNCTION__ ], func_get_args() ); - } - public function getRequest() { - return call_user_func_array( [ $this->realLoginForm, __FUNCTION__ ], func_get_args() ); - } - public function getOutput() { - return call_user_func_array( [ $this->realLoginForm, __FUNCTION__ ], func_get_args() ); - } - public function getUser() { - return call_user_func_array( [ $this->realLoginForm, __FUNCTION__ ], func_get_args() ); - } - public function getSkin() { - return call_user_func_array( [ $this->realLoginForm, __FUNCTION__ ], func_get_args() ); - } - public function getLanguage() { - return call_user_func_array( [ $this->realLoginForm, __FUNCTION__ ], func_get_args() ); - } - public function getConfig() { - return call_user_func_array( [ $this->realLoginForm, __FUNCTION__ ], func_get_args() ); - } - public function getFullTitle() { - return call_user_func_array( [ $this->realLoginForm, __FUNCTION__ ], func_get_args() ); - } - public function getFinalGroupName() { - return call_user_func_array( [ $this->realLoginForm, __FUNCTION__ ], func_get_args() ); - } - public function doesWrites() { - return call_user_func_array( [ $this->realLoginForm, __FUNCTION__ ], func_get_args() ); - } - - // no way to proxy constants and static properties - - const SUCCESS = 0; - const NO_NAME = 1; - const ILLEGAL = 2; - const WRONG_PLUGIN_PASS = 3; - const NOT_EXISTS = 4; - const WRONG_PASS = 5; - const EMPTY_PASS = 6; - const RESET_PASS = 7; - const ABORTED = 8; - const CREATE_BLOCKED = 9; - const THROTTLED = 10; - const USER_BLOCKED = 11; - const NEED_TOKEN = 12; - const WRONG_TOKEN = 13; - const USER_MIGRATED = 14; - - public static $statusCodes = [ - self::SUCCESS => 'success', - self::NO_NAME => 'no_name', - self::ILLEGAL => 'illegal', - self::WRONG_PLUGIN_PASS => 'wrong_plugin_pass', - self::NOT_EXISTS => 'not_exists', - self::WRONG_PASS => 'wrong_pass', - self::EMPTY_PASS => 'empty_pass', - self::RESET_PASS => 'reset_pass', - self::ABORTED => 'aborted', - self::CREATE_BLOCKED => 'create_blocked', - self::THROTTLED => 'throttled', - self::USER_BLOCKED => 'user_blocked', - self::NEED_TOKEN => 'need_token', - self::WRONG_TOKEN => 'wrong_token', - self::USER_MIGRATED => 'user_migrated', - ]; - - public static $validErrorMessages = [ - 'exception-nologin-text', - 'watchlistanontext', - 'changeemail-no-info', - 'resetpass-no-info', - 'confirmemail_needlogin', - 'prefsnologintext2', - ]; -} - /** * LoginForm as a special page has been replaced by SpecialUserLogin and SpecialCreateAccount, * but some extensions called its public methods directly, so the class is retained as a * B/C wrapper. Anything that used it before should use AuthManager instead. */ -class LoginFormAuthManager extends SpecialPage { +class LoginForm extends SpecialPage { const SUCCESS = 0; const NO_NAME = 1; const ILLEGAL = 2;