From 94c57fa247ba107fce8fc1d1fc355191229dbddc Mon Sep 17 00:00:00 2001 From: Minteck Date: Sun, 8 Aug 2021 22:31:51 +0200 Subject: Permissions system --- admin/panes/audit.php | 56 ++++++++++++++++++++++++++++++----------- admin/panes/denied.php | 62 ++++++++++++++++++++++++++++++++++++++++++++++ admin/panes/home.php | 36 +++++++-------------------- admin/panes/neutroning.php | 4 +-- admin/panes/quotas.php | 8 +++--- admin/panes/telemetry.php | 26 +++++++++---------- admin/panes/unchained.php | 16 ++++++------ admin/panes/uptime.php | 21 ++++------------ admin/panes/version.php | 26 +++++++++---------- 9 files changed, 157 insertions(+), 98 deletions(-) create mode 100644 admin/panes/denied.php (limited to 'admin/panes') diff --git a/admin/panes/audit.php b/admin/panes/audit.php index c2a8609..3292ec8 100644 --- a/admin/panes/audit.php +++ b/admin/panes/audit.php @@ -51,13 +51,13 @@
-

Security Audit

+

- - - + + + @@ -69,6 +69,16 @@ $dir = array_reverse($dir); + /** @var array $perms */ + $viewFullIps = false; + foreach ($perms as $user => $uperms) { + if ($user === $_DATA['id']) { + if (in_array("addresses", $uperms)) { + $viewFullIps = true; + } + } + } + foreach ($dir as $file) { if ($file !== "." && $file !== "..") { if (substr($file, 0, 5) === "auth.") { @@ -129,8 +139,24 @@ $index = 1; foreach ($ips as $ip => $info) { if ($ip !== "port") { + $pip = explode(".", $ip); + + if ($viewFullIps) { + $rip = $ip; + } else { + if (strlen($pip[3]) === 3) $pip[3] = "xxx"; + if (strlen($pip[3]) === 2) $pip[3] = "xx"; + if (strlen($pip[3]) === 1) $pip[3] = "x"; + + if (strlen($pip[2]) === 3) $pip[2] = "xxx"; + if (strlen($pip[2]) === 2) $pip[2] = "xx"; + if (strlen($pip[2]) === 1) $pip[2] = "x"; + + $rip = implode(".", $pip); + } + echo(" - - - + "); $index++; diff --git a/admin/panes/denied.php b/admin/panes/denied.php new file mode 100644 index 0000000..9a29fcb --- /dev/null +++ b/admin/panes/denied.php @@ -0,0 +1,62 @@ + + + + +
+
+

+ + +

+
+

+ +

admin..


+ +
+

+ +

+
+ + +

+ , +

+
+
+ + \ No newline at end of file diff --git a/admin/panes/home.php b/admin/panes/home.php index fade996..3bc3429 100644 --- a/admin/panes/home.php +++ b/admin/panes/home.php @@ -30,28 +30,10 @@
-

Welcome back !

+

!

  • - Server running at °C, 90) { - echo("completely overheating!"); - } else if ($outd["cpu_thermal-virtual-0"]["temp1"]["temp1_input"] > 60) { - echo("starting to throttle!"); - } else { - echo("under normal temperatures"); - } - - ?> Manage...
  • --.-°C, n/a ...
  • UnchainedTech article·s, , draft·s Manage...
  • + ?> ...
  • Neutron Cloud website·s Manage...
  • + ?> ...
  • Kartik Online player·s Manage...
  • -
  • Using ...
  • +
  • on all disks, , free Manage...
  • + ?> ...
diff --git a/admin/panes/version.php b/admin/panes/version.php index 10f1274..8642178 100644 --- a/admin/panes/version.php +++ b/admin/panes/version.php @@ -30,7 +30,7 @@
-

This server is running version

+

version

@@ -38,7 +38,7 @@
  • PHP
  • Minteck's Space
  • UnchainedTech
  • -
  • Neutron Cloud
  • +
  • Neutron Cloud ()
  • Neutron Copper
  • Neutron Titanium
  • @@ -64,7 +64,7 @@ $soft = $_SERVER['SERVER_SOFTWARE']; if (strpos(strtolower($soft), "apache") !== false) { - echo("Apache HTTP Server"); + echo(l("Apache HTTP Server", "Serveur HTTP Apache")); } else { echo("nginx"); } @@ -83,13 +83,13 @@
      -
    • Checking for updates...
    • +
    • ...
    • @@ -98,21 +98,21 @@ -- cgit
  • IP addressConnectionsUsername(s) Actions
    " . $ip . "
    Please wait...");?> +
    " . $rip . "
    " . l("Please wait", "Patientez") . "...");?> You"); + echo(" " . l("You", "Vous") . ""); } echo("
    "); @@ -166,27 +192,27 @@ } } if (count($info["connections"]) === 0) { - echo("Never connected"); + echo("" . l("Never connected", "Jamais connecté") . ""); } else { - echo($success . " succeeded, " . $failed . " failed, " . $invalid . " invalid"); + echo($success . " " . l("succeeded", "réussi") . ", " . $failed . " " . l("failed", "échoué") . ", " . $invalid . " " . l("invalid", "invalide")); } - echo("
    Last: "); + echo("
    " . l("Last", "Dernier ") . ": "); if ($info["connections"][0]["status"] === "ok") { - echo("Succeeded"); + echo("" . l("Succeeded", "Réussi") . ""); } if ($info["connections"][0]["status"] === "error") { - echo("Failed"); + echo("" . l("Failed", "Échoué") . ""); } if ($info["connections"][0]["status"] === "invalid") { - echo("Invalid"); + echo("" . l("Invalid", "Invalide") . ""); } echo("
    Show full list
      "); +
    " . l("Show full list", "Afficher la liste") . "
      "); $uniqueUsers = []; $connectionsWithUsers = 0; @@ -208,11 +234,11 @@ } if (count($uniqueUsers) === 0) { - echo("
    • Username was never sent to server
    • "); + echo("
    • " . l("Username was never sent to server", "Le nom d'utilisateur n'a jamais été transmis au service") . "
    • "); } echo("
    Details · Report" . l("Report as fraudulent", "Signaler comme fraude") . "