[Thu Jul 11 02:47:10 2019] [warn] [client 85.175.29.83] mod_fcgid: stderr: PHP Notice: A session had already been started - ignoring session_start() in /var/www/site/data/www/site.ru/include/form.php on line 12, referer: https://moskovskaya-oblast.site.ru/
function my_session_start() {
global $settings;
$session_name = session_name("oxss");
if(($settings['enable_locations'] && $settings['enable_subdomains'])) {
global $main_domain;
session_set_cookie_params(0, '/', '.'.$main_domain);
}
session_start();
}
function setMainDomain() {
global $config_live_site, $main_domain;
$dstr = str_replace("http://www.", "", $config_live_site);
$dstr = str_replace("http://", "", $dstr);
$dstr = str_replace("https://www.", "", $dstr);
$dstr = str_replace("https://", "", $dstr);
// $dstr = str_replace("https://www.", "", $config_live_site);
// $dstr = str_replace("https://", "", $dstr);
// normal domain name domain.com
$tld_pattern1 = "/^([A-Za-z0-9.-]+(\.))?[A-Za-z0-9.-]+(\.)[A-Za-z]{2,6}(.*)?$/";
$composed_tlds = "co.uk|co.za|com.ua|com.au|com.tw|com.mx|com.br|co.sw|co.nz|com.de|com.ng|com.ph";
// domain name with a composed tld
$tld_pattern2 = "/^([A-Za-z0-9.-]+(\.))?[A-Za-z0-9.-]+(\.)(".$composed_tlds.")(.*)?$/";
// server ip
$ip_pattern= "/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}(.*)?$/";
// localhost install
$localhost_pattern = "/^localhost(.*)$/";
if(preg_match($tld_pattern2, $dstr) )
preg_match ("/([A-Za-z0-9.-]+(\.))?[A-Za-z0-9-]+(\.)(".$composed_tlds.")/", $dstr, $domain_only);
else if(preg_match($tld_pattern1, $dstr) )
preg_match ("/([A-Za-z0-9.-]+(\.))?([A-Za-z0-9-])+(\.)[A-Za-z]{2,6}/", $dstr, $domain_only);
else if(preg_match($ip_pattern, $dstr) )
preg_match ("/\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}/", $dstr, $domain_only);
else if(preg_match($localhost_pattern, $dstr) ) {
$domain_only = array(0=>"localhost");
}
$main_domain = $domain_only[0];
return $main_domain;
}
public function setPostLocation($post_locations_array)
{
global $config_abs_path;
global $settings;
global $main_domain;
require_once $config_abs_path . "/classes/depending_fields.php";
$array_loc = $this->getFields();
foreach ($post_locations_array as $field => $val) {
if (!in_array($field, $array_loc)) {
continue;
}
$location_str = $this->getLocations($field);
$array_loc1 = explode("|", $location_str);
if ($val && !in_array($val, $array_loc1)) {
continue;
}
$found = 0;
for ($i = 0; $i < count($array_loc); $i++) {
if ($array_loc[$i] == $field) {
$found = 1;
continue;
}
if (!$found) {
continue;
}
unset($_COOKIE["location_" . $array_loc[$i]]);
setcookie("location_" . $array_loc[$i], "", time() - 3600, "/", "." . $main_domain);
}
global $location_array;
$location_array[$field] = $val;
if (!$val && !empty($_COOKIE["location_" . $field]) || $val && empty($_COOKIE["location_" . $field]) || !empty($_COOKIE["location_" . $field]) && $val != $_COOKIE["location_" . $field]) {
$expire = time() + 60 * 60 * 24 * 365;
setcookie("location_" . $field, $val, $expire, "/", "." . $main_domain);
}
if ($settings["enable_subdomains"] && $field == $settings["subdomain_field"]) {
my_session_start();
$_SESSION["location_set"] = 1;
}
}
return 1;
}
<?php
require_once "../config.php";
global $config_abs_path;
require_once $config_abs_path."/include/include.php";
require_once $config_abs_path."/classes/locations.php";
global $appearance_settings, $settings;
header('Content-type: text/html; charset='.$appearance_settings['charset']);
global $settings;
$fields = $settings['location_fields'];
$sarr = explode(",", $fields);
// refine search
if(isset($_POST['direct']) && $_POST['direct']) {
if((!isset($_POST['field']) || !$_POST['field']) || !in_array($_POST['field'], $sarr) ) exit(0);
$field = urldecode($_POST['field']);
$crt_loc = urldecode($_POST['location']);
$new_locations_array[$field] = $crt_loc;
}
elseif(isset($_POST['double_type']) && $_POST['double_type']) {
if((!isset($_POST['field1']) || !$_POST['field1'] || !isset($_POST['field2']) || !$_POST['field2']) || !in_array($_POST['field1'], $sarr) || !in_array($_POST['field2'], $sarr) ) exit(0);
$field1 = urldecode($_POST['field1']);
$crt_loc1 = urldecode($_POST['location1']);
$field2 = urldecode($_POST['field2']);
$crt_loc2 = urldecode($_POST['location2']);
$new_locations_array[$field1] = $crt_loc1;
$new_locations_array[$field2] = $crt_loc2;
}
// location filter box
else {
$new_locations_array = array();
foreach($sarr as $s) {
$new_locations_array[$s] = $_POST[$s];
}
}
my_session_start();
$lclass = new locations();
$lclass->init();
$lclass->setPostLocation($new_locations_array);
?>
function my_session_start() {
global $settings;
$session_name = session_name("oxss");
if(($settings['enable_locations'] && $settings['enable_subdomains'])) {
global $main_domain;
session_set_cookie_params(0, '/', '.'.$main_domain);
}
session_start();
}
function my_session_start() {
global $settings;
$session_name = session_name("oxss");
if(($settings['enable_locations'] && $settings['enable_subdomains'])) {
global $main_domain;
session_set_cookie_params(0, '/', '.'.$main_domain);
}
session_start();
}
public function setPostLocation($post_locations_array)
{
global $config_abs_path;
global $settings;
global $main_domain;
require_once $config_abs_path . "/classes/depending_fields.php";
$array_loc = $this->getFields();
foreach ($post_locations_array as $field => $val) {
if (!in_array($field, $array_loc)) {
continue;
}
$location_str = $this->getLocations($field);
$array_loc1 = explode("|", $location_str);
if ($val && !in_array($val, $array_loc1)) {
continue;
}
$found = 0;
for ($i = 0; $i < count($array_loc); $i++) {
if ($array_loc[$i] == $field) {
$found = 1;
continue;
}
if (!$found) {
continue;
}
unset($_COOKIE["location_" . $array_loc[$i]]);
setcookie("location_" . $array_loc[$i], "", time() - 3600, "/", "." . $main_domain);
}
global $location_array;
$location_array[$field] = $val;
if (!$val && !empty($_COOKIE["location_" . $field]) || $val && empty($_COOKIE["location_" . $field]) || !empty($_COOKIE["location_" . $field]) && $val != $_COOKIE["location_" . $field]) {
$expire = time() + 60 * 60 * 24 * 365;
setcookie("location_" . $field, $val, $expire, "/", "." . $main_domain);
}
if ($settings["enable_subdomains"] && $field == $settings["subdomain_field"]) {
my_session_start();
$_SESSION["location_set"] = 1;
}
}
return 1;
}
<?php
require_once "../config.php";
global $config_abs_path;
require_once $config_abs_path."/include/include.php";
require_once $config_abs_path."/classes/locations.php";
global $appearance_settings, $settings;
header('Content-type: text/html; charset='.$appearance_settings['charset']);
global $settings;
$fields = $settings['location_fields'];
$sarr = explode(",", $fields);
// refine search
if(isset($_POST['direct']) && $_POST['direct']) {
if((!isset($_POST['field']) || !$_POST['field']) || !in_array($_POST['field'], $sarr) ) exit(0);
$field = urldecode($_POST['field']);
$crt_loc = urldecode($_POST['location']);
$new_locations_array[$field] = $crt_loc;
}
elseif(isset($_POST['double_type']) && $_POST['double_type']) {
if((!isset($_POST['field1']) || !$_POST['field1'] || !isset($_POST['field2']) || !$_POST['field2']) || !in_array($_POST['field1'], $sarr) || !in_array($_POST['field2'], $sarr) ) exit(0);
$field1 = urldecode($_POST['field1']);
$crt_loc1 = urldecode($_POST['location1']);
$field2 = urldecode($_POST['field2']);
$crt_loc2 = urldecode($_POST['location2']);
$new_locations_array[$field1] = $crt_loc1;
$new_locations_array[$field2] = $crt_loc2;
}
// location filter box
else {
$new_locations_array = array();
foreach($sarr as $s) {
$new_locations_array[$s] = $_POST[$s];
}
}
my_session_start();
$lclass = new locations();
$lclass->init();
$lclass->setPostLocation($new_locations_array);
?>
define('TABLE_BADWORDS', $config_table_prefix.'badwords');
define('TABLE_BANNERS',$config_table_prefix.'banners');
define('TABLE_BANNERS_POSITIONS',$config_table_prefix.'banners_positions');
и т.д
session
Session Support enabled
Registered save handlers files user
Registered serializer handlers php php_binary wddx
Directive Local Value Master Value
session.auto_start Off Off
session.bug_compat_42 Off Off
session.bug_compat_warn Off Off
session.cache_expire 180 180
session.cache_limiter nocache nocache
session.cookie_domain no value no value
session.cookie_httponly Off Off
session.cookie_lifetime 0 0
session.cookie_path / /
session.cookie_secure Off Off
session.entropy_file no value no value
session.entropy_length 0 0
session.gc_divisor 1000 1000
session.gc_maxlifetime 1440 1440
session.gc_probability 1 1
session.hash_bits_per_character 5 5
session.hash_function 0 0
session.name PHPSESSID PHPSESSID
session.referer_check no value no value
session.save_handler files files
session.save_path /var/www/site/data/bin-tmp/ /var/www/site/data/bin-tmp/
session.serialize_handler php php
session.use_cookies On On
session.use_only_cookies On On
session.use_trans_sid 0 0
session.cookie_domain ".site.ru"
session_set_cookie_params(0, '/', '.'.$main_domain);
RewriteCond %{HTTP_HOST} !www.site.ru$ [NC]
RewriteCond %{HTTP_HOST} ^(www.)?([a-z0-9-_]+).site.ru [NC]
RewriteRule (.*) %{SCRIPT_FILENAME}?crt_city=%2 [NC,QSA]
85.195.39.11 - - [11/Jul/2019:03:17:49 +0300] "GET / HTTP/1.0" 200 33215 "https://moskovskaya-oblast.site.ru/new_posting.php" "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.100 Safari/537.36"
<?php
require_once "../config.php";
global $config_abs_path;
require_once $config_abs_path."/include/include_min.php";
require_once $config_abs_path."/classes/locations.php";
global $appearance_settings;
header('Content-type: text/html; charset='.$appearance_settings['charset']);
global $settings;
global $no_location_fields;
if(!$no_location_fields) {
$loc = new locations();
$no_location_fields = $loc->noFields();
}
if($no_location_fields==1) {
// can be menu only
// get directly the field for subdomains
$l = new locations;
$location_str = $l->getLocations($settings['location_fields']);
}
echo $location_str;
?>
require_once $config_abs_path."/include/include_min.php";
my_session_start();
перед$lclass = new locations();
, как было в set_location.php// current location
if($settings['enable_locations']) {
require_once($config_abs_path.'/classes/locations.php');
$lclass = new locations();
$lclass->init();
}
Not Found
The requested URL /new_posting.php was not found on this server.
Apache/2.2.15 (CentOS) Server at magadanskaya-oblast.site.ru Port 443
Options -Indexes
ErrorDocument 402 http://site.ru/static/404.php
ErrorDocument 403 http://site.ru/static/404.php
ErrorDocument 404 http://site.ru/static/404.php
ErrorDocument 500 http://site.ru/static/404.php
DirectoryIndex index.php
RewriteEngine On
RewriteBase /
RewriteCond %{ENV:REDIRECT_STATUS} ^$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^(.*)$ http://%1/$1 [R=301,L]
RewriteCond %{HTTP_HOST} ^test\.(.*)$ [NC]
RewriteRule ^(.*)$ http://%1/$1 [R=301,L]
RewriteCond %{REQUEST_METHOD} ^TRACE
RewriteCond %{HTTP:range} !(^bytes=[^,]+(,[^,]+){0,4}$|^$)
RewriteRule .* - [F]
RewriteCond %{HTTP_HOST} ^([^\.]+)\.site\.ru$ [NC]
RewriteCond %{HTTP_HOST} !^www\.site\.ru$ [NC]
RewriteCond %{HTTP_HOST} !^test\.site\.ru$ [NC]
RewriteRule ^(.*)$ redirect.php?id=%1 [QSA,L]
RewriteCond %{HTTP_HOST} !www.site.ru$ [NC]
RewriteCond %{HTTP_HOST} ^(www.)?([a-z0-9-_]+).site.ru [NC]
RewriteRule (.*) %{SCRIPT_FILENAME}?crt_city=%2 [NC,QSA]
public function initLiveSiteUrl()
{
global $location_array;
global $settings;
if (!$settings["enable_subdomains"] || !$settings["subdomain_field"]) {
return NULL;
}
global $config_live_site;
$get_city = "";
$cookie_city = "";
if (isset($location_array[$settings["subdomain_f ield"]])) {
$cookie_city = $this->buildLocationSubdomain($location_array[$ settings["subdomain_field"]]);
}
if ($cookie_city) {
if (stristr($config_live_site, "www")) {
$config_live_site = str_replace("www.", "https://" . $cookie_city . ".", $config_live_site);
return NULL;
}
$config_live_site = str_replace("https://", "https://" . $cookie_city . ".", $config_live_site);
}
}
public function checkCrtLocation(&$smarty)
{
global $location_array;
global $settings;
global $crt_city;
global $main_domain;
global $config_live_site;
$get_city = "";
$cookie_city = "";
$new_city = "";
if (isset($_GET["crt_city"]) && $_GET["crt_city"]) {
$get_city = $_GET["crt_city"];
}
if (isset($location_array[$settings["subdomain_f ield"]])) {
$cookie_city = $this->buildLocationSubdomain($location_array[$ settings["subdomain_field"]]);
}
if (($get_city && $get_city != "m" || isset($_SESSION["location_set"]) && $_SESSION["location_set"]) && $get_city != $cookie_city) {
if ($_SESSION["location_set"]) {
$new_city = $cookie_city;
if (getScriptName() != "show_locations.php") {
$_SESSION["location_set"] = 0;
}
} else {
$city_name = "";
if ($get_city) {
$city_name = $this->getLocationName($settings["subdomai n_field"], $get_city);
}
$expire = time() + 60 * 60 * 24 * 365;
setcookie("location_" . $settings["subdomain_field"], $city_name, $expire, "/", "." . $main_domain);
if ($city_name) {
$new_city = $get_city;
}
}
if ($new_city) {
header("Location: https://" . $new_city . "." . $main_domain . $_SERVER["REQUEST_URI"]);
} else {
$s = substr_count($config_live_site, "www") ? "www." : "";
header("Location: https://" . $s . $main_domain . $_SERVER["REQUEST_URI"]);
}
exit(0);
}
if ($cookie_city && $get_city != "m" && $cookie_city != $get_city) {
header("Location: http://" . $cookie_city . "." . $main_domain . $_SERVER["REQUEST_URI"]);
exit(0);
}
if ($cookie_city) {
if (stristr($config_live_site, "www")) {
$config_live_site = str_replace("www.", "https://" . $cookie_city . ".", $config_live_site);
} else {
$config_live_site = str_replace("https://", "https://" . $cookie_city . ".", $config_live_site);
}
}
$domain_name = str_replace("https://", "", $config_live_site);
if ($smarty) {
$smarty->assign("live_site", $config_live_site);
$smarty->assign("domain_name", $domain_name);
$smarty->assign("main_domain", $main_domain);
}
}