HOME SHELL

NULLCOMMUNITY
 LiteSpeed
 Linux server2.poyrazhosting.com 3.10.0-962.3.2.lve1.5.77.el7.x86_64 #1 SMP Mon Dec 12 07:06:14 EST 2022 x86_64
 safemode : OFF
 MySQL: OFF | Perl: OFF | cURL: ON | WGet: OFF
  >  / home / cuneytsener53 / kurumsal45.snrsoft.com.tr / admin /

Server Ip : 104.21.78.54




Filename/home/cuneytsener53/kurumsal45.snrsoft.com.tr/admin/function.php
Size6.38 kb
Permissionrw-r--r--
Owner
Create time02-Mar-2025 05:46
Last modified08-Mar-2021 18:40
Last accessed29-Mar-2025 23:22
Actionsedit | rename | delete | download (gzip)
Viewtext | code | image
<?php


//Türkçe karakter dönüştürme fonksiyonu
function turkce_temizle($metin) {
$turkce=array("ş","Ş","ı","ü","Ü","ö","Ö","ç","Ç","ş","Ş","ı","ğ","Ğ","İ","ö","Ö","Ç","ç","ü","Ü"," ");
$duzgun=array("s","S","i","u","U","o","O","c","C","s","S","i","g","G","I","o","O","C","c","u","U","-");
$metin=str_replace($turkce,$duzgun,$metin);
$metin = preg_replace("@[^a-z0-9\-_şıüğçİŞĞÜÇ]+@i","-",$metin);
$yeniisim = mb_strtolower($metin, 'utf8');
return $yeniisim;
};


function kisalt($kelime, $str = 10)
{
if (strlen($kelime) > $str)
{
if (function_exists("mb_substr")) $kelime = mb_substr($kelime, 0, $str, "UTF-8").'..';
else $kelime = substr($kelime, 0, $str).'..';
}
return $kelime;
}


//Boşlukları silme fonksiyonu
function tum_bosluk_sil($veri)
{
return str_replace(" ", "", $veri);
};




//kod girişini engelleme fonksiyonu
function clean($data)
{
// Fix &entity\n;
$data = str_replace(array('&amp;','&lt;','&gt;'), array('&amp;amp;','&amp;lt;','&amp;gt;'), $data);
$data = preg_replace('/(&#*\w+)[\x00-\x20]+;/u', '$1;', $data);
$data = preg_replace('/(&#x*[0-9A-F]+);*/iu', '$1;', $data);
$data = html_entity_decode($data, ENT_COMPAT, 'UTF-8');

// Remove any attribute starting with "on" or xmlns
$data = preg_replace('#(<[^>]+?[\x00-\x20"\'])(?:on|xmlns)[^>]*+>#iu', '$1>', $data);

// Remove javascript: and vbscript: protocols
$data = preg_replace('#([a-z]*)[\x00-\x20]*=[\x00-\x20]*([`\'"]*)[\x00-\x20]*j[\x00-\x20]*a[\x00-\x20]*v[\x00-\x20]*a[\x00-\x20]*s[\x00-\x20]*c[\x00-\x20]*r[\x00-\x20]*i[\x00-\x20]*p[\x00-\x20]*t[\x00-\x20]*:#iu', '$1=$2nojavascript...', $data);
$data = preg_replace('#([a-z]*)[\x00-\x20]*=([\'"]*)[\x00-\x20]*v[\x00-\x20]*b[\x00-\x20]*s[\x00-\x20]*c[\x00-\x20]*r[\x00-\x20]*i[\x00-\x20]*p[\x00-\x20]*t[\x00-\x20]*:#iu', '$1=$2novbscript...', $data);
$data = preg_replace('#([a-z]*)[\x00-\x20]*=([\'"]*)[\x00-\x20]*-moz-binding[\x00-\x20]*:#u', '$1=$2nomozbinding...', $data);

// Only works in IE: <span style="width: expression(alert('Ping!'));"></spa)n>
$data = preg_replace('#(<[^>]+?)style[\x00-\x20]*=[\x00-\x20]*[`\'"]*.*?expression[\x00-\x20]*\([^>]*+>#i', '$1>', $data);
$data = preg_replace('#(<[^>]+?)style[\x00-\x20]*=[\x00-\x20]*[`\'"]*.*?behaviour[\x00-\x20]*\([^>]*+>#i', '$1>', $data);
$data = preg_replace('#(<[^>]+?)style[\x00-\x20]*=[\x00-\x20]*[`\'"]*.*?s[\x00-\x20]*c[\x00-\x20]*r[\x00-\x20]*i[\x00-\x20]*p[\x00-\x20]*t[\x00-\x20]*:*[^>]*+>#iu', '$1>', $data);

// Remove namespaced elements (we do not need them)
$data = preg_replace('#</*\w+:\w[^>]*+>#i', '', $data);
do
{
// Remove really unwanted tags
$old_data = $data;
$data = preg_replace('#</*(?:applet|b(?:ase|gsound|link)|embed|frame(?:set)?|i(?:frame|layer)|l(?:ayer|ink)|meta|object|s(?:cript|tyle)|title|xml)[^>]*+>#i', '', $data);
}
while ($old_data !== $data);

// we are done...
return $data;

}

//Seo URL ekleme fonksiyonu
function seo($s) {
$tr = array('ş','Ş','ı','I','İ','ğ','Ğ','ü','Ü','ö','Ö','Ç','ç','(',')','/',':',',');
$eng = array('s','s','i','i','i','g','g','u','u','o','o','c','c','','','-','-','');
$s = str_replace($tr,$eng,$s);
$s = strtolower($s);
$s = preg_replace('/&amp;amp;amp;amp;amp;amp;amp;amp;amp;.+?;/', '', $s);
$s = preg_replace('/\s+/', '-', $s);
$s = preg_replace('|-+|', '-', $s);
$s = preg_replace('/#/', '', $s);
$s = str_replace('.', '', $s);
$s = trim($s, '-');
return $s;
}

//Kullanıcnın gerçek ip adressi
function IPadresinial(){
if(getenv("HTTP_CLIENT_IP")) {
$ip = getenv("HTTP_CLIENT_IP");
}
else if(getenv("HTTP_X_FORWARDED_FOR")) {
$ip = getenv("HTTP_X_FORWARDED_FOR");
if (strstr($ip, ',')) {
$tmp = explode (',', $ip);
$ip = trim($tmp[0]);
}
}
else{
$ip = getenv("REMOTE_ADDR");
}
return $ip;
}


function logtut($user_id,$req,$datee, $ip = 0 , $log_url = "log/", $log_name = "site.log"){
include '../config.php';
$logtutuldu = $db_conn->prepare("INSERT INTO logs SET user_id=:user_id,req=:req,datee=:datee,ip=:ip");
$logtutuldu->execute(array(':user_id' => $user_id,':req' => $req,':datee' => $datee,':ip' => $ip));
if($logtutuldu==false){
$dosya = fopen($log_url.$log_name,"a");
$log = "
-----------------------------------
>Kullanıcı ID: $user_id
>Ip : $ip
>Ne Yaptı : $req
>Zaman : $datee
-----------------------------------
";
fwrite($dosya,$log);
fclose($dosya);
chmod($log_url.$log_name,0600);
}
}



function emailsubmit($email="",$konu,$icerik){




include '../config.php';
$sorgu = $db_conn->query("SELECT `keyname` AS keyname, `value` AS value FROM `settings`;");
$rows = $sorgu->fetchAll(PDO::FETCH_KEY_PAIR);

$guvenlik = $rows['guvenlik'];
$server = $rows['mail_server'];
$smptport = $rows['smtp_port'];
$servermail = $rows['smtp_mail'];
$serverpassword = $rows['smtp_password'];
$serverbaslik = $rows['mail_title'];
if ($email=="") {
$email = $rows['admin_email'];
}


require("../mail/class.phpmailer.php");
$mail = new PHPMailer();
$mail->IsSMTP();
$mail->SMTPDebug = 1;
$mail->SMTPAuth = true; // authentication enabled
$mail->SMTPSecure = $guvenlik; // secure transfer enabled REQUIRED for GMail
$mail->Host = $server;
$mail->Port = $smptport; // or 587
$mail->IsHTML(true);
$mail->SetLanguage("tr", "phpmailer/language");
$mail->CharSet ="utf-8";
$mail->Username = $servermail; // Mail adresi
$mail->Password = $serverpassword; // Parola
$mail->SetFrom($servermail, "".$serverbaslik." ~ ".$konu.""); // Mail adresi
$mail->AddAddress($email); // Gönderilecek kişi
$mail->Subject = $konu;
$mail->Body = $icerik;

if(!$mail->Send()){
echo "<script>Notiflix.Report.Failure( 'BAŞARISIZ', 'BİR ŞEYLER TERS GİTTİ ".$servermail." ADRESİNDEN İLETİŞİM KURUNUZ', 'YENİLE'); </script>";
} else {
echo "<script>Notiflix.Report.Success( 'BAŞARILI', 'E-POSTA HESABINIZA YENİ ŞİFRENİZ GÖNDERİLMİŞTİR. ', 'GİRİŞ YAP',function(){window.location.href='index.php';}); </script>";
}
}






?>