Done !
| Server IP : 46.105.57.169 / Your IP : 216.73.216.67 Web Server : Apache System : Linux webm002.cluster120.gra.hosting.ovh.net 6.18.42-ovh-vps-grsec-zfs+ #1 SMP PREEMPT_DYNAMIC Wed Aug 5 15:59:48 CEST 2026 x86_64 User : verseaumee ( 152031) PHP Version : 8.5.7 Disable Function : _dyuweyrj4,_dyuweyrj4r,dl MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/verseaumee/www/components/com_blue_pagebuilder/controllers/ |
Upload File : |
<?php
/**
* @package Joomla.Administrator
* @subpackage com_book
*
* @copyright Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
jimport('joomla.application.component.controlleradmin');
/**
* Component Controller
*
* @package Joomla.Administrator
* @subpackage com_book
*/
class Blue_pagebuilderControllerPage extends JControllerAdmin
{
public function __construct($config = array())
{
parent::__construct($config);
}
public function getModel($name = 'Client', $prefix = 'Blue_pagebuilderModel', $config = array('ignore_request' => true))
{
$model = parent::getModel($name, $prefix, $config);
return $model;
}
public function contact(){
$app = JFactory::getApplication();
$params_site = $app->getTemplate(true)->params;
if($params_site->get('stateggcaptcha') == '1' && $params_site->get('captchasecret') && $params_site->get('captchasitekey')){
$captcha = true;
}
else
$captcha = false;
$mailfrom = $app->getCfg('mailfrom');
$fromname = $app->getCfg('fromname');
$emailauthor = JRequest::getVar("emailauthor");
// Get Input
$name = JRequest::getVar("name");
$email = JRequest::getVar("email");
$phone = JRequest::getVar("phone");
$message = JRequest::getVar("message");
$subject = JRequest::getVar("subject");
$thankyou = JRequest::getVar("thanks");
$website = JRequest::getVar("website");
$celular = JRequest::getVar("celular");
$re_verify = JRequest::getVar("verify");
if(trim($emailauthor)){
$mailfrom = $emailauthor;
}
$prefix = JText::sprintf('This is an enquiry email via %s from:', JUri::base());
$body = "{$prefix} \n\n";
$body.="{$name} <{$email}> \n";
if($name != ''){
$body .= '<p>Name: ' .$name .'</p>';
}
if($email != ''){
$body .= '<p>Email: ' .$email .'</p>';
}
if($phone != ''){
$body .= '<p>Phone: ' .$phone .'</p>';
}
if($subject != ''){
$body .= '<p>Subject: ' .$subject .'</p>';
}
if($celular!=""){
$body .= '<p>Celular: ' .$celular .'</p>';
}
$body.="\r\n\r\n\r\n".stripslashes($message);
if ($captcha) {
$params = array();
$params['secret'] = $params_site->get('captchasecret'); // Secret key
if (!empty($_POST) && isset($_POST['g-recaptcha-response'])) {
$params['response'] = urlencode($_POST['g-recaptcha-response']);
}
$params['remoteip'] = $_SERVER['REMOTE_ADDR'];
$response = file_get_contents("https://www.google.com/recaptcha/api/siteverify?secret=".$params['secret']."&response=".$params['response']."&remoteip=".$_SERVER['REMOTE_ADDR']);
$response = @json_decode($response, true);
if ($response["success"] == false) {
$mes = 'Captcha Error';
echo json_encode(array("check"=>0,"message"=>$mes));
die();
}
}
$mail = JFactory::getMailer();
$mail->addRecipient($mailfrom);
$mail->setSender(array($mailfrom, $fromname));
$mail->setSubject($subject);
$mail->setBody($body);
if(is_array($_FILES)) {
$mail->AddAttachment($_FILES['uploaded_file']['tmp_name'],$_FILES['uploaded_file']['name']);
}
$mail->isHTML(true);
$sent = $mail->Send();
$mes = (string)$sent;
if (!($sent instanceof Exception)){
echo json_encode(array("check"=>1,"message"=>$thankyou));
}else{
echo json_encode(array("check"=>0,"message"=>$mes));
}
die();
}
}