summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Rettberg2021-04-15 11:41:22 +0200
committerSimon Rettberg2021-04-15 11:41:22 +0200
commit3e90f9783339012fca2d17a30ba83b4f2f5b9014 (patch)
tree874452c478a8dc08184feb028812485e678125a7
parent[baseconfig_bwlp] Add SLX_PRINT_REUSE_PASSWORD (diff)
downloadslx-admin-3e90f9783339012fca2d17a30ba83b4f2f5b9014.tar.gz
slx-admin-3e90f9783339012fca2d17a30ba83b4f2f5b9014.tar.xz
slx-admin-3e90f9783339012fca2d17a30ba83b4f2f5b9014.zip
[remoteaccess] Make plugin version display prettier
-rw-r--r--modules-available/remoteaccess/api.inc.php11
1 files changed, 9 insertions, 2 deletions
diff --git a/modules-available/remoteaccess/api.inc.php b/modules-available/remoteaccess/api.inc.php
index 7983bd44..859f5cfe 100644
--- a/modules-available/remoteaccess/api.inc.php
+++ b/modules-available/remoteaccess/api.inc.php
@@ -32,9 +32,16 @@ if ($iplong < $range['start'] || $iplong > $range['end']) {
$headers = getallheaders();
$version = false;
if (!empty($headers['Bwlp-Plugin-Build-Revision'])) {
- $version = $headers['Bwlp-Plugin-Build-Revision'];
+ $version = substr($headers['Bwlp-Plugin-Build-Revision'], 0, 6);
if (!empty($headers['Bwlp-Plugin-Build-Timestamp'])) {
- $version .= ' (' . $headers['Bwlp-Plugin-Build-Timestamp'] . ')';
+ $ts = $headers['Bwlp-Plugin-Build-Timestamp'];
+ if (is_numeric($ts)) {
+ if ($ts > 9999999999) {
+ $ts = round($ts / 1000);
+ }
+ $ts = date('d.m.Y H:i', $ts);
+ }
+ $version .= ' (' . $ts . ')';
}
}
Property::set(RemoteAccess::PROP_PLUGIN_VERSION, $version, 2880);