Tekil Mesaj gösterimi
Alt 07 Haziran 2021, 10:52   #1
Absent
✓
Bordo aşktır, mavi tutku..
Absent - ait Kullanıcı Resmi (Avatar)

Standart XenForo Hide Admin / Moderator IP Address

Sayfanızda yer alan yöneticilerin İp adreslerini güvenlik amacıyla gizlemek isteriz ve bu düzenleme tamamen bu ihtiyacımızı karşılamak için yapılmıştır.

Yapılacak işlemler xenforo sistem dosyalarından "ip.php" dosyasını düzenlemek.

Adım Adım Bu işlemi yapalım.

Editör Programı yardımıyla Açın;


PHP- Kodu

/library/Xenforo/Model/Ip.php
Bu Kısımı
;
PHP:
public function 
logIp($userId, $contentType, $contentId, $action, $ipAddress = null, $date = null)
{
$ipAddress = XenForo_Helper_Ip::getBinaryIp(null, $ipAddress);
if (!
$ipAddress)
{
return 
0;
}

if (
$date === null)
{
$date = XenForo_Application::$time;
}

$this->_getDb()->insert('xf_ip', array(
'user_id' => $userId,
'content_type' => $contentType,
'content_id' => $contentId,
'action' => $action,
'ip' => $ipAddress,
'log_date' => max(0, $date)
));

return 
$this->_getDb()->lastInsertId();
} 

Bununla Değiştirin;

PHP- Kodu

public function logIp($userId, $contentType, $contentId, $action, $ipAddress = null, $date = null)
{
if (
1 == $userId) {/* Semprot modification */
$ipAddress = '99.99.99.99';
}

$ipAddress = XenForo_Helper_Ip::getBinaryIp(null, $ipAddress);
if (!
$ipAddress)
{
return 
0;
}

if (
$date === null)
{
$date = XenForo_Application::$time;
}

$this->_getDb()->insert('xf_ip', array(
'user_id' => $userId,
'content_type' => $contentType,
'content_id' => $contentId,
'action' => $action,
'ip' => $ipAddress,
'log_date' => max(0, $date)
));

return 
$this->_getDb()->lastInsertId();
} 

Bu işlem Sadece Yöneticilerin İp adresini gizleyecektir.
Belirlemiş Olduğumuz başka Kullanıcılarında ip adresini gizlemek mümkün.
onun için Aşağıdaki Bölümle Değişim yapıyoruz;


PHP- Kodu

public function logIp($userId, $contentType, $contentId, $action, $ipAddress = null, $date = null)
{
if (
in_array($userId, array(1, 22, 192, 391))) {/* Semprot modification */
$ipAddress = '99.99.99.99';
}

$ipAddress = XenForo_Helper_Ip::getBinaryIp(null, $ipAddress);
if (!
$ipAddress)
{
return 
0;
}

if (
$date === null)
{
$date = XenForo_Application::$time;
}

$this->_getDb()->insert('xf_ip', array(
'user_id' => $userId,
'content_type' => $contentType,
'content_id' => $contentId,
'action' => $action,
'ip' => $ipAddress,
'log_date' => max(0, $date)
));

return 
$this->_getDb()->lastInsertId();
}
HTML:
(
$userId, array(1, 22, 192, 391))
bölümünde yer alan "1,22,192,391" İD nolarını Değişmeniz Yeterlidir. 

================================================== ===
Bu işlemleri yaptığınızda var olan ip adreslerinin üzerine yazılmaz bunu güncellemeniz gerekmektedir. Bu işlem içinde PhpmyAdmin'e erişim sağlayıp

Bu Sorguyu Çalıştırmanız yeterlidir.
HTML:
UPDATE xf_ip SET ip = '99.99.99.99' WHERE user_id =1

Webmaster forumundan alıntıdır
________________

Öpüşmek; alt katı kiralamak için, üst katta yapılan anlaşmadır..