Files
vidok.com/plugins/special-actions-middle.php

461 lines
19 KiB
PHP

<?
$spam_words = [
'go.tazalus.com', 'porn', 'dating','hierbalimon.es', 'bodyandsoul', 'promo', 'puertobelenn', 'faiterde.tk', 'tygyguip', 'maritim-touristik', 'toolbarqueries', 'allnews.elk.pl', 'fuck', 'delicatedate.net', 'allcnews.xyz', 'allcryptonnews', 'hinebixi.com', 'obermatsa', 'hilkom-digital.de', 'monkeydigital.co', 'CrytoPRove', 'no-site.com', 'strictlydigital', 'youtu.be', 'wilhetiperbe', 'blogspot.com', 'suck', 'dana@parkcitynursery.com', 'suqomuaq.com', 'semrush', 'diryjyaz.com', 'obermatsa.com', 'hinebixi.com', 'rarealnojahr.gq', 'JoneButts15@aol.com', 'as-sports.net', 'course-fitness.com', 'pearltrees.com', 'taisiya.alximowa@mail.ru', 'advanceleadgeneration.com', 'ipad-kupit.ru', 'tinyurl.com', 'birgitschafer37@gmail.com', 'rgzd8r8b@hotmail.com', '052vz709@gmail.com', 'zelatcol@gmail.com', 'wm8o82ee@yahoo.com', 'egoo9760@icloud.com', 'no-replyKi@gmail.com', 'hacker@acharkala.com', 'osii@eff.effect.edu.pl', 'eqwdp1x2@gmail.com', 'stanglpeter@yahoo.de', 'schindelimmobilien@gmail.com', 'financy@gmx.de', 'zelatcol@gmail.com', 'stroybud.com', 'jumboleadmagnet.com', 'bynd.li', 'ps-iphone.ru', 'mailbanger.com', 'rabota-ot-150-tmes.info', 'klvcennik.ru' , 'jay.abby73@gmail.com', 'senler.ru', 'seocdvig.ru', 'seoprofisional.ru', 'tofeat.com', 'racetrack.top', 'elmare.ru', 'mailbanger.com', 'mjsanaokulu.com', 'a-site.top', 'daqlutavut@outlook.com', 'transfer358.com', 'fb-restriction-case125326754@outlook.com', 'no-replyKi@gmail.com', 'urcilovasil676@gmail.com', 'koame@rambler.ua', 'werso061700iu@rambler.ru', 'christinaseak@nancywhalen.com', 'elenaseak@mphtcommercial.com', '2214ro438y@funny3delements.com', 'irin4@pop33.site', 'daqlutavut@outlook.com', 'daqlutavut@outlook.com','cesar.mancuello@cialpa.com.py', 'werso062000iu@rambler.ru', 'leada2z70@gmail.com', 'k.e.i.t.h.y.2.a.r.terberryrl@gmail.com', 'darya.shubina.73@mail.ru', 'gw2920339@gmail.com', 'laine@thaimail.live', 'swolerhozolicab@gmx.com', 'frcites@yandex.com', 'dawna.box92@gmail.com', '8026e@1tetris.ru', '2@inrus.top', 'ganribenes@outlook.com', 'werso078200iu@rambler.ru', 'killderrfassser@rambler.ru', '4@hamechizaban.ir', 'goddosbim@rambler.ru', 'knox@longago.pics', 'www.yandex.ru', 'kuznetsov_vlad_1995_18_12@inbox.ru', 'shkola-24@hotmail.com', 'multik-pic.online', '980zo@1tetris.ru', 'MalkaBin@pochtaserver.com', 'q4p62nzh4f@ir.tvtap.fun', 'af775188@gmail.com', 'mubcamesiy@outlook.com', 'cqurys@outlook.com', 'joe_stiffy@jerseyshoreelectric.com', 'maximmad222@yandex.ru', 'JohnieByrnes420@aol.com', 'maltusjohn@gmail.com', 'lion.pirogoff@yandex.ru', 'admin@antapexhealthcare.com', 'kristan@vidok.com', 'xrumak@outlook.com', 'pws.appliance@gmail.com', 'shopmarketplus@gmail.com', 'skupka@avio.pochtas.ru', 'info@coachkorey.ru', 'waldemar-polak-67@wp.pl', 'wgqp9ouy0l@fhz.tvtap.fun', 'ljykyln6vs@sce.tvtap.fun', 'mirtewe@rambler.ua', 'support@egyvps.com', 'info@chasy39.ru', 'yamamamsfdsfdsfds@gmail.ru', 'maximmad222@yandex.ru', 'golubitskayabeatrisa@yandex.com', 'joe@ecomvisibility.com', 'agnessavolkova@seobomba.com', 'weytefuhaj@outlook.com', 'temptest758300173@gmail.com', 'nuzresaviq@outlook.com', 'keith.y.2.a.r.t.e.r.b.e.r.r.y.r.l.@gmail.com', 'af431532@gmail.com', 'lidiasamoilov4lidiya@yandex.ru', 'jamesgennickjames@gmail.com', 'medfishrib@rambler.ru', 'fdsfhdsjkfhdjskfjdsfnjkerfjkdsbf34h5u435y43uiry87efcys@gmail.com', 'dinfekciya@yandex.ru', 'osii@eff.effect.edu.pl', 'isabellaloX@purina-smell.com', 'alenaloX@rosalind-2.com', 'anudfaoaymn@bobbor.store', 'lkskxtdecmn@bobbor.store', 'bob345@posti8.site', 'sonia34@pop33.site', 'ugapalhrvmn@bobbor.store', 'frigtusolinufib', 'zokkedubiq@outlook.com', 'finley@vidok.com', 'vova80918@mail.ru', 'mikecitnipse@gmail.com', 'xxzssrznxmn@bobbor.store', 'katia@posti8.site', 'rambler.ua', 'martalyd7@zohomail.eu' ];
function strposa( $haystack, $needles = array(), $offset = 0 ) {
$chr = array();
foreach ( $needles as $needle ) {
$res = strpos($haystack, $needle, $offset);
if ($res !== false) $chr[$needle] = $res;
}
if ( empty($chr) )
return false;
return min($chr);
}
function saveContactData(
$name = '',
$email = '',
$phone = '',
$message = '',
$zip = '',
$title = '',
$company = '',
$invoiceNumber = '',
$address = '',
$formId = '') {
$contactHistoryFile = $_SERVER['DOCUMENT_ROOT'] . '/autoinstalator/wordpress9/contact.csv';
$contactData = array(
'Name' => str_replace( [ '\'', '"' ], '', $name ),
'Email' => str_replace( [ '\'', '"' ], '', $email ),
'Phone' => str_replace( [ '\'', '"' ], '', $phone ),
'Message' => str_replace( [ "\n", "\r\n", "\r" ], ' ', str_replace( [ '\'', '"' ], '', $message ) ),
'Zip_code' => str_replace( [ '\'', '"' ], '', $zip ),
'Topic' => str_replace( [ '\'', '"' ], '', $title ),
'Company' => str_replace( [ '\'', '"' ], '', $company ),
'Invoice_number' => str_replace( [ '\'', '"' ], '', $invoiceNumber ),
'Address' => str_replace( [ '\'', '"' ], '', $address ),
'Timestamp' => date('Y-m-d H:i:s', time()),
'Form_id' => str_replace( [ '\'', '"' ], '', $formId ),
);
if (!file_exists($contactHistoryFile)) {
$header = array_keys($contactData);
$history = array($header);
} else {
$history = array_map('str_getcsv', file($contactHistoryFile));
}
$history[] = $contactData;
$csvContent = fopen($contactHistoryFile, 'w');
foreach ($history as $row) {
fputcsv($csvContent, $row);
}
fclose($csvContent);
}
if ( \S::get( 'action' ) == 'send-contact' and \S::get( 'token' ) == \S::get_session( 'send-contact-token' ) and !\S::get( 'website' ) )
{
if(isset($_POST['g-recaptcha-response'])){
$captcha=$_POST['g-recaptcha-response'];
}
if(!$captcha){
\S::alert( "Weryfikacja reCaptcha nie powiodła się. Proszę spróbować ponownie." );
header( 'Location: ' . $_SERVER['REQUEST_URI'] );
exit;
}
$secretKey = "6LfaovglAAAAAAz84QLdbONodP1yJUpSOVTnFMt4";
$ip = $_SERVER['REMOTE_ADDR'];
// post request to server
$url = 'https://www.google.com/recaptcha/api/siteverify?secret=' . urlencode($secretKey) . '&response=' . urlencode($captcha);
$response = file_get_contents($url);
$responseKeys = json_decode($response,true);
// should return JSON with success as true
if($responseKeys["success"]) {
if (
\S::get( 'inputTitle' )
and
\S::get( 'inputName' )
and
\S::get( 'inputEmail' )
and
\S::get( 'message' )
and
strposa( \S::get( 'inputTitle' ), $spam_words ) === false
and
strposa( \S::get( 'inputName' ), $spam_words ) === false
and
strposa( \S::get( 'inputEmail' ), $spam_words ) === false
and
\S::get( 'message' ) )
{
$text = '<p><b>Temat:</b> ' . \S::get( 'inputTitle' ) . '</p>';
$text .= '<p><b>Imię i nazwisko:</b> ' . \S::get( 'inputName' ) . '</p>';
$text .= '<p><b>Email:</b> ' . \S::get( 'inputEmail' ) . '</p>';
$text .= '<p><b>Wiadomość:</b> ' . nl2br(\S::get('message')) . '</p>';
$text .= '<p style="font-size: 13px; color: #ccc; margin-top: 50px;"><b>Wysłano:</b> ' . date( 'Y-m-d H:i:s' ) . '</p>';
saveContactData(
\S::get( 'inputName' ),
\S::get( 'inputEmail' ),
'',
\S::get('message'),
'',
\S::get( 'inputTitle' ),
'',
'',
'',
'contact'
);
if ( \S::send_email( 'marketing@vidok.com', 'Wiadomość ze strony vidok.com', $text, \S::get('email'), $files_to_send ) )
{
// send copy to k.zarzyczny@vidok.com
\S::send_email( 'k.zarzyczny@vidok.com', 'Wiadomość ze strony vidok.com', $text, \S::get('email'), $files_to_send );
\S::alert( \S::lang( 'wiadomosc-zostala-wyslana' ) );
}
else
\S::alert( \S::lang( 'wiadomosc-niezostala-wyslana' ) );
}
else
{
\S::alert( \S::lang( 'wiadomosc-niezostala-wyslana' ) );
}
} else {
\S::alert( "Jesteś robotem!" );
}
header( 'Location: ' . $_SERVER['REQUEST_URI'] );
exit;
}
if ( \S::get('action') == 'send-contact-modal' and \S::get( 'token' ) == \S::get_session( 'modal-token' ) and !\S::get( 'website' ) )
{
$captcha = $_POST['g-recaptcha-response'] ?? null;
if (!$captcha) {
\S::alert("Weryfikacja reCaptcha nie powiodła się. Proszę spróbować ponownie.");
header('Location: ' . $_SERVER['REQUEST_URI']);
exit;
}
$secretKey = "6LfaovglAAAAAAz84QLdbONodP1yJUpSOVTnFMt4";
$url = 'https://www.google.com/recaptcha/api/siteverify?secret=' . urlencode($secretKey) . '&response=' . urlencode($captcha);
$response = file_get_contents($url);
$responseKeys = json_decode($response, true);
if (!$responseKeys['success']) {
\S::alert("Jesteś robotem!");
header('Location: ' . $_SERVER['REQUEST_URI']);
exit;
}
$countfiles = count($_FILES['files']['name']);
for ($i = 0; $i < $countfiles; $i++)
{
$filename = $_FILES['files']['name'][$i];
if ($filename and pathinfo( $_FILES['files']['name'][$i], PATHINFO_EXTENSION ) != 'php' )
{
move_uploaded_file($_FILES['files']['tmp_name'][$i], 'temp/' . $filename);
$files_to_send[] = 'temp/' . $filename;
}
}
if (
\S::get( 'name' )
and
\S::get( 'email' )
and
\S::get( 'address' )
and
\S::get( 'phone' )
and
\S::get( 'information' )
and
strposa( \S::get( 'name' ), $spam_words ) === false
and
strposa( \S::get( 'email' ), $spam_words ) === false
and
strposa( \S::get( 'address' ), $spam_words ) === false
and
strposa( \S::get( 'phone' ), $spam_words ) === false
and
strposa( \S::get( 'information' ), $spam_words ) === false )
{
$text = '<p><b>Imię:</b> ' . \S::get('name') . '</p>';
$text .= '<p><b>Email:</b> ' . \S::get('email') . '</p>';
$text .= '<p><b>Kod pocztowy:</b> ' . \S::get('address') . '</p>';
$text .= '<p><b>Telefon:</b> ' . \S::get('phone') . '</p>';
$text .= '<p><b>Wiadomość:</b> ' . nl2br(\S::get('information')) . '</p>';
$text .= '<p><b>wymiary swojej stolarki:</b> ' . nl2br(\S::get('wymiaryStolarki')) . '</p>';
$text .= '<p style="font-size: 13px; color: #ccc; margin-top: 50px;"><b>Wysłano:</b> ' . date( 'Y-m-d H:i:s' ) . '</p>';
saveContactData(
\S::get('name'),
\S::get('email'),
\S::get('phone'),
\S::get('information'),
\S::get('address'),
'',
'',
'',
'',
'modal-contact-form'
);
if ( \S::send_email( 'marketing@vidok.com', 'Wiadomość ze strony vidok.com', $text, \S::get('email'), $files_to_send ) )
{
// send copy to k.zarzyczny@vidok.com
\S::send_email( 'k.zarzyczny@vidok.com', 'Wiadomość ze strony vidok.com', $text, \S::get('email'), $files_to_send );
\S::alert( \S::lang('wiadomosc-zostala-wyslana' ) );
header('Location: ' . $_SERVER['REQUEST_URI'] . '?modal_form_sent=1');
}
else
\S::alert( \S::lang('wiadomosc-niezostala-wyslana' ) );
}
else
\S::alert( \S::lang('wiadomosc-niezostala-wyslana' ) );
header('Location: ' . $_SERVER['REQUEST_URI']);
exit;
}
if ( \S::get( 'action' ) == 'send-services' and \S::get( 'token' ) == \S::get_session( 'form-token' ) and !\S::get( 'website' ) )
{
if (
\S::get( 'inputName' )
and
\S::get( 'inputEmail' )
and
\S::get( 'inputContactNumber' )
and
\S::get( 'inputInvoiceNumber' )
and
\S::get( 'inputAdres' )
and
\S::get( 'message' )
and
strposa( \S::get( 'inputName' ), $spam_words ) === false
and
strposa( \S::get( 'inputEmail' ), $spam_words ) === false
and
strposa( \S::get( 'inputContactNumber' ), $spam_words ) === false
and
strposa( \S::get( 'inputInvoiceNumber' ), $spam_words ) === false
and
strposa( \S::get( 'inputAdres' ), $spam_words ) === false
and
strposa( \S::get( 'message' ), $spam_words ) === false
)
{
$text .= '<p><b>Nazwa firmy:</b> ' . \S::get( 'inputCompanyName' ) . '</p>';
$text .= '<p><b>Imię i nazwisko:</b> ' . \S::get( 'inputName' ) . '</p>';
$text .= '<p><b>Numer faktury sprzedażowej:</b> ' . \S::get( 'inputInvoiceNumber' ) . '</p>';
$text .= '<p><b>Numer kontaktowy:</b> ' . \S::get( 'inputContactNumber' ) . '</p>';
$text .= '<p><b>Email:</b> ' . \S::get( 'inputEmail' ) . '</p>';
$text .= '<p><b>Adres zgłoszenia:</b> ' . \S::get( 'inputAdres' ) . '</p>';
$text .= '<p><b>Opis zgłoszenia:</b> ' . nl2br(\S::get('message')) . '</p>';
$text .= '<p style="font-size: 13px; color: #ccc; margin-top: 50px;"><b>Wysłano:</b> ' . date( 'Y-m-d H:i:s' ) . '</p>';
$msg = '<p><b> Dziękujemy za kontakt z działem Serwisu i Reklamacji VIDOK.</b></p><p><b> Zgłoszenie ma obecnie status „rozpoczęte” i zostało zarejestrowane w naszej bazie danych. W przeciągu 5 dni roboczych, pracownik działu serwisu skontaktuje się z Państwem w celu informacji o statusie zgłoszenia.</b></p>';
saveContactData(
\S::get( 'inputName' ),
\S::get( 'inputEmail' ),
\S::get( 'inputContactNumber' ),
\S::get('message'),
'',
'',
\S::get( 'inputCompanyName' ),
\S::get( 'inputInvoiceNumber' ),
\S::get( 'inputAdres' ),
'services form'
);
if ( \S::send_email( 'zgloszenia@vidok.com', 'Wiadomość ze strony vidok.com', $text, \S::get('email'), $files_to_send ) )
{
\S::send_email( 'serwis@vidok.com', 'Wiadomość ze strony vidok.com', $text, \S::get('email'), $files_to_send );
\S::send_email( \S::get( 'inputEmail' ), 'Wiadomość ze strony vidok.com',$msg, );
\S::alert( \S::lang( 'wiadomosc-zostala-wyslana' ) );
}
else
\S::alert( \S::lang( 'wiadomosc-niezostala-wyslana' ) );
}
else
\S::alert( \S::lang( 'wiadomosc-niezostala-wyslana' ) );
header( 'Location: ' . $_SERVER['REQUEST_URI'] );
exit;
}
if ( \S::get('action') == 'send-contact-landing' and \S::get( 'token' ) == \S::get_session( 'landing-token' ) and !\S::get( 'website' ) )
{
$countfiles = count($_FILES['files']['name']);
for ($i = 0; $i < $countfiles; $i++)
{
$filename = $_FILES['files']['name'][$i];
if ($filename and pathinfo( $_FILES['files']['name'][$i], PATHINFO_EXTENSION ) != 'php' )
{
move_uploaded_file($_FILES['files']['tmp_name'][$i], 'temp/' . $filename);
$files_to_send[] = 'temp/' . $filename;
}
}
if (
\S::get( 'name' )
and
\S::get( 'email' )
and
\S::get( 'address' )
and
\S::get( 'phone' )
and
\S::get( 'information' )
and
strposa( \S::get( 'name' ), $spam_words ) === false
and
strposa( \S::get( 'email' ), $spam_words ) === false
and
strposa( \S::get( 'address' ), $spam_words ) === false
and
strposa( \S::get( 'phone' ), $spam_words ) === false
and
strposa( \S::get( 'information' ), $spam_words ) === false
)
{
$text = '<p><b>Imię:</b> ' . \S::get('name') . '</p>';
$text .= '<p><b>Email:</b> ' . \S::get('email') . '</p>';
$text .= '<p><b>Kod pocztowy:</b> ' . \S::get('address') . '</p>';
$text .= '<p><b>Telefon:</b> ' . \S::get('phone') . '</p>';
$text .= '<p><b>Wiadomość:</b> ' . nl2br(\S::get('information')) . '</p>';
$text .= '<p style="font-size: 13px; color: #ccc; margin-top: 50px;"><b>Wysłano:</b> ' . date( 'Y-m-d H:i:s' ) . '</p>';
saveContactData(
\S::get('name'),
\S::get('email'),
\S::get('phone'),
\S::get('information'),
\S::get('address'),
'',
'',
'',
'',
'landing form'
);
if ( \S::send_email( 'marketing@vidok.com', 'Wiadomość ze strony vidok.com', $text, \S::get('email'), $files_to_send ) )
{
// send copy to k.zarzyczny@vidok.com
\S::send_email( 'k.zarzyczny@vidok.com', 'Wiadomość ze strony vidok.com', $text, \S::get('email'), $files_to_send );
\S::alert( \S::lang('wiadomosc-zostala-wyslana' ) );
}
else{
\S::alert( \S::lang('wiadomosc-niezostala-wyslana' ) );
}
}
else
\S::alert( \S::lang('wiadomosc-niezostala-wyslana' ) );
\S::set_session( 'landing-sended', true );
header('Location: ' . $_SERVER['REQUEST_URI']);
exit;
}
if ( \S::get('action') == 'send-contact-form-new' and \S::get( 'token' ) == \S::get_session( 'contact-form-token' ) and !\S::get( 'website' ) )
{
if(isset($_POST['g-recaptcha-response'])){
$captcha=$_POST['g-recaptcha-response'];
}
if(!$captcha){
\S::alert( "Weryfikacja reCaptcha nie powiodła się. Proszę spróbować ponownie." );
header( 'Location: ' . $_SERVER['REQUEST_URI'] );
exit;
}
$secretKey = "6LfaovglAAAAAAz84QLdbONodP1yJUpSOVTnFMt4";
$ip = $_SERVER['REMOTE_ADDR'];
// post request to server
$url = 'https://www.google.com/recaptcha/api/siteverify?secret=' . urlencode($secretKey) . '&response=' . urlencode($captcha);
$response = file_get_contents($url);
$responseKeys = json_decode($response,true);
// should return JSON with success as true
if($responseKeys["success"]) {
$countfiles = count($_FILES['files']['name']);
for ($i = 0; $i < $countfiles; $i++)
{
$filename = $_FILES['files']['name'][$i];
if ($filename and pathinfo( $_FILES['files']['name'][$i], PATHINFO_EXTENSION ) != 'php' )
{
move_uploaded_file($_FILES['files']['tmp_name'][$i], 'temp/' . $filename);
$files_to_send[] = 'temp/' . $filename;
}
}
if (
\S::get( 'name' )
and
\S::get( 'email' )
and
\S::get( 'postal_code' )
and
\S::get( 'phone' )
and
\S::get( 'voivodeship' )
and
\S::get( 'client' )
and
strposa( \S::get( 'name' ), $spam_words ) === false
and
strposa( \S::get( 'email' ), $spam_words ) === false
and
strposa( \S::get( 'postal_code' ), $spam_words ) === false
and
strposa( \S::get( 'phone' ), $spam_words ) === false
and
strposa( \S::get( 'message' ), $spam_words ) === false )
{
$text = '<p><b>Imię:</b> ' . \S::get('name') . '</p>';
$text .= '<p><b>Email:</b> ' . \S::get('email') . '</p>';
$text .= '<p><b>Kod pocztowy:</b> ' . \S::get('postal_code') . '</p>';
$text .= '<p><b>Województwo:</b> ' . \S::get('voivodeship') . '</p>';
$text .= '<p><b>Klient:</b> ' . \S::get('client') . '</p>';
$text .= '<p><b>Telefon:</b> ' . \S::get('phone') . '</p>';
$text .= '<p><b>Wiadomość:</b> ' . nl2br(\S::get('message')) . '</p>';
$text .= '<p style="font-size: 13px; color: #ccc; margin-top: 50px;"><b>Wysłano:</b> ' . date( 'Y-m-d H:i:s' ) . '</p>';
saveContactData(
\S::get('name'),
\S::get('email'),
\S::get('phone'),
\S::get('message'),
\S::get('postal_code'),
'',
'',
'',
'',
'contact-form'
);
if ( \S::send_email( 'marketing@vidok.com', 'Wiadomość ze strony vidok.com', $text, \S::get('email'), $files_to_send ) )
{
// send copy to k.zarzyczny@vidok.com
\S::send_email( 'k.zarzyczny@vidok.com', 'Wiadomość ze strony vidok.com', $text, \S::get('email'), $files_to_send );
\S::alert( \S::lang('wiadomosc-zostala-wyslana' ) );
header('Location: ' . $_SERVER['REQUEST_URI'] . '?form_sent=1');
exit;
}
else
\S::alert( \S::lang('wiadomosc-niezostala-wyslana' ) );
}
else
\S::alert( \S::lang('wiadomosc-niezostala-wyslana' ) );
} else {
\S::alert( "Jesteś robotem!" );
}
header( 'Location: ' . $_SERVER['REQUEST_URI'] );
exit;
}