diff --git a/core/core.php b/core/core.php index 17029dc0..da4ca366 100644 --- a/core/core.php +++ b/core/core.php @@ -34,6 +34,7 @@ class common { // Numéro de version const ZWII_VERSION = '9.2.22'; + const ZWII_UPDATE_CHANNEL = "v9"; public static $actions = []; public static $coreModuleIds = [ @@ -1700,8 +1701,8 @@ class helper { * Renvoie le numéro de version de Zwii est en ligne * @return string */ - public static function getOnlineVersion() { - return (@file_get_contents('http://zwiicms.com/update/version')); + public static function getOnlineVersion($channel = common::ZWII_UPDATE_CHANNEL) { + return (@file_get_contents('http://zwiicms.com/update/'. $channel . '/version')); } @@ -1709,8 +1710,8 @@ class helper { * Check si une nouvelle version de Zwii est disponible * @return bool */ - public static function checkNewVersion() { - if($version = helper::getOnlineVersion()) { + public static function checkNewVersion($channel = common::ZWII_UPDATE_CHANNEL) { + if($version = helper::getOnlineVersion($channel)) { //return (trim($version) !== common::ZWII_VERSION); return ((version_compare(common::ZWII_VERSION,$version)) === -1); } @@ -2581,8 +2582,8 @@ class layout extends common { if( $this->getData(['config','autoUpdate']) && $lastAutoUpdate > $this->getData(['core','lastAutoUpdate']) + 86400 ) { $this->setData(['core','lastAutoUpdate',$lastAutoUpdate]); - if ( helper::checkNewVersion() ) { - $rightItems .= '
  • ' . template::ico('update colorRed') . '
  • '; + if ( helper::checkNewVersion(common::ZWII_UPDATE_CHANNEL) ) { + $rightItems .= '
  • ' . template::ico('update colorRed') . '
  • '; } } } diff --git a/core/module/install/install.php b/core/module/install/install.php index ed2219c2..f1d72609 100755 --- a/core/module/install/install.php +++ b/core/module/install/install.php @@ -150,7 +150,7 @@ class install extends common { // Téléchargement case 2: // Téléchargement depuis le serveur de Zwii - $success = (file_put_contents(self::TEMP_DIR.'update.tar.gz', file_get_contents('https://zwiicms.com/update/update.tar.gz')) !== false); + $success = (file_put_contents(self::TEMP_DIR.'update.tar.gz', file_get_contents('https://zwiicms.com/update/' . common::ZWII_UPDATE_CHANNEL . '/update.tar.gz')) !== false); // Valeurs en sortie $this->addOutput([ 'display' => self::DISPLAY_JSON, @@ -227,7 +227,7 @@ class install extends common { */ public function update() { // Nouvelle version - self::$newVersion = file_get_contents('http://zwiicms.com/update/version'); + self::$newVersion = file_get_contents('http://zwiicms.com/update/' . common::ZWII_UPDATE_CHANNEL . 'version'); // Valeurs en sortie $this->addOutput([ 'display' => self::DISPLAY_LAYOUT_LIGHT,