diff options
author | Simon Rettberg | 2021-04-15 11:41:22 +0200 |
---|---|---|
committer | Simon Rettberg | 2021-04-15 11:41:22 +0200 |
commit | 3e90f9783339012fca2d17a30ba83b4f2f5b9014 (patch) | |
tree | 874452c478a8dc08184feb028812485e678125a7 | |
parent | [baseconfig_bwlp] Add SLX_PRINT_REUSE_PASSWORD (diff) | |
download | slx-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.php | 11 |
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); |