From bf4b65c18d8d8a2eb156883863c2de8814718e9a Mon Sep 17 00:00:00 2001 From: "Ramón M. Gómez" Date: Tue, 12 Jun 2018 15:25:43 +0200 Subject: #843: Web interface uses new version file and correcting some errata. --- admin/WebConsole/barramenu.php | 2 +- admin/WebConsole/index.php | 17 +++++++++++------ admin/WebConsole/nada.php | 9 ++++++++- admin/WebConsole/principal/acercade.php | 18 ++++++++++++------ installer/opengnsys_import.sh | 3 ++- installer/vagrant/Vagrantfile-devel-vbox | 2 +- 6 files changed, 35 insertions(+), 16 deletions(-) diff --git a/admin/WebConsole/barramenu.php b/admin/WebConsole/barramenu.php index d6561cfc..dfb618ed 100644 --- a/admin/WebConsole/barramenu.php +++ b/admin/WebConsole/barramenu.php @@ -13,7 +13,7 @@ if(stripos($device,'iphone') !== false ){$device="iphone";} elseif (stripos($device,'ipad') !== false) {$device="ipad";} elseif (stripos($device,'android') !== false){$device="android";} else{$device=0;} -$version=exec("cat /opt/opengnsys/doc/VERSION.txt"); +$version=@json_decode(file_get_contents("/opt/opengnsys/doc/VERSION.json"))->version; if(preg_match("/1.0.4/",$version) == TRUE ){$version=4;} // ******************************************************************************************************** include_once("./includes/ctrlacc.php"); diff --git a/admin/WebConsole/index.php b/admin/WebConsole/index.php index f416b7f3..2b522d59 100644 --- a/admin/WebConsole/index.php +++ b/admin/WebConsole/index.php @@ -120,15 +120,20 @@ function PulsaEnter(oEvento){
+ '; - include ($versionfile); - echo ''; +// Añadir versión en el enlace a la URL del proyecto. +$data = json_decode(@file_get_contents(__DIR__ . '/../doc/VERSION.json')); +if (empty($data->project)) { + echo "OpenGnsys"; +} else { + echo @$data->project.' ' + .@$data->version.' ' + .(isset($data->codename) ? '('.$data->codename.') ' : '') + .@$data->release; } ?> +
diff --git a/admin/WebConsole/nada.php b/admin/WebConsole/nada.php index 52d0d028..84e7b490 100644 --- a/admin/WebConsole/nada.php +++ b/admin/WebConsole/nada.php @@ -152,6 +152,13 @@ $vernav=end($buscavernav); if ($device == "ipad" || $device == "iphone" || $device == "android" ) { +$data = json_decode(@file_get_contents(__DIR__ . '/../doc/VERSION.json')); +if (empty($data->project)) { + $version = "OpenGnsys"; +} else { + $version = @$data->project.' ' . @$data->version.' ' + . (isset($data->codename) ? '('.$data->codename.') ' : '') . @$data->release; +} ?> @@ -168,7 +175,7 @@ if ($device == "ipad" || $device == "iphone" || $device == "android" ) - +   diff --git a/admin/WebConsole/principal/acercade.php b/admin/WebConsole/principal/acercade.php index 2981ce0e..f95e07c1 100644 --- a/admin/WebConsole/principal/acercade.php +++ b/admin/WebConsole/principal/acercade.php @@ -24,10 +24,15 @@ include_once("../idiomas/php/".$idioma."/acercade_".$idioma.".php");

project)) { + echo "OpenGnsys"; +} else { + echo @$data->project.' ' + .@$data->version.' ' + .(isset($data->codename) ? '('.$data->codename.') ' : '') + .@$data->release; +} ?>

".$TbMsg["CHANGE"].""; - include ($versionfile);} + echo "".$TbMsg["CHANGE"]."" + .@$data->project.' '.@$data->version.' '.(isset($data->codename)?'('.$data->codename.')':''); + } ?>

".$TbMsg["MANUAL"]."";?>

diff --git a/installer/opengnsys_import.sh b/installer/opengnsys_import.sh index b2a9463b..c3b343ee 100755 --- a/installer/opengnsys_import.sh +++ b/installer/opengnsys_import.sh @@ -220,7 +220,8 @@ if [ $? -ne 0 ]; then fi # Comprobamos si es la misma versión -OLDVERSION=$(jq -r '.version' $TMPDIR/VERSION.json) +[ -f $TMPDIR/VERSION.txt ] && OLDVERSION=$(awk '{print $2}' $TMPDIR/VERSION.txt) +[ -f $TMPDIR/VERSION.json ] && OLDVERSION=$(jq -r '.version' $TMPDIR/VERSION.json) NEWVERSION=$(jq -r '.version' $OPENGNSYS/doc/VERSION.json) # FALTA: Comprobar que la versión OLD es menor que la NEW if [ $OLDVERSION != $NEWVERSION ] ; then diff --git a/installer/vagrant/Vagrantfile-devel-vbox b/installer/vagrant/Vagrantfile-devel-vbox index 4d41afd0..00d7dab6 100644 --- a/installer/vagrant/Vagrantfile-devel-vbox +++ b/installer/vagrant/Vagrantfile-devel-vbox @@ -25,7 +25,7 @@ LOCALWEBPORT = 8443 # OpenGnsys Server provisioning script: prepare repo disk, install OpenGnsys, change default interface, configure DHCP server. OGSERVERSCRIPT = <