diff --git a/action.php b/action.php index be451e2..a14e347 100644 --- a/action.php +++ b/action.php @@ -23,9 +23,8 @@ class action_plugin_botmon extends DokuWiki_Action_Plugin { global $ACT; - // initialize the session id and type with random data: - $this->sessionId = rand(1000000, 9999999); - $this->sessionType = 'rnd'; + // populate the session id and type: + $this->setSessionInfo(); // insert header data into the page: if ($ACT == 'show' || $ACT == 'edit' || $ACT == 'media') { @@ -62,8 +61,6 @@ class action_plugin_botmon extends DokuWiki_Action_Plugin { global $INFO; - // populate the session id and type: - $this->getSessionInfo(); // build the tracker code: $code = $this->getBMHeader(); @@ -178,7 +175,7 @@ class action_plugin_botmon extends DokuWiki_Action_Plugin { return $country; } - private function getSessionInfo() { + private function setSessionInfo() { // what is the session identifier? if (isset($_SESSION)) { @@ -199,6 +196,12 @@ class action_plugin_botmon extends DokuWiki_Action_Plugin { $this->sessionId = $_SERVER['REMOTE_ADDR']; $this->sessionType = 'ip'; } + + if (!$this->sessionId) { /* if all fails, use random data */ + $this->sessionId = rand(100000000, 999999999); + $this->sessionType = 'rnd'; + } + } public function showCaptcha(Event $event) { diff --git a/admin.css b/admin.css index d8dad0e..8b15ce9 100644 --- a/admin.css +++ b/admin.css @@ -363,6 +363,7 @@ &.typ_php::before { background-position-y: -40px } &.typ_ip::before { background-position-y: -60px } &.typ_usr::before { background-position-y: -80px } + &.typ_rnd::before { background-position-y: -100px } /* External link icons */ &.extlink::before { background-image: url('img/links.png') } diff --git a/config/known-ipranges.json b/config/known-ipranges.json index 4e955cb..68dcf4f 100644 --- a/config/known-ipranges.json +++ b/config/known-ipranges.json @@ -20,6 +20,7 @@ {"id": "zenlayer", "name": "Zenlayer"} ], "ranges": [ + {"from": "1.92.0.0", "to": "1.95.255.254", "m": 14, "g": "huawei"}, {"from": "3.0.0.0", "to": "3.255.255.254", "m": 8, "g": "amazon"}, {"from": "5.161.0.0", "to": "5.161.255.255", "m": 16, "g": "hetzner"}, {"from": "8.128.0.0", "to": "8.191.255.254", "m": 10, "g": "alibaba"}, @@ -67,6 +68,7 @@ {"from": "138.121.0.0", "to": "138.121.225.254", "m": 16, "g": "misc_sa"}, {"from": "142.147.128.0", "to": "1142.147.255.254", "m": 17, "g": "w2obj"}, {"from": "146.174.128.0", "to": "146.174.191.254", "m": 18, "g": "huawei"}, + {"from": "149.232.128.0", "to": "149.232.159.254", "m": 19, "g": "huawei"}, {"from": "150.40.128.0", "to": "150.40.255.254", "m": 17, "g": "huawei"}, {"from": "159.138.0.0", "to": "159.138.225.254", "m": 16, "g": "huawei"}, {"from": "162.128.0.0", "to": "162.128.255.254", "m": 16, "g": "zenlayer"}, diff --git a/img/captcha.png b/img/captcha.png index 6e43e46..f101af1 100644 Binary files a/img/captcha.png and b/img/captcha.png differ diff --git a/img/idtyp.png b/img/idtyp.png index a1083f5..a315d24 100644 Binary files a/img/idtyp.png and b/img/idtyp.png differ