MediaWiki
REL1_41
UserIdentityUtils.php
Go to the documentation of this file.
1
<?php
2
3
namespace
MediaWiki\User
;
4
5
use
MediaWiki\User\TempUser\TempUserConfig
;
6
13
class
UserIdentityUtils
{
14
private
TempUserConfig
$tempUserConfig;
15
21
public
function
__construct
(
TempUserConfig
$tempUserConfig ) {
22
$this->tempUserConfig = $tempUserConfig;
23
}
24
31
public
function
isTemp
(
UserIdentity
$user ) {
32
return
$this->tempUserConfig->isTempName( $user->
getName
() );
33
}
34
41
public
function
isNamed
(
UserIdentity
$user ) {
42
return
$user->
isRegistered
()
43
&& !$this->tempUserConfig->isTempName( $user->
getName
() );
44
}
45
}
MediaWiki\User\UserIdentityUtils
Convenience functions for interpreting UserIdentity objects using additional services or config.
Definition
UserIdentityUtils.php:13
MediaWiki\User\UserIdentityUtils\isNamed
isNamed(UserIdentity $user)
Is the user a normal non-temporary registered user?
Definition
UserIdentityUtils.php:41
MediaWiki\User\UserIdentityUtils\__construct
__construct(TempUserConfig $tempUserConfig)
Definition
UserIdentityUtils.php:21
MediaWiki\User\UserIdentityUtils\isTemp
isTemp(UserIdentity $user)
Is the user a temporary user?
Definition
UserIdentityUtils.php:31
MediaWiki\User\TempUser\TempUserConfig
Interface for temporary user creation config and name matching.
Definition
TempUserConfig.php:16
MediaWiki\User\UserIdentity
Interface for objects representing user identity.
Definition
UserIdentity.php:39
MediaWiki\User\UserIdentity\isRegistered
isRegistered()
This must be equivalent to getId() != 0 and is provided for code readability.
MediaWiki\User\UserIdentity\getName
getName()
MediaWiki\User
Utility class for bot passwords.
Definition
ActorCache.php:21
includes
user
UserIdentityUtils.php
Generated on Wed Nov 27 2024 07:25:59 for MediaWiki by
1.10.0