403Webshell
Server IP : 104.21.84.107  /  Your IP : 104.23.197.208
Web Server : Apache/2.4.63 (Ubuntu)
System : Linux adminpruebas-Virtual-Machine 6.14.0-37-generic #37-Ubuntu SMP PREEMPT_DYNAMIC Fri Nov 14 22:10:32 UTC 2025 x86_64
User : www-data ( 33)
PHP Version : 8.4.5
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /var/www/html/pregrados/mercadeo/media/system/js/fields/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /var/www/html/pregrados/mercadeo/media/system/js/fields//joomla-field-send-test-mail.js
((customElements, Joomla) => {
  class JoomlaFieldSendTestMail extends HTMLElement {
    // attributeChangedCallback(attr, oldValue, newValue) {}
    constructor() {
      super();
      if (!Joomla) {
        throw new Error('Joomla API is not properly initiated');
      }
      if (!this.getAttribute('uri')) {
        throw new Error('No valid url for validation');
      }
    }
    connectedCallback() {
      const self = this;
      const button = document.getElementById('sendtestmail');
      if (button) {
        button.addEventListener('click', () => {
          self.sendTestMail(self);
        });
      }
    }
    sendTestMail() {
      const emailData = {
        smtpauth: document.getElementById('jform_smtpauth1').checked ? 1 : 0,
        smtpuser: this.querySelector('[name="jform[smtpuser]"]').value,
        smtphost: this.querySelector('[name="jform[smtphost]"]').value,
        smtpsecure: this.querySelector('[name="jform[smtpsecure]"]').value,
        smtpport: this.querySelector('[name="jform[smtpport]"]').value,
        mailfrom: this.querySelector('[name="jform[mailfrom]"]').value,
        fromname: this.querySelector('[name="jform[fromname]"]').value,
        mailer: this.querySelector('[name="jform[mailer]"]').value,
        mailonline: document.getElementById('jform_mailonline1').checked ? 1 : 0
      };
      const smtppass = this.querySelector('[name="jform[smtppass]"]');
      if (smtppass.disabled === false) {
        emailData.smtppass = smtppass.value;
      }

      // Remove js messages, if they exist.
      Joomla.removeMessages();
      Joomla.request({
        url: this.getAttribute('uri'),
        method: 'POST',
        data: JSON.stringify(emailData),
        perform: true,
        headers: {
          'Content-Type': 'application/json'
        },
        onSuccess: resp => {
          let response;
          try {
            response = JSON.parse(resp);
          } catch (e) {
            // eslint-disable-next-line no-console
            console.error(e);
          }
          if (typeof response.messages === 'object' && response.messages !== null) {
            Joomla.renderMessages(response.messages);
          }
          document.body.scrollIntoView({
            behavior: 'smooth'
          });
        },
        onError: xhr => {
          Joomla.renderMessages(Joomla.ajaxErrorsMessages(xhr));
          document.body.scrollIntoView({
            behavior: 'smooth'
          });
        }
      });
    }
  }
  customElements.define('joomla-field-send-test-mail', JoomlaFieldSendTestMail);
})(customElements, Joomla);

Youez - 2016 - github.com/yon3zu
LinuXploit