[
MAINHACK
]
Mail Test
BC
Config Scan
HOME
Create...
New File
New Folder
Viewing / Editing File: UserSecurityIdentity.php
File is not writable. Editing disabled.
<?php /* * This file is part of the Symfony package. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Security\Acl\Domain; use Symfony\Component\Security\Core\Authentication\Token\TokenInterface; use Symfony\Component\Security\Core\User\UserInterface; use Symfony\Component\Security\Core\Util\ClassUtils; use Symfony\Component\Security\Acl\Model\SecurityIdentityInterface; /** * A SecurityIdentity implementation used for actual users * * @author Johannes M. Schmitt <schmittjoh@gmail.com> */ final class UserSecurityIdentity implements SecurityIdentityInterface { private $username; private $class; /** * Constructor * * @param string $username the username representation * @param string $class the user's fully qualified class name * * @throws \InvalidArgumentException */ public function __construct($username, $class) { if (empty($username)) { throw new \InvalidArgumentException('$username must not be empty.'); } if (empty($class)) { throw new \InvalidArgumentException('$class must not be empty.'); } $this->username = (string) $username; $this->class = $class; } /** * Creates a user security identity from a UserInterface * * @param UserInterface $user * @return UserSecurityIdentity */ public static function fromAccount(UserInterface $user) { return new self($user->getUsername(), ClassUtils::getRealClass($user)); } /** * Creates a user security identity from a TokenInterface * * @param TokenInterface $token * @return UserSecurityIdentity */ public static function fromToken(TokenInterface $token) { $user = $token->getUser(); if ($user instanceof UserInterface) { return self::fromAccount($user); } return new self((string) $user, is_object($user) ? ClassUtils::getRealClass($user) : ClassUtils::getRealClass($token)); } /** * Returns the username * * @return string */ public function getUsername() { return $this->username; } /** * Returns the user's class name * * @return string */ public function getClass() { return $this->class; } /** * {@inheritDoc} */ public function equals(SecurityIdentityInterface $sid) { if (!$sid instanceof UserSecurityIdentity) { return false; } return $this->username === $sid->getUsername() && $this->class === $sid->getClass(); } /** * A textual representation of this security identity. * * This is not used for equality comparison, but only for debugging. * * @return string */ public function __toString() { return sprintf('UserSecurityIdentity(%s, %s)', $this->username, $this->class); } }
Save Changes
Cancel / Back
Close ×
Server Info
Hostname: server290.web-hosting.com
Server IP: 162.0.232.250
PHP Version: 8.1.34
Server Software: LiteSpeed
System: Linux server290.web-hosting.com 4.18.0-513.18.1.lve.el8.x86_64 #1 SMP Thu Feb 22 12:55:50 UTC 2024 x86_64
HDD Total: 93.04 GB
HDD Free: 67.69 GB
Domains on IP: N/A (Requires external lookup)
System Features
Safe Mode:
Off
disable_functions:
None
allow_url_fopen:
On
allow_url_include:
Off
magic_quotes_gpc:
Off
register_globals:
Off
open_basedir:
None
cURL:
Enabled
ZipArchive:
Enabled
MySQLi:
Enabled
PDO:
Enabled
wget:
Yes
curl (cmd):
Yes
perl:
Yes
python:
Yes (py3)
gcc:
No
pkexec:
No
git:
Yes
User Info
Username: afiencwd
User ID (UID): 821
Group ID (GID): 802
Script Owner UID: 821
Current Dir Owner: N/A