!C99Shell v.2.1 [PHP 7 Update] [1.12.2019]!

Software: Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips PHP/5.4.16. PHP/5.4.16 

uname -a: Linux roko-bkp 3.10.0-1160.102.1.el7.x86_64 #1 SMP Tue Oct 17 15:42:21 UTC 2023 x86_64 

uid=48(apache) gid=48(apache) groups=48(apache),1003(webmaster) 

Safe-mode: OFF (not secure)

/var/www/html/lib/tinymce/plugins/ajaxfilemanager/inc/   drwxr-xr-x
Free 9.28 GB of 93.48 GB (9.93%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Feedback    Self remove    Logout    


Viewing file:     class.search.php (5.17 KB)      -rwxr-xr-x
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php
    
include_once(CLASS_FILE);
    require_once(
CLASS_SESSION_ACTION);
    require_once(
CLASS_MANAGER);
    class 
search
    
{
        var 
$rootFolder '';
        var 
$files = array();
        var 
$rootFolderInfo = array();
        var 
$searchkeywords = array(
            
'mtime_from'=>'',
            
'mtime_to'=>'',
            
'name'=>'',
            
'size_from'=>'',
            
'size_to'=>'',
            
'recursive'=>'0',
            
        );
        var 
$sessionAction null;
        
/**
         * constructor
         *
         * @param string $rootFolder
         */
        
function __construct($rootFolder)
        {
            
$this->rootFolder $rootFolder;
            
$this->sessionAction = new SessionAction();
            
$objRootFolder = new file($this->rootFolder);
            
$tem $objRootFolder->getFileInfo();
            
$obj = new manager($this->rootFolderfalse);            
            
$obj->setSessionAction($this->sessionAction);
            
$selectedDocuments $this->sessionAction->get();                    
            
$fileType $obj->getFolderInfo($this->rootFolder);
            
            foreach(
$fileType as $k=>$v)
            {
                
$tem[$k] = $v;
            }
            
            
$tem['path'] = backslashToSlash($this->rootFolder);        
            
$tem['type'] = (is_dir($this->rootFolder)?'folder':'file');
            
$tem['size'] = (is_dir($this->rootFolder)?'':transformFileSize(@filesize($this->rootFolder)));
            
//$tem['ctime'] = date(DATE_TIME_FORMAT, $tem['ctime']);
            //$tem['mtime'] = date(DATE_TIME_FORMAT, $tem['mtime']);
            
$tem['flag'] = (array_search($tem['path'], $selectedDocuments) !== false?($this->sessionAction->getAction() == "copy"?'copyFlag':'cutFlag'):'noFlag');
            
$tem['url'] = getFileUrl($this->rootFolder);
            
$tem['friendly_path'] = transformFilePath($this->rootFolder);
            
$tem['file'] = 0;
            
$tem['subdir'] = 0;
            
$manager null;
            
$this->rootFolderInfo $tem;
            
$tem null;            
        }
        
        
        
        
/**
         * constructor
         *
         * @param string $rootFolder
         */
        
function Search($rootFolder)
        {
            
$this->__construct($rootFolder);
        }

        
/**
         * change the search keyword individually
         *
         * @param string $key
         * @param string $value
         */
        
function addSearchKeyword($key$value)
        {
            
$this->searchkeywords[$key] = $value;
        }
        
/**
         * change the search keywords 
         *
         * @param array $keywords
         */
        
function addSearchKeywords($keywords)
        {
            foreach(
$this->searchkeywords as $k=>$v)
            {
                if(
array_key_exists($k$keywords) !== false)
                {
                    
$this->searchkeywords[$k] = $keywords[$k];
                }
            }
        }
        
/**
         * get the file according to the search keywords
         *
         */
        
function doSearch($baseFolderPath null)
        {
            
            
$baseFolderPath addTrailingSlash(backslashToSlash((is_null($baseFolderPath)?$this->rootFolder:$baseFolderPath)));
            
            
$dirHandler = @opendir($baseFolderPath);
            if(
$dirHandler)
            {
                while(
false !== ($file readdir($dirHandler)))
                {
                    if(
$file != '.' && $file != '..')
                    {
                        
$path $baseFolderPath $file;
                        if(
is_file($path))
                        {
                            
$isValid true;

                            
$fileTime = @filemtime($path);
                            
$fileSize = @filesize($path);
                            if(
$this->searchkeywords['name'] !== ''  && @eregi($this->searchkeywords['name'], $file) === false)
                            {
                                
$isValid false;
                            }
                            if(
$this->searchkeywords['mtime_from'] != '' && $fileTime < @strtotime($this->searchkeywords['mtime_from']))
                            {
                                
$isValid false;
                            }
                            if(
$this->searchkeywords['mtime_to'] != '' && $fileTime > @strtotime($this->searchkeywords['mtime_to']))
                            {
                                
$isValid false;
                            }                            
                            if(
$this->searchkeywords['size_from'] != '' && $fileSize < @strtotime($this->searchkeywords['size_from']))
                            {
                                
$isValid false;
                            }
                            if(
$this->searchkeywords['size_to'] != '' && $fileSize > @strtotime($this->searchkeywords['size_to']))
                            {
                                
$isValid false;
                            }            
                            if(
$isValid && isListingDocument($path))
                            {
                                
$finalPath $path;
                                
$objFile = new file($finalPath);
                                
$tem $objFile->getFileInfo();
                                
$obj = new manager($finalPathfalse);            
                                
$obj->setSessionAction($this->sessionAction);
                                
$selectedDocuments $this->sessionAction->get();                                                    
                                
$fileType $obj->getFileType($finalPath);
                                
                                foreach(
$fileType as $k=>$v)
                                {
                                    
$tem[$k] = $v;
                                }
                                
                                
$tem['path'] = backslashToSlash($finalPath);        
                                
$tem['type'] = (is_dir($finalPath)?'folder':'file');
                                
$tem['size'] = transformFileSize($tem['size']);
                                
$tem['ctime'] = date(DATE_TIME_FORMAT$tem['ctime']);
                                
$tem['mtime'] = date(DATE_TIME_FORMAT$tem['mtime']);
                                
$tem['flag'] = (array_search($tem['path'], $selectedDocuments) !== false?($this->sessionAction->getAction() == "copy"?'copyFlag':'cutFlag'):'noFlag');
                                
$tem['url'] = getFileUrl($tem['path']);
                                
$this->rootFolderInfo['file']++;
                                
$manager null;
                                
$this->files[] = $tem;
                                
$tem null;                                
                            }
                        }elseif(
is_dir($path) && $this->searchkeywords['recursive'])
                        {
                            
$this->Search($baseFolderPath);
                        }
                    }
                }
            }
             
        }
        
        function 
getFoundFiles()
        {
            return 
$this->files;
        }
        
        function 
getRootFolderInfo()
        {

            return 
$this->rootFolderInfo;
        }
    }
?>

:: 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 7 Update] [1.12.2019] maintained by KaizenLouie and updated by cermmik | C99Shell Github (MySQL update) | Generation time: 0.004 ]--