From 94c57fa247ba107fce8fc1d1fc355191229dbddc Mon Sep 17 00:00:00 2001 From: Minteck Date: Sun, 8 Aug 2021 22:31:51 +0200 Subject: Permissions system --- admin/api/getIpLocation.php | 4 ++-- admin/api/getQuota.php | 20 ++++++++++---------- admin/api/getUbuntuUpgrades.php | 4 ++-- admin/api/serverLogSummary.php | 2 +- admin/api/serverTemp.php | 8 ++++---- admin/api/serverTime.php | 2 +- 6 files changed, 20 insertions(+), 20 deletions(-) (limited to 'admin/api') diff --git a/admin/api/getIpLocation.php b/admin/api/getIpLocation.php index fe34438..c40d96e 100644 --- a/admin/api/getIpLocation.php +++ b/admin/api/getIpLocation.php @@ -28,10 +28,10 @@ if ($data === null) { } if ($data["geoplugin_status"] === 404) { - die("Local IP address"); + die("" . l("Local IP address", "Adresse IP locale") . ""); } else { if ($data["geoplugin_inEU"]) { - die($data["geoplugin_countryName"] . " EU"); + die($data["geoplugin_countryName"] . " " . l("EU", "UE") . ""); } else { die($data["geoplugin_countryName"]); } diff --git a/admin/api/getQuota.php b/admin/api/getQuota.php index 7b4e8e9..1d64737 100644 --- a/admin/api/getQuota.php +++ b/admin/api/getQuota.php @@ -22,32 +22,32 @@ if (in_array($arg, $webs)) { if ($tier === "3") { $perc = ($parts2[0] / 100000) * 100; if ($perc > 75) { - die("Using " . $parts[0] . "/100M (" . round($perc, 2) . "%)"); + die("" . l("Using", "Utilise") . " " . $parts[0] . "/100M (" . round($perc, 2) . "%)"); } else if ($perc > 50) { - die("Using " . $parts[0] . "/100M (" . round($perc, 2) . "%)"); + die("" . l("Using", "Utilise") . " " . $parts[0] . "/100M (" . round($perc, 2) . "%)"); } else { - die("Using " . $parts[0] . "/100M (" . round($perc, 2) . "%)"); + die("" . l("Using", "Utilise") . " " . $parts[0] . "/100M (" . round($perc, 2) . "%)"); } } else if ($tier === "5") { $perc = ($parts2[0] / 250000) * 100; if ($perc > 75) { - die("Using " . $parts[0] . "/250M (" . round($perc, 2) . "%)"); + die("" . l("Using", "Utilise") . " " . $parts[0] . "/250M (" . round($perc, 2) . "%)"); } else if ($perc > 50) { - die("Using " . $parts[0] . "/250M (" . round($perc, 2) . "%)"); + die("" . l("Using", "Utilise") . " " . $parts[0] . "/250M (" . round($perc, 2) . "%)"); } else { - die("Using " . $parts[0] . "/250M (" . round($perc, 2) . "%)"); + die("" . l("Using", "Utilise") . " " . $parts[0] . "/250M (" . round($perc, 2) . "%)"); } } else if ($tier === "7") { $perc = ($parts2[0] / 500000) * 100; if ($perc > 75) { - die("Using " . $parts[0] . "/500M (" . round($perc, 2) . "%)"); + die("" . l("Using", "Utilise") . " " . $parts[0] . "/500M (" . round($perc, 2) . "%)"); } else if ($perc > 50) { - die("Using " . $parts[0] . "/500M (" . round($perc, 2) . "%)"); + die("" . l("Using", "Utilise") . " " . $parts[0] . "/500M (" . round($perc, 2) . "%)"); } else { - die("Using " . $parts[0] . "/500M (" . round($perc, 2) . "%)"); + die("" . l("Using", "Utilise") . " " . $parts[0] . "/500M (" . round($perc, 2) . "%)"); } } else { - die("Using " . $parts[0] . ""); + die("" . l("Using", "Utilise") . " " . $parts[0] . ""); } } diff --git a/admin/api/getUbuntuUpgrades.php b/admin/api/getUbuntuUpgrades.php index 7da6259..8273036 100644 --- a/admin/api/getUbuntuUpgrades.php +++ b/admin/api/getUbuntuUpgrades.php @@ -4,7 +4,7 @@ require_once $_SERVER['DOCUMENT_ROOT'] . "/admin/private/header.api.php"; exec("bash -c \"sudo do-release-upgrade -c | grep 'New release'\"", $ret); if (count($ret) === 1) { - echo("Ubuntu " . explode("'", $ret[0])[1] . " is available, use do-release-upgrade to upgrade"); + echo(l("Ubuntu " . explode("'", $ret[0])[1] . " is available, use do-release-upgrade to upgrade", "Ubuntu " . explode("'", $ret[0])[1] . " est disponible, exécutez la commande do-release-upgrade pour effectuer la mise à niveau")); } else { - echo("This server is running the latest version of Ubuntu"); + echo(l("This server is running the latest version of Ubuntu", "Ce serveur exécute la dernière version d'Ubuntu")); } \ No newline at end of file diff --git a/admin/api/serverLogSummary.php b/admin/api/serverLogSummary.php index 78c0a2c..a4a20a0 100644 --- a/admin/api/serverLogSummary.php +++ b/admin/api/serverLogSummary.php @@ -5,4 +5,4 @@ require_once $_SERVER['DOCUMENT_ROOT'] . "/admin/private/header.api.php"; exec("journalctl -b --quiet", $ret); $cnt = count($ret); -echo("" . $cnt . " system log messages since last system startup"); \ No newline at end of file +echo("" . $cnt . " " . l("system log messages since last system startup", "messages de journalisation du système depuis le dernier démarrage")); \ No newline at end of file diff --git a/admin/api/serverTemp.php b/admin/api/serverTemp.php index 55cf34b..613c411 100644 --- a/admin/api/serverTemp.php +++ b/admin/api/serverTemp.php @@ -2,7 +2,7 @@ require_once $_SERVER['DOCUMENT_ROOT'] . "/admin/private/header.api.php"; -echo("Server running at "); +echo(l("Server running at", "Serveur fonctionnant à") . " "); exec("sensors -j", $out); $outp = implode("\n", $out); $outd = json_decode($outp, true); @@ -12,9 +12,9 @@ echo(round($outd["cpu_thermal-virtual-0"]["temp1"]["temp1_input"], 1)); ?>°C, 90) { - echo("completely overheating!"); + echo(l("completely overheating!", "en pleine surchauffe !")); } else if ($outd["cpu_thermal-virtual-0"]["temp1"]["temp1_input"] > 60) { - echo("starting to throttle!"); + echo(l("starting to throttle!", "commence à être bridé !")); } else { - echo("under normal temperatures"); + echo(l("under normal temperatures", "températures habituelles")); } \ No newline at end of file diff --git a/admin/api/serverTime.php b/admin/api/serverTime.php index 77ba321..a64a39e 100644 --- a/admin/api/serverTime.php +++ b/admin/api/serverTime.php @@ -9,4 +9,4 @@ $mins = $num % 60; $num = intdiv($num, 60); $hours = $num % 24; $num = intdiv($num, 24); $days = $num; -echo($days . " day·s, " . $hours . " hour·s, " . $mins . " minute·s, " . ceil($secs) . " second·s"); \ No newline at end of file +echo(l($days . " day·s, " . $hours . " hour·s, " . $mins . " minute·s, " . ceil($secs) . " second·s", $days . " jour·s, " . $hours . " heure·s, " . $mins . " minute·s, " . ceil($secs) . " seconde·s")); \ No newline at end of file -- cgit