SessionId fix

This commit is contained in:
Sascha Leib
2025-10-26 09:14:45 +01:00
parent 620d9253e5
commit 447b8b4fbe
5 changed files with 12 additions and 6 deletions

View File

@@ -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) {

View File

@@ -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') }

View File

@@ -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"},

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.8 KiB

After

Width:  |  Height:  |  Size: 4.1 KiB