!C99Shell v. 2.1 [PHP 8 Update] [02.02.2022]!

Software: Apache/2.4.53 (Unix) OpenSSL/1.1.1o PHP/7.4.29 mod_perl/2.0.12 Perl/v5.34.1. PHP/7.4.29 

uname -a: Linux vps-2738122-x 4.15.0-213-generic #224-Ubuntu SMP Mon Jun 19 13:30:12 UTC 2023 x86_64 

uid=1(daemon) gid=1(daemon) grupos=1(daemon) 

Safe-mode: OFF (not secure)

/opt/apex_tdfonline/php/3ros/simplesamlphp/modules/core/lib/   drwxr-xr-x
Free 11.89 GB of 61.93 GB (19.2%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Feedback    Self remove    Logout    


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


/**
 * Represents a definitino of a module.
 * Is usually read and parsed from a JSON definition file.
 *
 * @Author    Andreas Åkre Solberg, <andreas.solberg@uninett.no>
 */
class sspmod_core_ModuleDefinition {
    
    public 
$def;
    private static 
$cache;
    
    private function 
__construct($def) {
        
$this->def $def;
        
$this->requireValidIdentifier();
    }
    
    public static function 
validId($id) {
        return 
preg_match('|^[a-zA-Z_]+$|'$id);
    }
    
    public static function 
isDefined($id) {
        
$config SimpleSAML_Configuration::getConfig('config.php');
        
$basedir $config->getBaseDir();
        
$filename $basedir 'modules/' $id '/definition.json';
        return (
file_exists($filename));
    }
    
    public static function 
load($id$force NULL) {
        
        if (isset(
$cache[$id])) return $cache[$id];
        
        if (
self::validId($id)) {
            
$config SimpleSAML_Configuration::getConfig('config.php');
            
$basedir $config->getBaseDir();
            
$filename $basedir 'modules/' $id '/definition.json';
            if (!
file_exists($filename))
                throw new 
Exception('Could not read definition file for module [' $id '] : ' $filename);
            
$defraw file_get_contents($filename);
            
$def json_decode($defrawTRUE);
            
        } elseif(
preg_match('|^http(s)?://.*$|'$id)) {
            
$defraw file_get_contents($id);
            
$def json_decode($defrawTRUE);
        } else {
            throw new 
Exception('Could not resolve [' $id '] as URL nor module identifier.');
        }
        
$cache[$id] = new sspmod_core_ModuleDefinition($def);
        
        
        
        if (isset(
$force)) {
            if (
$force === 'local') {
                if(
preg_match('|^http(s)?://.*$|'$id)) {
                    return 
self::load($def['id']);
                }
            } elseif(
$force === 'remote') {
                if (
self::validId($id)) {
                    if (!isset(
$def['definition']))
                        throw new 
Exception('Could not load remote definition file for module [' $id ']');
                    return 
self::load($def['definition']);
                }
            }
        }
        
        return 
$cache[$id];
    }
    
    private function 
requireValidIdentifier() {
        if (!isset(
$this->def['id']))
            throw new 
Exception('Missing [id] value in module definition');
        if (!
preg_match('|^[a-zA-Z_]+$|'$this->def['id'])) 
            throw new 
Exception('Illegal characters in [id] in module definition');
    }
    
    public function 
getVersion($branch NULL) {
        if (!isset(
$this->def['access']))    throw new Exception('Missing [access] statement in module definition');
        if (!isset(
$this->def['branch']))    throw new Exception('Missing [branch] statement in module definition');
        
        if (
is_null($branch)) $branch $this->def['branch'];
        
        if (!isset(
$this->def['access'][$branch])) throw new Exception('Missing [access] information for branch [' var_export($branchTRUE) . ']');
        if (!isset(
$this->def['access'][$branch]['version'])) throw new Exception('Missing version information in [access] in branch [' var_export($branchTRUE) . ']');
        
        return 
$this->def['access'][$branch]['version'];
    }
    
    public function 
alwaysUpdate($branch NULL) {
        
$access $this->getAccess($branch);
        if (
$access['type'] === 'svn') return TRUE;
        return 
FALSE;
    }
    
    public function 
getBranch($branch NULL) {
        if (!isset(
$this->def['branch']))    throw new Exception('Missing [branch] statement in module definition');
        if (
is_null($branch)) $branch $this->def['branch'];
        return 
$branch;
    }
    
    public function 
updateExists($branch NULL) {
        
$branch $this->getBranch($branch);
        
        
$localDef self::load($this->def['id'], 'local');
        
$thisVersion $localDef->getVersion($branch);

        
$remoteDef self::load($this->def['definition'], 'remote');
        
$remoteVersion $remoteDef->getVersion($branch);
        
        
#echo ' Comparing versions local [' . $thisVersion . '] and remote [' . $remoteVersion . ']' . "\n";
        
        
return version_compare($remoteVersion$thisVersion'>');
    }
    
    
    public function 
getAccess($branch NULL) {
        if (!isset(
$this->def['access']))    throw new Exception('Missing [access] statement in module definition');
        if (!isset(
$this->def['branch']))    throw new Exception('Missing [branch] statement in module definition');
        
        if (
is_null($branch)) $branch $this->def['branch'];
        
        if (!isset(
$this->def['access'][$branch])) throw new Exception('Missing [access] information for branch [' var_export($branchTRUE) . ']');

        return 
$this->def['access'][$branch];
    }
    
    
}

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ Read-Only ]

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

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

--[ c99shell v. 2.1 [PHP 8 Update] [02.02.2022] maintained byC99Shell Github | Generation time: 0.5236 ]--