X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FAuthPlugin.php;h=b73ecbd8edfe03fe24933984beee07caa73383bc;hb=74426f3cf796b149f1ae445e41815bbe148640b2;hp=45ad4d1bd1131c6e8567fe844565f21e64c168bb;hpb=166191535f486569277e95b7e6a3850b5db6757d;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/AuthPlugin.php b/includes/AuthPlugin.php index 45ad4d1bd1..b73ecbd8ed 100644 --- a/includes/AuthPlugin.php +++ b/includes/AuthPlugin.php @@ -32,6 +32,8 @@ * accounts authenticate externally, or use it only as a fallback; also * you can transparently create internal wiki accounts the first time * someone logs in who can be authenticated externally. + * + * @deprecated since 1.27 */ class AuthPlugin { /** @@ -71,8 +73,8 @@ class AuthPlugin { /** * Modify options in the login template. * - * @param UserLoginTemplate $template - * @param string $type 'signup' or 'login'. Added in 1.16. + * @param BaseTemplate &$template + * @param string &$type 'signup' or 'login'. Added in 1.16. */ public function modifyUITemplate( &$template, &$type ) { # Override this! @@ -120,7 +122,9 @@ class AuthPlugin { * The User object is passed by reference so it can be modified; don't * forget the & on your function declaration. * - * @param User $user + * @deprecated since 1.26, use the UserLoggedIn hook instead. And assigning + * a different User object to $user is no longer supported. + * @param User &$user * @return bool */ public function updateUser( &$user ) { @@ -155,11 +159,11 @@ class AuthPlugin { * @return bool */ public function allowPropChange( $prop = '' ) { - if ( $prop == 'realname' && is_callable( array( $this, 'allowRealNameChange' ) ) ) { + if ( $prop == 'realname' && is_callable( [ $this, 'allowRealNameChange' ] ) ) { return $this->allowRealNameChange(); - } elseif ( $prop == 'emailaddress' && is_callable( array( $this, 'allowEmailChange' ) ) ) { + } elseif ( $prop == 'emailaddress' && is_callable( [ $this, 'allowEmailChange' ] ) ) { return $this->allowEmailChange(); - } elseif ( $prop == 'nickname' && is_callable( array( $this, 'allowNickChange' ) ) ) { + } elseif ( $prop == 'nickname' && is_callable( [ $this, 'allowNickChange' ] ) ) { return $this->allowNickChange(); } else { return true; @@ -204,6 +208,7 @@ class AuthPlugin { * Update user information in the external authentication database. * Return true if successful. * + * @deprecated since 1.26, use the UserSaveSettings hook instead. * @param User $user * @return bool */ @@ -215,12 +220,13 @@ class AuthPlugin { * Update user groups in the external authentication database. * Return true if successful. * + * @deprecated since 1.26, use the UserGroupsChanged hook instead. * @param User $user * @param array $addgroups Groups to add. * @param array $delgroups Groups to remove. * @return bool */ - public function updateExternalDBGroups( $user, $addgroups, $delgroups = array() ) { + public function updateExternalDBGroups( $user, $addgroups, $delgroups = [] ) { return true; } @@ -278,7 +284,9 @@ class AuthPlugin { * The User object is passed by reference so it can be modified; don't * forget the & on your function declaration. * - * @param User $user + * @deprecated since 1.26, use the UserLoggedIn hook instead. And assigning + * a different User object to $user is no longer supported. + * @param User &$user * @param bool $autocreate True if user is being autocreated on login */ public function initUser( &$user, $autocreate = false ) { @@ -298,7 +306,7 @@ class AuthPlugin { /** * Get an instance of a User object * - * @param User $user + * @param User &$user * * @return AuthPluginUser */ @@ -312,10 +320,13 @@ class AuthPlugin { * @return array */ public function domainList() { - return array(); + return []; } } +/** + * @deprecated since 1.27 + */ class AuthPluginUser { function __construct( $user ) { # Override this! @@ -326,16 +337,30 @@ class AuthPluginUser { return -1; } + /** + * Indicate whether the user is locked + * @deprecated since 1.26, use the UserIsLocked hook instead. + * @return bool + */ public function isLocked() { # Override this! return false; } + /** + * Indicate whether the user is hidden + * @deprecated since 1.26, use the UserIsHidden hook instead. + * @return bool + */ public function isHidden() { # Override this! return false; } + /** + * @deprecated since 1.28, use SessionManager::invalidateSessionForUser() instead. + * @return bool + */ public function resetAuthToken() { # Override this! return true;