mirror of
https://github.com/opensourcepos/opensourcepos.git
synced 2026-05-24 16:28:40 -04:00
Read plugin LICENSES json and display in Store Config (#359)
This commit is contained in:
@@ -17,6 +17,7 @@ class Config extends Secure_Controller
|
||||
private function _licenses()
|
||||
{
|
||||
$i = 0;
|
||||
$various = FALSE;
|
||||
$license = array();
|
||||
|
||||
$license[$i]['title'] = 'Open Source Point Of Sale ' . $this->config->item('application_version');
|
||||
@@ -36,23 +37,71 @@ class Config extends Secure_Controller
|
||||
foreach($dir as $fileinfo)
|
||||
{
|
||||
// license files must be in couples: .version (name & version) & .license (license text)
|
||||
if($fileinfo->isFile() && $fileinfo->getExtension() == 'version')
|
||||
if($fileinfo->isFile())
|
||||
{
|
||||
++$i;
|
||||
|
||||
$basename = 'license/' . $fileinfo->getBasename('.version');
|
||||
|
||||
$license[$i]['title'] = $this->xss_clean(file_get_contents($basename . '.version', NULL, NULL, 0, 100));
|
||||
|
||||
$license_text_file = $basename . '.license';
|
||||
|
||||
if(file_exists($license_text_file))
|
||||
if($fileinfo->getExtension() == 'version')
|
||||
{
|
||||
$license[$i]['text'] = $this->xss_clean(file_get_contents($license_text_file , NULL, NULL, 0, 2000));
|
||||
++$i;
|
||||
|
||||
$basename = 'license/' . $fileinfo->getBasename('.version');
|
||||
|
||||
$license[$i]['title'] = $this->xss_clean(file_get_contents($basename . '.version', NULL, NULL, 0, 100));
|
||||
|
||||
$license_text_file = $basename . '.license';
|
||||
|
||||
if(file_exists($license_text_file))
|
||||
{
|
||||
$license[$i]['text'] = $this->xss_clean(file_get_contents($license_text_file , NULL, NULL, 0, 2000));
|
||||
}
|
||||
else
|
||||
{
|
||||
$license[$i]['text'] = $license_text_file . ' file is missing';
|
||||
}
|
||||
}
|
||||
else
|
||||
elseif($fileinfo->getBasename() == 'LICENSES')
|
||||
{
|
||||
$license[$i]['text'] = $license_text_file . ' file is missing';
|
||||
// set a flag to indicate that the LICENSES file is available and needs to be attached at the end
|
||||
$various = TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// attach the licenses from the LICENSES file generated by bower
|
||||
if($various)
|
||||
{
|
||||
++$i;
|
||||
$license[$i]['title'] = 'Plugins';
|
||||
$license[$i]['text'] = '';
|
||||
|
||||
$file = file_get_contents('license/LICENSES');
|
||||
$array = json_decode($file, true);
|
||||
|
||||
foreach($array as $key => $val)
|
||||
{
|
||||
if(is_array($val))
|
||||
{
|
||||
$license[$i]['text'] .= 'component: ' . $key . "\n";
|
||||
|
||||
foreach($val as $key1 => $val1)
|
||||
{
|
||||
if(is_array($val1))
|
||||
{
|
||||
$license[$i]['text'] .= $key1 . ': ';
|
||||
|
||||
foreach($val1 as $key2 => $val2)
|
||||
{
|
||||
$license[$i]['text'] .= $val2 . ' ';
|
||||
}
|
||||
|
||||
$license[$i]['text'] .= "\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
$license[$i]['text'] .= $key1 . ': ' . $val1 . "\n";
|
||||
}
|
||||
}
|
||||
|
||||
$license[$i]['text'] .= "\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2011-2015 Twitter, Inc
|
||||
Copyright (c) 2011-2016 Twitter, Inc
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
||||
@@ -1 +1 @@
|
||||
Bootstrap 3.3.6
|
||||
Bootstrap 3.3.7
|
||||
@@ -1 +1 @@
|
||||
Bootswatch 3.3.6
|
||||
Bootswatch 3.3.7
|
||||
@@ -1,44 +0,0 @@
|
||||
Copyright 2007, 2014 jQuery Foundation and other contributors,
|
||||
https://jquery.org/
|
||||
|
||||
This software consists of voluntary contributions made by many
|
||||
individuals. For exact contribution history, see the revision history
|
||||
available at https://github.com/jquery/jquery-ui
|
||||
|
||||
The following license applies to all parts of this software except as
|
||||
documented below:
|
||||
|
||||
====
|
||||
|
||||
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.
|
||||
|
||||
====
|
||||
|
||||
Copyright and related rights for sample code are waived via CC0. Sample
|
||||
code is defined as all source code contained within the demos directory.
|
||||
|
||||
CC0: http://creativecommons.org/publicdomain/zero/1.0/
|
||||
|
||||
====
|
||||
|
||||
All files located in the node_modules and external directories are
|
||||
externally maintained libraries used by this software which have their
|
||||
own licenses; we recommend you read them, as their terms may differ from
|
||||
the terms above.
|
||||
@@ -1 +0,0 @@
|
||||
jQuery 1.12.4 jQuery-UI 1.11.4
|
||||
Reference in New Issue
Block a user