Xenforo 1' Gizli Admin İp' Adresleri

Charismax

Copyright @ Charismax
Katılım
3 yıl 7 ay 8 gün
Mesajlar
25,232
Tepkime puanı
8,697
Yaş
35
Konum
Memed' Home
İsim
CHRS
Memleket
Neresi?
Meslek
IzdırapÇI
Cinsiyet
vtEvVy
Medeni Hal
Sayfanızda Yer alan Yöneticilerin İp adreslerini Güvenlik Amacıyla Gizlemek isteriz zaman zaman 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.
Not: Bu İşlem Sadece Xenforo 1.x Serisinde geçerlidir.
Adım Adım Bu işlemi yapalım.

Editör Programı yardımıyla Açın;
Kod:
/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:
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:
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
 
Geri
Üst Alt