";
exit;
}
if ($DefaultService=="mls")
{
if (preg_match("(baidu.com|velen.io|qwant.com|ltx71.com|sogou.com|webmeup-crawler.com|megaindex.com|seokicks.de|semrush.com|linkfluence.com|linguee.com|extlinks.com|alphaseobot.com|exabot.com|archive.org|mojeek.com|mj12bot.com|ahrefs.com|opensiteexplorer.org)", $_SERVER['HTTP_USER_AGENT']))
{
file_put_contents("/log/block.log", "Blocked Search Engine: {$IP} {$_SERVER['HTTP_USER_AGENT']} | https://{$_SERVER['HTTP_HOST']}{$_SERVER['REQUEST_URI']}\n" , FILE_APPEND | LOCK_EX);
file_put_contents("/ddos/$IP.block", "Blocked Search Engine: {$IP} {$_SERVER['HTTP_USER_AGENT']} | https://{$_SERVER['HTTP_HOST']}{$_SERVER['REQUEST_URI']}\n" , FILE_APPEND | LOCK_EX);
exit;
}
if (stristr($_SERVER['HTTP_USER_AGENT'],"bot") or stristr($_SERVER['HTTP_USER_AGENT'],"http") or stristr($_SERVER['HTTP_USER_AGENT'],"crawler"))
{
// detect search engine bots
if (stristr($_SERVER['HTTP_USER_AGENT'],"google"))
{
file_put_contents('/log/googlebot.log', "https://{$_SERVER['HTTP_HOST']}{$_SERVER['REQUEST_URI']} | {$IP} {$_SERVER['HTTP_USER_AGENT']}\n" , FILE_APPEND | LOCK_EX);
}
elseif (stristr($_SERVER['HTTP_USER_AGENT'],"bing"))
{
file_put_contents('/log/bingbot.log', "https://{$_SERVER['HTTP_HOST']}{$_SERVER['REQUEST_URI']} | {$IP} {$_SERVER['HTTP_USER_AGENT']}\n" , FILE_APPEND | LOCK_EX);
}
elseif (stristr($_SERVER['HTTP_USER_AGENT'],"yandex"))
{
file_put_contents('/log/yandexbot.log', "https://{$_SERVER['HTTP_HOST']}{$_SERVER['REQUEST_URI']} | {$IP} {$_SERVER['HTTP_USER_AGENT']}\n" , FILE_APPEND | LOCK_EX);
}
elseif (stristr($_SERVER['HTTP_USER_AGENT'],"applebot"))
{
file_put_contents('/log/applebot.log', "https://{$_SERVER['HTTP_HOST']}{$_SERVER['REQUEST_URI']} | {$IP} {$_SERVER['HTTP_USER_AGENT']}\n" , FILE_APPEND | LOCK_EX);
}
else
{
file_put_contents('/log/bot.log', "{$IP} {$_SERVER['HTTP_USER_AGENT']} | https://{$_SERVER['HTTP_HOST']}{$_SERVER['REQUEST_URI']}\n" , FILE_APPEND | LOCK_EX);
}
}
else
{
file_put_contents('/log/browser.log', "{$IP} {$_SERVER['HTTP_USER_AGENT']} | https://{$_SERVER['HTTP_HOST']}{$_SERVER['REQUEST_URI']}\n" , FILE_APPEND | LOCK_EX);
file_put_contents("/ddos/$IP.log", "{$IP} | {$_SERVER['HTTP_USER_AGENT']} | https://{$_SERVER['HTTP_HOST']}{$_SERVER['REQUEST_URI']}\n" , FILE_APPEND | LOCK_EX);
}
}
if ($DefaultService=="mls" and strstr($_SERVER['REQUEST_URI'],".php") and $_REQUEST['SearchType']!="QuickSearch" and $_REQUEST['SearchType']!="AdvancedSearch" and $_REQUEST['SearchType']!="Image")
{
echo "PHP not allowed...";
echo "";
exit;
}
if ($Open=="")
{
$Open=$_REQUEST['Open'];
if ($_REQUEST['CachePage']!="" and $ManualCache!=1)
{
ob_start();
$CacheProcess=1;
}
// Auto Cache Home Page work with some services like MLS
if ($_SERVER['REQUEST_URI']=="/" and $DefaultService=="mls")
{
ob_start();
$CacheProcess=1;
}
}
if ($_REQUEST['MD5Cache']==1 and $_REQUEST['CachePage']=="ListPage")
{
// in case search in araboc like http://www.mlseg.com/ميفيدا
if (file_exists(md5($_REQUEST['SearchFor'])."-$_REQUEST[Lng].html"))
{
$Code=file_get_contents(md5($_REQUEST['SearchFor'])."-{$_REQUEST['Lng']}.html");
echo $Code;
exit;
}
}
if ($_REQUEST['MD5Cache']==1 and $_REQUEST['CachePage']=="TagPage")
{
// in case search in arabic like http://www.mlseg.com/en/egypt/tag/2/ميفيدا
if (file_exists(md5($_REQUEST['SearchFor'])."-$_REQUEST[Page]-$_REQUEST[Lng].html"))
{
$Code=file_get_contents(md5($_REQUEST['SearchFor'])."-$_REQUEST[Page]-$_REQUEST[Lng].html");
echo $Code;
exit;
}
}
if (intval($SessionExpire)>3600)
{
ini_set('session.gc_maxlifetime', $SessionExpire);
session_set_cookie_params($SessionExpire);
}
session_start();
if (stristr($_SERVER['REQUEST_URI'],"index.php") and $_SESSION['SessionUserGroup']<1)
{
if (stristr($_SERVER['REQUEST_URI'],"drop") or stristr($_SERVER['REQUEST_URI'],"delete") or stristr($_SERVER['REQUEST_URI'],"select") or stristr($_SERVER['REQUEST_URI'],"alter") or stristr($_SERVER['REQUEST_URI'],"update") or stristr($_SERVER['REQUEST_URI'],"truncate") or stristr($_SERVER['REQUEST_URI'],"*") or stristr($_SERVER['REQUEST_URI'],"%3C") or stristr($_SERVER['REQUEST_URI'],"%27"))
{
$Title="Access Denied, SQL Injection Attack. Your IP Address $IP";
$Message="You need permission to perform this action.";
include "open/error/error.php";
Echo "";
exit;
}
if ($_SERVER['REQUEST_METHOD']=="POST")
{
$POST=implode(",",$_POST);
if (stristr($POST,"drop") or stristr($POST,"delete") or stristr($POST,"select") or stristr($POST,"alter") or stristr($POST,"update") or stristr($POST,"truncate"))
{
$Title="Access Denied, SQL Injection Attack. Your IP Address $IP";
$Message="You need permission to perform this action.";
include "open/error/error.php";
Echo "";
exit;
}
}
}
if ($Lng=="")
{
$Lng=$_REQUEST['Lng'];
if ($Lng=="" and $Lng!="en" and $Lng!="fr" and $Lng!="de" and $Lng!="it" and $Lng!="es" and $Lng!="ru" and $Lng!="cn" and $Lng!="ar")
{
$Lng="en";
}
}
if ($_REQUEST['CacheProcess']!=1)
{
if ($_SERVER['REQUEST_URI']=="/")
{
$CurrentUrl=$ScriptUrl;
}
elseif (strlen($_SERVER['REQUEST_URI'])==3 and $Lng!="en" and $Lng!="ar")
{
// Prevent Invalid Lang like http://$SearchDomain/gg
if (stristr($ScriptUrl,"https:"))
{
$CurrentUrl="https://{$_SERVER['HTTP_HOST']}";
}
else
{
$CurrentUrl="http://{$_SERVER['HTTP_HOST']}";
}
}
else
{
if (stristr($ScriptUrl,"https:"))
{
$CurrentUrl="https://{$_SERVER['HTTP_HOST']}{$_SERVER['REQUEST_URI']}";
}
else
{
$CurrentUrl="http://{$_SERVER['HTTP_HOST']}{$_SERVER['REQUEST_URI']}";
}
}
}
$CurrentUrl=str_replace("/-","/",$CurrentUrl);
$CurrentUrl=strtolower($CurrentUrl);
include "include/function/function.php";
include("include/function/design.php");
if (intval($Multiservice)==0)
{
$LService=$DefaultService;
$Service=ucfirst($DefaultService);
}
$EnItem=trim($_REQUEST['EnItem']);
$QuoteEnItem=$PDO->quote($EnItem);
$ArItem=trim($_REQUEST['ArItem']);
$QuoteArItem=$PDO->quote($ArItem);
$EnDescription=trim($_REQUEST['EnDescription']);
$QuoteEnDescription=$PDO->quote($EnDescription);
$ArDescription=trim($_REQUEST['ArDescription']);
$QuoteArDescription=$PDO->quote($ArDescription);
// Start
if ($_SESSION['CountryCode']=="" or $_SESSION['CurLng']!=$Lng or $_SESSION['SessionService']!=$Service)
{
include("open/include/config.php");
}
if ($_REQUEST['CurrencyCode']!="")
{
$_SESSION['CurrencyCode']=$_REQUEST['CurrencyCode'];
}
// End
if ($DefaultService!="" and $Open=="")
{
include "open/include/loader.php";
}
$LService=strtolower($Service);
if (!file_exists("module/$LService"))
{
echo "Folder \"module/$LService\" not exists.";
exit;
}
$Date=date ("Y-m-d");
$YesterdayDate=date ("Y-m-d",strtotime("-1 days"));
$Time=date ("G:i A");
$TimeStamp=time();
$CurrentYear=date("Y");
if ($CacheProcess!=1 and $Open!="login.php" and $Open!="register.php" and $Open!="map.php" and $Open!="attach.php" and $Open!="submit.php" and $Open!="confirm.php" and $Open!="country.php" and $Open!="gender.php" and $Open!="birth.php" and $Open!="delete.php" and $Open!="visitor.php" and $Open!="rank.php" and $Open!="move.php" and $Open!="notify.php" and $Open!="key.php" and $Open!="keys.php" and $Open!="about.php")
{
if (substr($CurrentUrl,-1)=="/")
{
$CurrentUrl=substr($CurrentUrl,0,-1);
}
// إعادة التوجيه لجميع الخدمات
setcookie ("CookiesCurrentUrl",$CurrentUrl,0,"/");
}
// فى حالة وجود قيم للكوكيز و عدم وجود قيمة للشيشن - نجعل قيمة الشيشن تساوى الكوكيز
if ($_SESSION['SessionUserID']=="" and $_COOKIE['CookiesUserID']!="" and $_REQUEST['Logout']!=1)
{
$_SESSION['SessionUserID']=$_COOKIE['CookiesUserID'];
$_SESSION['SessionUserGroup']=$_COOKIE['CookiesUserGroup'];
$_SESSION['SessionUsername']=$_COOKIE['CookiesUsername'];
$_SESSION['SessionFullName']=$_COOKIE['CookiesFullName'];
$_SESSION['SessionPassword']=$_COOKIE['CookiesPassword'];
$_SESSION['SessionGender']=$_COOKIE['CookiesGender'];
$_SESSION['SessionBirthDate']=$_COOKIE['CookiesBirthDate'];
$_SESSION['SessionAge']=$_COOKIE['CookiesAge'];
$_SESSION['SessionRegisterDate']=$_COOKIE['CookiesRegisterDate'];
$_SESSION['SessionUserType']=$_COOKIE['CookiesUserType'];
$SqlQ = "select * from UserGroup where UserGroup='$_COOKIE[CookiesUserGroup]'";
$ResultQ = $PDO->query($SqlQ)->fetchAll();foreach ($ResultQ as $RowQ)
{
$_SESSION['ActiveValue']=$RowQ['ActiveValue'];
}
// اضافة العضو ضمن التواجدين الان
include_once ("open/include/existent.php");
}
// فى حالة تسجيل خروج الشيشن يتم تسجيل خروج الكوكيز
if ($_REQUEST['Logout']==1)
{
setcookie ("CookiesUserID","",time() - 31104000,"/");
setcookie ("CookiesUserGroup","",time() - 31104000,"/");
setcookie ("CookiesUsername","",time() - 31104000,"/");
setcookie ("CookiesFullName","",time() - 31104000,"/");
setcookie ("CookiesPassword","",time() - 31104000,"/");
setcookie ("CookiesGender","",time() - 31104000,"/");
setcookie ("CookiesBirthDate","",time() - 31104000,"/");
setcookie ("CookiesAge","",time() - 31104000,"/");
setcookie ("CookiesRegisterDate","",time() - 31104000,"/");
setcookie ("CookiesUserType","",time() - 31104000,"/");
unset ($_COOKIE['CookiesUserID'],$_COOKIE['CookiesUserGroup'],$_COOKIE['CookiesUsername'],$_COOKIE['CookiesFullName'],$_COOKIE['CookiesPassword'],$_COOKIE['CookiesGender'],$_COOKIE['CookiesBirthDate'],$_COOKIE['CookiesAge'],$_COOKIE['CookiesRegisterDate'],$_COOKIE['CookiesUserType']);
}
if ($_REQUEST['RememberMe']==1)
{
// تسجيل الدخول بالكوكيز
$MDPassword=md5($_REQUEST['SessionPassword']);
$Sql = "select * from $GPrefix"."User where Username='$_REQUEST[SessionUsername]' and (Password='$_REQUEST[SessionPassword]' or Password='$MDPassword')";
$Result = $PDO->query($Sql)->fetchAll();foreach ($Result as $Row)
{
setcookie ("CookiesUserID",$Row['UserID'],time()+31104000,"/");
setcookie ("CookiesUserGroup",$Row['UserGroup'],time()+31104000,"/");
setcookie ("CookiesUsername",$Row['Username'],time()+31104000,"/");
setcookie ("CookiesFullName",$Row['FullName'],time()+31104000,"/");
setcookie ("CookiesPassword",$Row['Password'],time()+31104000,"/");
setcookie ("CookiesGender",$Row['Gender'],time()+31104000,"/");
setcookie ("CookiesBirthDate",$Row['BirthDate'],time()+31104000,"/");
setcookie ("CookiesAge",round(Rate($Row['BirthDate'])/365),time()+31104000,"/");
setcookie ("CookiesRegisterDate",$Row['RegisterDate'],time()+31104000,"/");
setcookie ("CookiesUserType",$Row['UserType'],time()+31104000,"/");
}
}
if ($Open=="register.php" or $Open=="login.php")
{
// كوكيز يستخدم لمعرفة اذا كان الزائر عضو ام لا - لا يحذف هذا الكوكيز عند تسجيل الخروج
setcookie ("CookiesIsUser", "1",time()+31104000,"/");
}
$LNG=$_SESSION['SessionLNG'];
if ($Lng=="") {$Lng=$DefaultLng;} if ($NService=="") {$NService=$LService;}
if ($Lng=="ar") {$Dir="rtl";}else{$Dir="ltr";}
$Include=@include "module/$LService/language/{$Lng}.php";
if (!$Include)
{
include "module/$LService/language/en.php";
}
include "module/$LService/language/settings.php";
// Read variable & language for current service and get general variable also
// قراءة المتغيرات من قاعدة البيانات فى حالة الدخول لاول مرة على الخدمة او فى حالة تغيير اللغة او فى حالة الانتقال لخدمة اخرى او فى حالة فقدان قيمة الثيم
if ($_SESSION['CurLng']!=$Lng or $Theme=="" or $_SESSION['SessionService']!=$Service or $SEO=="" or $LNG['DAlign']=="" or $Mode==1)
{
$ReloadSession=1;
}
if ($DefaultService=="mls")
{
include "open/include/parked.php";
}
if ($Open=="") {$PageKey="Home";}else{$PageKey=str_replace(".php","",ucfirst($Open));}
$URL['PHP']="module/$LService/theme/$Theme/php";
$URL['HTML']="module/$LService/theme/$Theme/$LYR";
$URL['IMAGE']="/module/$LService/theme/$Theme/image";
if ($LYR=="html")
{
$URL['CSS']="/module/$LService/theme/$Theme/css";
}
else
{
$URL['CSS']="module/$LService/theme/$Theme/css";
}
$URL['JS']="/module/$LService/theme/$Theme/js";
// end .. Read variable & language for current service and get general variable also
if ($Open=="show.php")
{
// GET DATA FOR CURRENT ITEM ID
include ("module/$LService/include/show.php");
if ($RecycleBin==1)
{
$Title="Item moved to recycle bin.";
$Message="As a site collection administrator, you can view and manage deleted items across admin area.";
include "open/error/error.php";
exit;
}
}
if ($Open=="submit.php")
{
include ("open/include/submit.php");
}
// اذا كانت خاصية التتبع مفعلة
if ($ActiveFollow==1)
{
// اضافة العضو او الزائر ضمن التواجدين الان , و تسجيل مكان تواجده
include_once ("open/include/existent.php");
}
if ($BannerSql!="")
{
// Get banners block code
if ($ReloadSession==1)
{
include ("open/include/banner.php");
}
else
{
$RandNo = rand(0,1000);
$BannerCode=$_SESSION['SessionBannerCodeArray'];
$BannerFileName=$_SESSION['SessionBannerFileNameArray'];
$BannerUrl=$_SESSION['SessionBannerUrlArray'];
$BannerRedirect=$_SESSION['SessionBannerRedirectArray'];
$BannerTitle=$_SESSION['SessionBannerTitleArray'];
$BannerDescription=$_SESSION['SessionBannerDescriptionArray'];
if (is_array($BannerCode['Up']))
{
srand ($RandNo);
shuffle($BannerCode['Up']);
srand ($RandNo);
shuffle($BannerFileName['Up']);
srand ($RandNo);
shuffle($BannerUrl['Up']);
srand ($RandNo);
shuffle($BannerRedirect['Up']);
srand ($RandNo);
shuffle($BannerTitle['Up']);
srand ($RandNo);
shuffle($BannerDescription['Up']);
}
if (is_array($BannerCode['Down']))
{
srand ($RandNo);
shuffle($BannerCode['Down']);
srand ($RandNo);
shuffle($BannerFileName['Down']);
srand ($RandNo);
shuffle($BannerUrl['Down']);
srand ($RandNo);
shuffle($BannerRedirect['Down']);
srand ($RandNo);
shuffle($BannerTitle['Down']);
srand ($RandNo);
shuffle($BannerDescription['Down']);
}
if (is_array($BannerCode['Left']))
{
srand ($RandNo);
shuffle($BannerCode['Left']);
srand ($RandNo);
shuffle($BannerFileName['Left']);
srand ($RandNo);
shuffle($BannerUrl['Left']);
srand ($RandNo);
shuffle($BannerRedirect['Left']);
srand ($RandNo);
shuffle($BannerDescription['Left']);
}
if (is_array($BannerCode['Right']))
{
srand ($RandNo);
shuffle($BannerCode['Right']);
srand ($RandNo);
shuffle($BannerFileName['Right']);
srand ($RandNo);
shuffle($BannerUrl['Right']);
srand ($RandNo);
shuffle($BannerRedirect['Right']);
srand ($RandNo);
shuffle($BannerTitle['Right']);
srand ($RandNo);
shuffle($BannerDescription['Right']);
}
}
}
include "open/include/$LYR/head.php";
// Print Page Content & Close Database Connect
include "open/include/home.php";
$PageTime=round((microtime(true)-$StartTime),5);
echo "