!C99Shell v. 2.0 [PHP 7 Update] [25.02.2019]!

Software: Apache. PHP/7.3.33 

uname -a: Linux acloudg.aryanict.com 4.18.0-513.9.1.lve.el8.x86_64 #1 SMP Mon Dec 4 15:01:22 UTC
2023 x86_64
 

uid=1095(katebhospital) gid=1098(katebhospital) groups=1098(katebhospital) 

Safe-mode: OFF (not secure)

/opt/alt/php55/usr/share/pear/Symfony/Component/Security/Core/Authentication/Token/   drwxr-xr-x
Free 293.74 GB of 429.69 GB (68.36%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Feedback    Self remove    Logout    


Viewing file:     AbstractToken.php (7.43 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?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\Core\Authentication\Token;

use 
Symfony\Component\Security\Core\Role\RoleInterface;
use 
Symfony\Component\Security\Core\Role\Role;
use 
Symfony\Component\Security\Core\User\UserInterface;
use 
Symfony\Component\Security\Core\User\AdvancedUserInterface;
use 
Symfony\Component\Security\Core\User\EquatableInterface;

/**
 * Base class for Token instances.
 *
 * @author Fabien Potencier <fabien@symfony.com>
 * @author Johannes M. Schmitt <schmittjoh@gmail.com>
 */
abstract class AbstractToken implements TokenInterface
{
    private 
$user;
    private 
$roles = array();
    private 
$authenticated false;
    private 
$attributes = array();

    
/**
     * Constructor.
     *
     * @param RoleInterface[] $roles An array of roles
     *
     * @throws \InvalidArgumentException
     */
    
public function __construct(array $roles = array())
    {
        foreach (
$roles as $role) {
            if (
is_string($role)) {
                
$role = new Role($role);
            } elseif (!
$role instanceof RoleInterface) {
                throw new \
InvalidArgumentException(sprintf('$roles must be an array of strings, or RoleInterface instances, but got %s.'gettype($role)));
            }

            
$this->roles[] = $role;
        }
    }

    
/**
     * {@inheritdoc}
     */
    
public function getRoles()
    {
        return 
$this->roles;
    }

    
/**
     * {@inheritdoc}
     */
    
public function getUsername()
    {
        if (
$this->user instanceof UserInterface) {
            return 
$this->user->getUsername();
        }

        return (string) 
$this->user;
    }

    
/**
     * {@inheritdoc}
     */
    
public function getUser()
    {
        return 
$this->user;
    }

    
/**
     * Sets the user in the token.
     *
     * The user can be a UserInterface instance, or an object implementing
     * a __toString method or the username as a regular string.
     *
     * @param mixed $user The user
     * @throws \InvalidArgumentException
     */
    
public function setUser($user)
    {
        if (!(
$user instanceof UserInterface || (is_object($user) && method_exists($user'__toString')) || is_string($user))) {
            throw new \
InvalidArgumentException('$user must be an instanceof UserInterface, an object implementing a __toString method, or a primitive string.');
        }

        if (
null === $this->user) {
            
$changed false;
        } elseif (
$this->user instanceof UserInterface) {
            if (!
$user instanceof UserInterface) {
                
$changed true;
            } else {
                
$changed $this->hasUserChanged($user);
            }
        } elseif (
$user instanceof UserInterface) {
            
$changed true;
        } else {
            
$changed = (string) $this->user !== (string) $user;
        }

        if (
$changed) {
            
$this->setAuthenticated(false);
        }

        
$this->user $user;
    }

    
/**
     * {@inheritdoc}
     */
    
public function isAuthenticated()
    {
        return 
$this->authenticated;
    }

    
/**
     * {@inheritdoc}
     */
    
public function setAuthenticated($authenticated)
    {
        
$this->authenticated = (Boolean) $authenticated;
    }

    
/**
     * {@inheritdoc}
     */
    
public function eraseCredentials()
    {
        if (
$this->getUser() instanceof UserInterface) {
            
$this->getUser()->eraseCredentials();
        }
    }

    
/**
     * {@inheritdoc}
     */
    
public function serialize()
    {
        return 
serialize(
            array(
                
is_object($this->user) ? clone $this->user $this->user,
                
$this->authenticated,
                
$this->roles,
                
$this->attributes
            
)
        );
    }

    
/**
     * {@inheritdoc}
     */
    
public function unserialize($serialized)
    {
        list(
$this->user$this->authenticated$this->roles$this->attributes) = unserialize($serialized);
    }

    
/**
     * Returns the token attributes.
     *
     * @return array The token attributes
     */
    
public function getAttributes()
    {
        return 
$this->attributes;
    }

    
/**
     * Sets the token attributes.
     *
     * @param array $attributes The token attributes
     */
    
public function setAttributes(array $attributes)
    {
        
$this->attributes $attributes;
    }

    
/**
     * Returns true if the attribute exists.
     *
     * @param string $name The attribute name
     *
     * @return Boolean true if the attribute exists, false otherwise
     */
    
public function hasAttribute($name)
    {
        return 
array_key_exists($name$this->attributes);
    }

    
/**
     * Returns an attribute value.
     *
     * @param string $name The attribute name
     *
     * @return mixed The attribute value
     *
     * @throws \InvalidArgumentException When attribute doesn't exist for this token
     */
    
public function getAttribute($name)
    {
        if (!
array_key_exists($name$this->attributes)) {
            throw new \
InvalidArgumentException(sprintf('This token has no "%s" attribute.'$name));
        }

        return 
$this->attributes[$name];
    }

    
/**
     * Sets an attribute.
     *
     * @param string $name  The attribute name
     * @param mixed  $value The attribute value
     */
    
public function setAttribute($name$value)
    {
        
$this->attributes[$name] = $value;
    }

    
/**
     * {@inheritDoc}
     */
    
public function __toString()
    {
        
$class get_class($this);
        
$class substr($classstrrpos($class'\\')+1);

        
$roles = array();
        foreach (
$this->roles as $role) {
            
$roles[] = $role->getRole();
        }

        return 
sprintf('%s(user="%s", authenticated=%s, roles="%s")'$class$this->getUsername(), json_encode($this->authenticated), implode(', '$roles));
    }

    private function 
hasUserChanged(UserInterface $user)
    {
        if (!(
$this->user instanceof UserInterface)) {
            throw new \
BadMethodCallException('Method "hasUserChanged" should be called when current user class is instance of "UserInterface".');
        }

        if (
$this->user instanceof EquatableInterface) {
            return ! (Boolean) 
$this->user->isEqualTo($user);
        }

        if (
$this->user->getPassword() !== $user->getPassword()) {
            return 
true;
        }

        if (
$this->user->getSalt() !== $user->getSalt()) {
            return 
true;
        }

        if (
$this->user->getUsername() !== $user->getUsername()) {
            return 
true;
        }

        if (
$this->user instanceof AdvancedUserInterface && $user instanceof AdvancedUserInterface) {
            if (
$this->user->isAccountNonExpired() !== $user->isAccountNonExpired()) {
                return 
true;
            }

            if (
$this->user->isAccountNonLocked() !== $user->isAccountNonLocked()) {
                return 
true;
            }

            if (
$this->user->isCredentialsNonExpired() !== $user->isCredentialsNonExpired()) {
                return 
true;
            }

            if (
$this->user->isEnabled() !== $user->isEnabled()) {
                return 
true;
            }
        } elseif (
$this->user instanceof AdvancedUserInterface xor $user instanceof AdvancedUserInterface) {
            return 
true;
        }

        return 
false;
    }
}

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ Read-Only ]

:: Make Dir ::
 
[ Read-Only ]
:: Make File ::
 
[ Read-Only ]

:: Go Dir ::
 
:: Go File ::
 

--[ c99shell v. 2.0 [PHP 7 Update] [25.02.2019] maintained by KaizenLouie | C99Shell Github | Generation time: 0.0926 ]--