From 953ddd82e48dd206cef5ac94456549aed13b3ad5 Mon Sep 17 00:00:00 2001 From: RaindropsSys Date: Fri, 17 Nov 2023 23:25:29 +0100 Subject: Updated 30 files and deleted 2976 files (automated) --- pages/account.inc | 4 + pages/api/disconnect.php | 12 +- pages/api/pluralkit-integration.php | 10 +- pages/api/save-private.php | 35 -- pages/api/save.php | 37 -- pages/api/timeline.php | 2 +- pages/byfront.inc | 62 +-- pages/computers.inc | 1050 ----------------------------------- pages/contacts.inc | 273 --------- pages/edit-private.inc | 40 -- pages/edit.inc | 44 -- pages/home.inc | 37 +- pages/metadata.inc | 6 +- pages/page.inc | 17 +- pages/pleasure.inc | 8 +- pages/schedules.inc | 60 +- pages/sessions.inc | 4 +- pages/stats.inc | 504 ----------------- pages/terminology.inc | 15 - 19 files changed, 92 insertions(+), 2128 deletions(-) delete mode 100644 pages/api/save-private.php delete mode 100644 pages/api/save.php delete mode 100644 pages/computers.inc delete mode 100644 pages/contacts.inc delete mode 100644 pages/edit-private.inc delete mode 100644 pages/edit.inc delete mode 100644 pages/stats.inc delete mode 100644 pages/terminology.inc (limited to 'pages') diff --git a/pages/account.inc b/pages/account.inc index 4107f8f..b8fc9f5 100644 --- a/pages/account.inc +++ b/pages/account.inc @@ -22,6 +22,10 @@ require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/components/header.inc'; ?>
Logout
+ +
+ +

Cold Haze System Software, build . · © 2022- Equestria.dev Developers

diff --git a/pages/api/disconnect.php b/pages/api/disconnect.php index c4cf0bd..ffd3f40 100644 --- a/pages/api/disconnect.php +++ b/pages/api/disconnect.php @@ -13,13 +13,21 @@ $list = array_filter([...scandir($_SERVER['DOCUMENT_ROOT'] . "/includes/tokens") $session = file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/tokens/" . $token) ? json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/tokens/" . $token), true) : json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/lowertokens/" . $token), true); - return isset($session["last"]) && isset($session["profile"]) && ($session["profile"]["id"] ?? "") === ($_PROFILE["id"] ?? ""); + return isset($session["id"]) && $session["id"] === ($_PROFILE["id"] ?? ""); }); +var_dump($list); + foreach ($list as $token) { $session = file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/tokens/" . $token) ? json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/tokens/" . $token), true) : json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/lowertokens/" . $token), true); - if (isset($_GET["id"]) && sha1($token) . md5($token) === $_GET["id"]) { + var_dump(bin2hex(substr($token, 0, 50)), trim($_GET["id"])); + + if (bin2hex(substr($token, 0, 50)) === trim($_GET["id"])) { + if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/sessions/" . $token)) { + unlink($_SERVER['DOCUMENT_ROOT'] . "/includes/sessions/" . $token); + } + if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/tokens/" . $token)) { unlink($_SERVER['DOCUMENT_ROOT'] . "/includes/tokens/" . $token); } else { diff --git a/pages/api/pluralkit-integration.php b/pages/api/pluralkit-integration.php index 69d99b1..7d7c641 100644 --- a/pages/api/pluralkit-integration.php +++ b/pages/api/pluralkit-integration.php @@ -8,12 +8,6 @@ $inputJSON = file_get_contents('php://input'); $input = json_decode($inputJSON, true); $data = $GLOBALS["ColdHazeApp"]["webhook"]; -if (isset($GLOBALS["ColdHazeApp"]["ponytown"][$user])) { - $ponytown = $GLOBALS["ColdHazeApp"]["ponytown"][$user]; -} else { - header("HTTP/1.1 404 Not Found") and die(); -} - if ($user === null) { header("HTTP/1.1 500 Internal Server Error") and die(); } @@ -32,6 +26,9 @@ if ($input['system_id'] === "7d9f543e-f742-40f6-9d07-86c3f2983124") { } elseif ($input['system_id'] === "ade46823-206b-4b0c-ad3c-caae934a5f3b") { $system = "ynmuc"; $name = "Cloudburst System"; +} elseif ($input['system_id'] === "d1cd97eb-9c92-4e42-94cd-4397a5074ff9") { + $system = "hrbom"; + $name = "Moonglow"; } elseif (isset($app["other"]) && $input["system_id"] === $app["other"]["uuid"]) { $system = $app["other"]["id"]; $name = $app["other"]["name"]; @@ -48,7 +45,6 @@ if ($input["type"] === "CREATE_MEMBER" || $input["type"] === "UPDATE_MEMBER" || createJob("UpdateAssets", [ "type" => "members" ]); - createJob("UpdateLogo", []); } if ($input["type"] === "UPDATE_SYSTEM") { diff --git a/pages/api/save-private.php b/pages/api/save-private.php deleted file mode 100644 index 6843e2a..0000000 --- a/pages/api/save-private.php +++ /dev/null @@ -1,35 +0,0 @@ - 0) { - if ($metadata["birth"]["age"] === -1) { - $age = abs(log(0)); - } elseif ($metadata["birth"]["age"] <= 0) { - $age = null; - } else { - $age = $metadata["birth"]["age"]; - } - } else { - if ($metadata["birth"]["year"] <= 1900) { - $age = null; - } else { - $age = (int)date('Y') - $metadata["birth"]["year"] + (strtotime(date('Y') . "-" . $metadata["birth"]["date"]) <= time() ? 0 : -1); - } - } - - if ((isset($age) && $age > 0 && time() > 1677628800) || time() <= 1677628800): ?> -
opacity: 0.75;"> + $metadata = $member["_metadata"];?> + - +
time() - 86400 * 21): + + $metadata = $member["_metadata"];?> +
+ "> + " style="width:24px;">  + + +
+ + Never fronted + + Last fronted () + +
+
+ -
-
- "> -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Owner:
Luna version: ( DSB ) (legacy)
System:
OS kernel:
Serial: ()-
Status:OnlineLast seen :
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 0): ?> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 0): ?> - - - - $version): if (trim($version) !== "" && $software !== "systemOpensslLib" && $software !== "openssl" && $software !== "node" && $software !== "v8"): ?> - - - - - - -

Processors and graphics

Main processor: ( GHz)
Processor threading: - 1): ?> processor 1 ? "s" : "" ?>, - core 1 ? "s" : "" ?>, - thread 1 ? "s" : "" ?>
Hardware virtualization:
Level 1 cache: KiB (instruction), KiB (data)
Level 2 cache:
Level 3 cache:
Graphics processor 1 ? "s" : "" ?>: - - ( cores, ) - " : "" ?> - -
Display 1 ? "s" : "" ?>: - - (x, Hz) - " : "" ?> - -

System memory

Physical memory: GiB ( MiB used, MiB free)
Memory usage: MiB active, MiB available, MiB cache
Swap memory: GiB ( MiB used, MiB free)
RAM chips: - - MiB - " : "" ?> - -

Battery

Battery model:
Charge level:% ( V)
Cycles:
Remaining capacity:/ 0): ?> (designed for 0): ?>, % left)
This device does not contain a battery.
This operating system does not support reporting battery info.

Operating system

System:
CPU architecture:
Kernel version:
Code page:
Build number:
Serial number:
Startup interface:

Software versions

"OS kernel", - "systemOpenssl" => $computer["versions"]["systemOpensslLib"], - "npm" => "NPM", - "yarn" => "Yarn", - "gulp" => "Gulp", - "grunt" => "Grunt", - "git" => "Git", - "tsc" => "TypeScript", - "mysql" => "MySQL", - "redis" => "Redis", - "mongodb" => "MongoDB", - "apache" => "Apache HTTPD", - "php" => "PHP", - "docker" => "Docker", - "postfix" => "Postfix SMTP Server", - "postgresql" => "PostgreSQL", - "perl" => "Perl", - "python" => "Python (legacy)", - "python3" => "Python", - "pip" => "PIP (legacy)", - "pip3" => "PIP", - "java" => "Java", - "gcc" => "C compiler", - "virtualbox" => "VirtualBox", - "bash" => "Bash", - "zsh" => "zsh", - "fish" => "Fish", - "powershell" => "PowerShell", - "dotnet" => ".NET", - default => $software, - } - ?>:
- - -

Remote control

-

- You can remotely control this device. Open remote device.
- Note: The user of this device will need to approve your connection request before you can see and control their screen. -

- - - 0): ?> -

Sessions

- - - - - - - - - - - - - - - - - - - - - -
TTYCommandUserOpenType
- - - 0): ?> -

Filesystems

- - - - - - - - - - - - - - - - - - - - - - - -
DeviceMount pointTypeUsedFreeTotal
(%)
- - - -

Audio devices

- - - - - - - - - - - - - - - - - - - - - -
TypeManufacturerNameDefaultConnection
- - - -

Network cards

- - - - - - - - - - - - - - - 300, - "down" => 200, - default => 100 - }; - $statB = match ($b["operstate"]) { - "up" => 300, - "down" => 200, - default => 100 - }; - - return $statB - $statA; - }); - - foreach ($computer["network"] as $iface): ?> - > - - - - - - - - - - - -
InterfaceStateIP addressesMAC addressTypeInternalVirtualDHCP
- - - -

Network connections

- - - - - - - - - - - - - - - - - - - - - -
StateProtocolSourceDestinationProcess
"Connected", - "LISTEN" => "Listening", - "CLOSING" => "Terminating", - "UNKNOWN" => "?", - "LAST_ACK", "FIN_WAIT2", "TIME_WAIT" => "Waiting", - "FIN_WAIT1", "CLOSE_WAIT" => "Closing", - "SYN_RECV" => "Received", - "SYN_SENT" => "Attempting", - default => $connection["state"], - } ?> "TCP over IPv4", - "tcp6" => "TCP over IPv6", - "tcp46" => "TCP over IPv4 and IPv6", - "udp4" => "UDP over IPv4", - "udp6" => "UDP over IPv6", - "udp46" => "UDP over IPv4 and IPv6", - default => $connection["protocol"], - } ?> "<local IPv4>", - "::1" => "<local IPv6>", - default => $connection["localAddress"], - } ?> (port ) "<local IPv4>", - "::1" => "<local IPv6>", - default => $connection["localAddress"], - } ?> () 0) { - echo($f[0]["name"] . " [" . $connection["pid"] . "]"); - } else { - echo($connection["pid"]); - } - - ?>
- - - 0): ?> -

Processes

- - - - - - - - - - - - - - - - - - - - - - - -
PIDNameCPURAMUserStarted
%%
- - -
- - -
-

- Remote controlling - Back -

- -
- Initialising connection...
-
- - - - - - - - -
-

Devices

-

Click on a device to view information about it

- -
- Luna and the Cold Haze Devices software are deprecated. These applications are now deprecated and monitoring devices through Luna is not supported anymore. Basic support and servers will be shut down on July 1st. -
- - -
- - - - - - diff --git a/pages/contacts.inc b/pages/contacts.inc deleted file mode 100644 index b93460a..0000000 --- a/pages/contacts.inc +++ /dev/null @@ -1,273 +0,0 @@ - $value) { - if (trim($value) === "") $_POST[$key] = null; - if (isset($_POST[$key])) $_POST[$key] = str_replace(">", ">", str_replace("<", "<", str_replace("&", "&", substr($_POST[$key], 0, $key === "description" ? 400 : 100)))); - } - - foreach ($methods as $name => $method) { - if (isset($_POST[$name]) && isset($method["adapter"])) { - $_POST[$name] = exec("cd \"$_SERVER[DOCUMENT_ROOT]/includes/external/addressbook\" && node \"$_SERVER[DOCUMENT_ROOT]/includes/external/addressbook/$method[adapter]\" \"$_POST[$name]\""); - } - } - - $contacts[$id] = $_POST; - file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/addressbook/contacts.json", json_encode($contacts)); - createJob("UpdateContactMethods", [ - "contact" => $id - ]); - - header("Location: /-/contacts"); - die(); -} else if (isset($_GET["delete"])) { - if (isset($contacts[$_GET["delete"]])) { - unset($contacts[$_GET["delete"]]); - } - - file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/addressbook/contacts.json", json_encode($contacts)); - - header("Location: /-/contacts"); - die(); -} - -require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/components/header.inc'; global $Parsedown; - -$cache = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/addressbook/saved.json"), true); - -uasort($contacts, function ($a, $b) { - return strnatcasecmp($a["nick"], $b["nick"]); -}); - -?> - - - -
-
-
-

- - Create -

- - $contact): ?> -
-
-
- - - - - - - - - - -
-
text($contact["description"] ?? "") ?>
-
-
- - $method): if (isset($contact[$name]) && isset($cache[$name][$contact[$name]])): $data = $cache[$name][$contact[$name]]["data"]; ?> -
- -
- -
- -
-
-
- -
- - E, D - -
-
- -
-
- - - - - - - - - - diff --git a/pages/edit-private.inc b/pages/edit-private.inc deleted file mode 100644 index f26c8c6..0000000 --- a/pages/edit-private.inc +++ /dev/null @@ -1,40 +0,0 @@ -

Cold Haze

-

ponies in 3 plural systems

+

ponies in 4 plural systems

-

+

ponies in 3 plural systems

@@ -34,35 +34,14 @@ function banner() { global $isLoggedIn; global $isLowerLoggedIn; $byColor = getM function members() { global $isLoggedIn; global $isLowerLoggedIn; global $app; ?>
-
style="grid-template-columns: repeat(3, 1fr);"> +
style="grid-template-columns: repeat(4, 1fr);"> +
- -
- -

Pony Legacy
-
- -
-
- -
' . ($member['name'] ?? $id) . '
-
' . (isset($member['prefix']) ? "" . $member['prefix'] . " · " : "") . date('j M Y', strtotime($member["date"])) . '
-
'); - - endforeach; ?> -
-

@@ -164,7 +143,7 @@ function members() { global $isLoggedIn; global $isLowerLoggedIn; global $app; ?
+ +
+ Cold Haze Documents is now deprecated. Cold Haze's Documents feature is now deprecated in favor of Google Docs and will be removed in the future. Please migrate your documents to Google Drive as soon as possible. +
+ + diff --git a/pages/metadata.inc b/pages/metadata.inc index 2a67e9f..aea128b 100644 --- a/pages/metadata.inc +++ b/pages/metadata.inc @@ -12,9 +12,9 @@ array_shift($parts); $system = $parts[0]; $member = !isset($parts[1]) || $parts[1] === "" ? null : $parts[1]; -if ($system !== "cloudburst" && $system !== "raindrops" && $system !== $app["other"]["slug"]) peh_error("Invalid system name: " . $system, 400); -$systemCommonName = $system === "cloudburst" ? "Cloudburst System" : ($system === $app["other"]["slug"] ? $app["other"]["name"] : "Raindrops System"); -$systemID = $system === "cloudburst" ? "ynmuc" : ($system === $app["other"]["slug"] ? $app["other"]["id"] : "gdapd"); +if ($system !== "cloudburst" && $system !== "raindrops" && $system !== "moonglow" && $system !== $app["other"]["slug"]) peh_error("Invalid system name: " . $system, 400); +$systemCommonName = $system === "cloudburst" ? "Cloudburst System" : ($system === $app["other"]["slug"] && ($isLoggedIn || $isLowerLoggedIn) ? $app["other"]["name"] : ($system === "moonglow" ? "Moonglow" : "Raindrops System")); +$systemID = $system === "cloudburst" ? "ynmuc" : ($system === $app["other"]["slug"] && ($isLoggedIn || $isLowerLoggedIn) ? $app["other"]["id"] : ($system === "moonglow" ? "hrbom" : "gdapd")); if ($isLowerLoggedIn && $systemID !== $app["other"]["id"]) { header("Location: /"); diff --git a/pages/page.inc b/pages/page.inc index 931e6e5..fb63383 100644 --- a/pages/page.inc +++ b/pages/page.inc @@ -9,13 +9,18 @@ if (!isset($_GET['_']) || trim($_GET['_']) === "") peh_error("Invalid request", $parts = explode("/", $_GET['_']); -if (($parts[0] !== "cloudburst" && $parts[0] !== "raindrops" && $parts[0] !== $app["other"]["slug"]) && (!(count($parts) > 2) || $parts[1] === "-")) { +if (($parts[0] !== "cloudburst" && $parts[0] !== "raindrops" && $parts[0] !== "moonglow" && $parts[0] !== $app["other"]["slug"]) && (!(count($parts) > 2) || $parts[1] === "-")) { $namesCloudburst = [...array_map(function ($i) { return $i['name']; }, json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/ynmuc/members.json"), true)), "unknown-cb"]; $namesRaindrops = [...array_map(function ($i) { return $i['name']; }, json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/gdapd/members.json"), true)), "unknown-rd"]; + $namesMoonglow = array_map(function ($i) { + return $i['name']; + }, array_filter(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/hrbom/members.json"), true), function ($i) { + return file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/metadata/" . $i["id"] . ".json"); + })); $namesOther = []; if ($isLoggedIn || $isLowerLoggedIn) { @@ -32,6 +37,8 @@ if (($parts[0] !== "cloudburst" && $parts[0] !== "raindrops" && $parts[0] !== $a $parts[0] = "cloudburst"; } else if (in_array($parts[1], $namesRaindrops)) { $parts[0] = "raindrops"; + } else if (in_array($parts[1], $namesMoonglow)) { + $parts[0] = "moonglow"; } else if (in_array($parts[1], $namesOther) && ($isLoggedIn || $isLowerLoggedIn)) { $parts[0] = $app["other"]["slug"]; } @@ -40,11 +47,11 @@ if (($parts[0] !== "cloudburst" && $parts[0] !== "raindrops" && $parts[0] !== $a } $system = $parts[0]; -$member = (isset($parts[1]) ? $parts[1] : null) === "" ? null : (isset($parts[1]) ? $parts[1] : null); +$member = ($parts[1] ?? null) === "" ? null : ($parts[1] ?? null); -if ($system !== "cloudburst" && $system !== "raindrops" && ($system !== $app["other"]["slug"] && !$isLowerLoggedIn && !$isLoggedIn)) peh_error("System not found", 404); -$systemCommonName = $system === "cloudburst" ? "Cloudburst System" : ($system === $app["other"]["slug"] && ($isLoggedIn || $isLowerLoggedIn) ? $app["other"]["name"] : "Raindrops System"); -$systemID = $system === "cloudburst" ? "ynmuc" : ($system === $app["other"]["slug"] && ($isLoggedIn || $isLowerLoggedIn) ? $app["other"]["id"] : "gdapd"); +if ($system !== "cloudburst" && $system !== "raindrops" && $system !== "moonglow" && ($system !== $app["other"]["slug"] && !$isLowerLoggedIn && !$isLoggedIn)) peh_error("System not found", 404); +$systemCommonName = $system === "cloudburst" ? "Cloudburst System" : ($system === $app["other"]["slug"] && ($isLoggedIn || $isLowerLoggedIn) ? $app["other"]["name"] : ($system === "moonglow" ? "Moonglow" : "Raindrops System")); +$systemID = $system === "cloudburst" ? "ynmuc" : ($system === $app["other"]["slug"] && ($isLoggedIn || $isLowerLoggedIn) ? $app["other"]["id"] : ($system === "moonglow" ? "hrbom" : "gdapd")); if ($member === null) { global $_SystemName; diff --git a/pages/pleasure.inc b/pages/pleasure.inc index ec468d5..883af9a 100644 --- a/pages/pleasure.inc +++ b/pages/pleasure.inc @@ -1,6 +1,12 @@ diff --git a/pages/schedules.inc b/pages/schedules.inc index 03277cc..dde2981 100644 --- a/pages/schedules.inc +++ b/pages/schedules.inc @@ -33,18 +33,7 @@ global $use2023UI;

Schedules

-

World clock

-
-
-
- Meadowsys
-

--:--

-
- - -
-

@@ -69,6 +58,13 @@ global $use2023UI;

--:--

+ +
+
+ Moonwind System
+

--:--

+
+
@@ -87,31 +83,31 @@ global $use2023UI; } function updateTime() { - let time0 = (new Intl.DateTimeFormat('en-US', { - timeZone: 'America/Los_Angeles', + let time1 = (new Intl.DateTimeFormat('en-US', { + timeZone: 'Europe/Paris', hour: 'numeric', minute: '2-digit', - hour12: true + hour12: false })).format(new Date()); - document.getElementById("live-time-other2").innerText = time0; - document.getElementById("live-time-other2-outer").style.backgroundPositionY = getDayPercentage(time0) + "%"; + document.getElementById("live-time-raindrops").innerText = time1; + document.getElementById("live-time-raindrops-outer").style.backgroundPositionY = getDayPercentage(time1) + "%"; - let time1 = (new Intl.DateTimeFormat('en-US', { - timeZone: 'Europe/Paris', + let time4 = (new Intl.DateTimeFormat('en-US', { + timeZone: 'Europe/Kyiv', hour: 'numeric', minute: '2-digit', - hour12: true + hour12: false })).format(new Date()); - document.getElementById("live-time-raindrops").innerText = time1; - document.getElementById("live-time-raindrops-outer").style.backgroundPositionY = getDayPercentage(time1) + "%"; + document.getElementById("live-time-moonwind").innerText = time4; + document.getElementById("live-time-moonwind-outer").style.backgroundPositionY = getDayPercentage(time4) + "%"; let time2 = (new Intl.DateTimeFormat('en-US', { timeZone: 'Europe/London', hour: 'numeric', minute: '2-digit', - hour12: true + hour12: false })).format(new Date()); document.getElementById("live-time-cloudburst").innerText = time2; @@ -121,24 +117,11 @@ global $use2023UI; timeZone: 'America/Chicago', hour: 'numeric', minute: '2-digit', - hour12: true + hour12: false })).format(new Date()); document.getElementById("live-time-other").innerText = time3; document.getElementById("live-time-other-outer").style.backgroundPositionY = getDayPercentage(time3) + "%"; - - document.getElementById("live-time-other1").innerText = (new Intl.DateTimeFormat('en-US', { - timeZone: 'America/Anchorage', - hour: 'numeric', - minute: '2-digit', - hour12: true - })).format(new Date()); - document.getElementById("live-time-other2").innerText = (new Intl.DateTimeFormat('en-US', { - timeZone: 'America/Vancouver', - hour: 'numeric', - minute: '2-digit', - hour12: true - })).format(new Date()); } updateTime(); @@ -148,9 +131,4 @@ global $use2023UI; }, 10000); -
"; - require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/fragments/evening.inc"; -} ?> - diff --git a/pages/sessions.inc b/pages/sessions.inc index 0e4e779..fc861bf 100644 --- a/pages/sessions.inc +++ b/pages/sessions.inc @@ -57,8 +57,8 @@ $verifiedNames = [ foreach ($list as $token): $session = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/sessions/" . $token), true); if (isset($session["profile"]) && isset($session["name"]) && ($session["profile"]["id"] ?? "") === ($_PROFILE["id"] ?? "")): uasort($session["addresses"], function ($a, $b) { return $b - $a; }); ?> - - This device - -
-
-
-

Statistics

- 0, - "raindrops" => 0, - "total" => 0, - "end" => strtotime($switch["timestamp"]), - "start" => null - ]; - - if ($week !== $lastWeek) { - if (isset($weeks[$lastWeek])) { - $weeks[$lastWeek]["start"] = strtotime($switch["timestamp"]); - $lastWeek = $week; - } - } - - $weeks[$week]["raindrops"]++; - $weeks[$week]["total"]++; - } - - $lastWeek = 0; - foreach ($switchesCloudburst as $switch) { - $week = date('YW', strtotime($switch["timestamp"])); - if ($lastWeek === 0) $lastWeek = $week; - - if (!isset($weeks[$week])) $weeks[$week] = [ - "cloudburst" => 0, - "raindrops" => 0, - "total" => 0, - "end" => strtotime($switch["timestamp"]), - "start" => null - ]; - - if ($week !== $lastWeek) { - if (isset($weeks[$lastWeek])) { - $weeks[$lastWeek]["start"] = strtotime($switch["timestamp"]); - $lastWeek = $week; - } - } - - $weeks[$week]["cloudburst"]++; - $weeks[$week]["total"]++; - } - - $index = 0; - foreach ($weeks as $id => $week) { - if ($index >= 20) continue; - $weeksRectified[$id] = $week; - $index++; - } - - $weeksRectified = array_filter(array_reverse($weeksRectified), function ($i) { - return $i["start"] > 1651363200; - }); - - $members = []; - $frontersMonth = []; - - $fronts = []; - $lastFrontIDs = []; - - foreach (array_reverse($switchesRaindrops) as $switch) { - foreach ($lastFrontIDs as $frontID) { - $fronts[$frontID]["end"] = strtotime($switch["timestamp"]); - } - $lastFrontIDs = []; - - $index = 0; foreach ($switch["members"] as $member) { - if (strtotime($switch["timestamp"]) - (time() - 86400*30) < 0) continue; - $fronts[$switch["id"] . ":" . $index] = [ - "member" => $member, - "start" => strtotime($switch["timestamp"]), - "end" => strtotime(date('c')), - "duration" => null - ]; - $lastFrontIDs[] = $switch["id"] . ":" . $index; - } $index++; - } - - foreach ($fronts as $id => $front) { - $fronts[$id]["duration"] = $front["end"] - $front["start"]; - - if (!($front["start"] - (time() - 86400*30) < 0)) { - if (!isset($members[$front["member"]])) $members[$front["member"]] = [ - "time" => 0, - "name" => getMemberWithoutSystem($front["member"])["display_name"], - "color" => getMemberWithoutSystem($front["member"])["color"], - ]; - $members[$front["member"]]["time"] += $fronts[$id]["duration"]; - } - } - - foreach ($fronts as $front) { - if (!isset($frontersMonth[date('Y-m', $front["start"])])) $frontersMonth[date('Y-m', $front["start"])] = []; - if (!isset($frontersMonth[date('Y-m', $front["start"])][$front["member"]])) $frontersMonth[date('Y-m', $front["start"])][$front["member"]] = 0; - $frontersMonth[date('Y-m', $front["start"])][$front["member"]] += $front["duration"]; - } - - $fronts = []; - $lastFrontIDs = []; - - foreach (array_reverse($switchesCloudburst) as $switch) { - foreach ($lastFrontIDs as $frontID) { - $fronts[$frontID]["end"] = strtotime($switch["timestamp"]); - } - $lastFrontIDs = []; - - $index = 0; foreach ($switch["members"] as $member) { - $fronts[$switch["id"] . ":" . $index] = [ - "member" => $member, - "start" => strtotime($switch["timestamp"]), - "end" => strtotime(date('c')), - "duration" => null - ]; - $lastFrontIDs[] = $switch["id"] . ":" . $index; - } $index++; - } - - foreach ($fronts as $id => $front) { - $fronts[$id]["duration"] = $front["end"] - $front["start"]; - - if (!($front["start"] - (time() - 86400*30) < 0)) { - if (!isset($members[$front["member"]])) $members[$front["member"]] = [ - "time" => 0, - "name" => getMemberWithoutSystem($front["member"])["display_name"], - "color" => getMemberWithoutSystem($front["member"])["color"], - ]; - $members[$front["member"]]["time"] += $fronts[$id]["duration"]; - } - } - - foreach ($fronts as $front) { - if (!isset($frontersMonth[date('Y-m', $front["start"])])) $frontersMonth[date('Y-m', $front["start"])] = []; - if (!isset($frontersMonth[date('Y-m', $front["start"])][$front["member"]])) $frontersMonth[date('Y-m', $front["start"])][$front["member"]] = 0; - $frontersMonth[date('Y-m', $front["start"])][$front["member"]] += $front["duration"]; - } - - $fronts = array_reverse($fronts); - uasort($members, function ($a, $b) { - return $b["time"] - $a["time"]; - }); - - $frontersMonthRectified = []; - foreach ($frontersMonth as $monthID => $month) { - $thisMonth = []; - - foreach ($month as $id => $time) { - $thisMonth[$id] = [ - "duration" => $time, - "name" => getMemberWithoutSystem($id)["display_name"], - "color" => getMemberWithoutSystem($id)["color"] - ]; - } - - $frontersMonthRectified[$monthID] = $thisMonth; - } - - uasort($frontersMonthRectified, function ($a, $b) use ($frontersMonthRectified) { - return strtotime(array_search($a, $frontersMonthRectified) . "-01") - strtotime(array_search($b, $frontersMonthRectified) . "-01"); - }); - - $frontersMonthMembers = []; - foreach ($frontersMonthRectified as $month => $fronters) { - foreach ($fronters as $fronter => $data) { - foreach (scoreOrderGlobal() as $member) { - if (!isset($frontersMonthMembers[$member["id"]])) $frontersMonthMembers[$member["id"]] = []; - } - } - - foreach ($frontersMonthMembers as $key => $member) { - $frontersMonthMembers[$key][$month] = $frontersMonthRectified[$month][$key] ?? [ - "duration" => 0 - ]; - } - } - - ?> - -

Switches per week

- - - -

Average switches per day of the week

- - - - -

Switches per hour of the day

- - - - -
-
- - diff --git a/pages/terminology.inc b/pages/terminology.inc deleted file mode 100644 index 77a19de..0000000 --- a/pages/terminology.inc +++ /dev/null @@ -1,15 +0,0 @@ - - -
-
-
- -
-
- - \ No newline at end of file -- cgit