aboutsummaryrefslogtreecommitdiffstats
path: root/includes/user/User.php
diff options
context:
space:
mode:
Diffstat (limited to 'includes/user/User.php')
-rw-r--r--includes/user/User.php9
1 files changed, 7 insertions, 2 deletions
diff --git a/includes/user/User.php b/includes/user/User.php
index a3a72c667cf2..9621d1c830a6 100644
--- a/includes/user/User.php
+++ b/includes/user/User.php
@@ -990,8 +990,13 @@ class User implements Stringable, Authority, UserIdentity, UserEmailContact {
* @since 1.23
*/
public function checkPasswordValidity( $password ) {
- $passwordPolicy = MediaWikiServices::getInstance()->getMainConfig()
- ->get( MainConfigNames::PasswordPolicy );
+ $services = MediaWikiServices::getInstance();
+ $userNameUtils = $services->getUserNameUtils();
+ if ( $userNameUtils->isTemp( $this->getName() ) ) {
+ return Status::newFatal( 'error-temporary-accounts-cannot-have-passwords' );
+ }
+
+ $passwordPolicy = $services->getMainConfig()->get( MainConfigNames::PasswordPolicy );
$upp = new UserPasswordPolicy(
$passwordPolicy['policies'],