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

Software: Apache/2.4.41 (Ubuntu). PHP/8.0.30 

uname -a: Linux apirnd 5.4.0-204-generic #224-Ubuntu SMP Thu Dec 5 13:38:28 UTC 2024 x86_64 

uid=33(www-data) gid=33(www-data) groups=33(www-data) 

Safe-mode: OFF (not secure)

/var/www/html/laravel-crm/packages/Webkul/Email/src/Repositories/   drwxrwxrwx
Free 12.97 GB of 57.97 GB (22.38%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


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

namespace Webkul\Email\Repositories;

use 
Illuminate\Container\Container;
use 
Webkul\Core\Eloquent\Repository;
use 
Webkul\Email\Contracts\Email;

class 
EmailRepository extends Repository
{
    public function 
__construct(
        protected 
AttachmentRepository $attachmentRepository,
        
Container $container
    
) {
        
parent::__construct($container);
    }

    
/**
     * Specify model class name.
     *
     * @return mixed
     */
    
public function model()
    {
        return 
Email::class;
    }

    
/**
     * Create.
     *
     * @return \Webkul\Email\Contracts\Email
     */
    
public function create(array $data)
    {
        
$uniqueId time().'@'.config('mail.domain');

        
$referenceIds = [];

        if (isset(
$data['parent_id'])) {
            
$parent parent::findOrFail($data['parent_id']);

            
$referenceIds $parent->reference_ids ?? [];
        }

        
$data $this->sanitizeEmails(array_merge([
            
'source'        => 'web',
            
'from'          => config('mail.from.address'),
            
'user_type'     => 'admin',
            
'folders'       => isset($data['is_draft']) ? ['draft'] : ['outbox'],
            
'unique_id'     => $uniqueId,
            
'message_id'    => $uniqueId,
            
'reference_ids' => array_merge($referenceIds, [$uniqueId]),
        ], 
$data));

        
$email parent::create($data);

        
$this->attachmentRepository->uploadAttachments($email$data);

        return 
$email;
    }

    
/**
     * Update.
     *
     * @param  int  $id
     * @param  string  $attribute
     * @return \Webkul\Email\Contracts\Email
     */
    
public function update(array $data$id$attribute 'id')
    {
        return 
parent::update($this->sanitizeEmails($data), $id);
    }

    
/**
     * Sanitize emails.
     *
     * @return array
     */
    
public function sanitizeEmails(array $data)
    {
        if (isset(
$data['reply_to'])) {
            
$data['reply_to'] = array_values(array_filter($data['reply_to']));
        }

        if (isset(
$data['cc'])) {
            
$data['cc'] = array_values(array_filter($data['cc']));
        }

        if (isset(
$data['bcc'])) {
            
$data['bcc'] = array_values(array_filter($data['bcc']));
        }

        return 
$data;
    }
}

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