1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 54: 55: 56: 57: 58: 59: 60: 61: 62: 63: 64: 65: 66: 67: 68: 69: 70: 71: 72: 73: 74: 75: 76: 77: 78: 79: 80: 81: 82: 83: 84: 85: 86: 87: 88: 89: 90: 91: 92: 93: 94: 95:
<?php
class PHPShopForma extends PHPShopCore {
function __construct() {
$this->debug = false;
$this->action = array("post" => "message", "nav" => "index");
parent::__construct();
$this->navigation(false, __(''));
}
function index() {
$this->title = __("") . " - " . $this->PHPShopSystem->getValue("name");
$this->set('pageTitle', __(''));
$this->addToTemplate("page/page_forma_list.tpl");
$this->parseTemplate($this->getValue('templates.page_page_list'));
}
function message() {
preg_match_all('/http:?/', $_POST['message'], $url, PREG_SET_ORDER);
if (!empty($_SESSION['text']) and strtoupper($_POST['key']) == strtoupper($_SESSION['text']) and strpos($_SERVER["HTTP_REFERER"], $_SERVER['SERVER_NAME']) and count($url)==0) {
$this->send();
} else {
$this->set('Error', __(""));
}
}
function send() {
PHPShopObj::loadClass("mail");
if (PHPShopSecurity::true_param($_POST['nameP'], $_POST['subject'], $_POST['message'], $_POST['mail'])) {
$zag = $_POST['subject'] . " - " . $this->PHPShopSystem->getValue('name');
$message = "" . $this->PHPShopSystem->getValue('name') . "
----------------------
";
foreach ($_POST as $k => $val) {
$message.=$val . "
";
unset($_POST[$k]);
}
$message.="
" . date("d-m-y H:s a") . "
IP: " . $_SERVER['REMOTE_ADDR'] ;
new PHPShopMail($this->PHPShopSystem->getEmail(), $this->PHPShopSystem->getEmail(), $zag, $message, false, false, array('replyto' => $_POST['mail']));
$this->set('Error', __(""));
}
else
$this->set('Error', __(""));
}
}
?>