From 08edd92a2135d486603687b181979854b60a3bcc Mon Sep 17 00:00:00 2001 From: vincent-peugnet Date: Mon, 17 Dec 2018 16:28:28 +0100 Subject: license and version info --- LICENSE.md | 21 +++++++++++++++++++++ app/class/config.php | 2 ++ app/class/controllerinfo.php | 4 +++- app/fn/fn.php | 11 +++++++++++ app/view/templates/info.php | 7 ++++++- 5 files changed, 43 insertions(+), 2 deletions(-) create mode 100644 LICENSE.md diff --git a/LICENSE.md b/LICENSE.md new file mode 100644 index 0000000..4d7a09c --- /dev/null +++ b/LICENSE.md @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2018 Vincent Peugnet + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/app/class/config.php b/app/class/config.php index b778d83..36a5116 100644 --- a/app/class/config.php +++ b/app/class/config.php @@ -20,6 +20,8 @@ abstract class Config protected static $defaultfavicon = ''; protected static $showeditmenu = true; protected static $editsymbol = 'pen'; + protected static $version = ''; + diff --git a/app/class/controllerinfo.php b/app/class/controllerinfo.php index 8f8b494..306c818 100644 --- a/app/class/controllerinfo.php +++ b/app/class/controllerinfo.php @@ -12,10 +12,12 @@ class Controllerinfo extends Controller public function desktop() { if($this->user->iseditor()) { - $this->showtemplate('info', []); + $this->showtemplate('info', ['version' => getversion()]); } } + + diff --git a/app/fn/fn.php b/app/fn/fn.php index 49db200..655562f 100644 --- a/app/fn/fn.php +++ b/app/fn/fn.php @@ -81,6 +81,17 @@ function idclean(string $input) } +function getversion() +{ + if(file_exists('composer.json')) { + $composer = json_decode(file_get_contents('composer.json'), true); + $version = $composer['version']; + } else { + $version = 'unknown'; + } + return $version; +} + function array_update($base, $new) diff --git a/app/view/templates/info.php b/app/view/templates/info.php index d86bdc1..3203ce6 100644 --- a/app/view/templates/info.php +++ b/app/view/templates/info.php @@ -12,11 +12,16 @@

Info

+

Version

+ + + +

Links

About

-- cgit v1.2.3