From 079c2cc0676da76b510c7e99bda186781fae27fd Mon Sep 17 00:00:00 2001 From: Dany De Bontridder Date: Tue, 26 Jun 2012 13:41:33 +0000 Subject: [PATCH] check_plugin_version --- include/class_extension.php | 20 ++++++++++++++++++++ include/constant.php | 1 + 2 files changed, 21 insertions(+) diff --git a/include/class_extension.php b/include/class_extension.php index 20f3dd327..ea1f6c246 100644 --- a/include/class_extension.php +++ b/include/class_extension.php @@ -95,6 +95,7 @@ class Extension extends Menu_Ref_sql ' Veuillez mettre votre programme a jour. Version minimum '.$i); exit(); } + Extension::check_plugin_version(); } function insert_plugin() { @@ -162,5 +163,24 @@ class Extension extends Menu_Ref_sql } } } + static function check_plugin_version() + { + global $g_user,$version_plugin; + if ($g_user->Admin() == 1) + { + if (SITE_UPDATE_PLUGIN != "") + { + $update = @file_get_contents(SITE_UPDATE_PLUGIN); + if ($update > $version_plugin) + { + echo '
'; + echo '

'; + echo "Mise à jour disponible des plugin PhpCompta version actuelle : $update votre version $version_plugin"; + echo '

'; + echo '
'; + } + } + } + } } diff --git a/include/constant.php b/include/constant.php index 9a4429c3e..7c1195c8d 100644 --- a/include/constant.php +++ b/include/constant.php @@ -41,6 +41,7 @@ define ("DEBUG",true); // If you don't want to be notified of the update // define ("SITE_UPDATE",''); define ("SITE_UPDATE",'http://www.phpcompta.eu/last_version.txt'); +define ("SITE_UPDATE_PLUGIN",'http://www.phpcompta.eu/last_version.txt'); //$version_phpcompta=4985;