From a981feac88cf95e4007566283787833a9c94243e Mon Sep 17 00:00:00 2001 From: Alan Garcia Date: Sun, 3 Mar 2013 11:51:23 +0000 Subject: [PATCH] A merger avec stable 3.0 pour les fichiers 1.0.1.php et 3.0.1.php MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Quand on upgrade directement en 3.1, le panel change de répertoire, il faut pouvoir gérer les deux. --- install/upgrades/1.0.1.php | 14 +++++++++----- install/upgrades/3.0.0~3.php | 11 +++++++---- install/upgrades/3.0.1.php | 12 ++++++++---- 3 files changed, 24 insertions(+), 13 deletions(-) diff --git a/install/upgrades/1.0.1.php b/install/upgrades/1.0.1.php index 9946732e..e88222bc 100644 --- a/install/upgrades/1.0.1.php +++ b/install/upgrades/1.0.1.php @@ -7,10 +7,14 @@ if(!function_exists('mysql_connect')) { exit(1); } -// we don't check our AlternC session -if(!chdir("/var/alternc/bureau")) - exit(1); -require("/var/alternc/bureau/class/config_nochk.php"); +// If we upgrade directly to 3.1 the panel directory change +$panel=''; +if(chdir("/usr/share/alternc/panel")) $panel='/usr/share/alternc/panel'; +elseif (chdir("/var/alternc/bureau")) $panel='/var/alternc/bureau'; + +if (empty($panel)) { echo "Problem to load panel library"; exit(1); } + +require("$panel/class/config_nochk.php"); // we go super-admin $admin->enabled=1; @@ -33,4 +37,4 @@ foreach($domains as $v) { $dom->unlock(); -?> \ No newline at end of file +?> diff --git a/install/upgrades/3.0.0~3.php b/install/upgrades/3.0.0~3.php index 22858ea3..709d9782 100644 --- a/install/upgrades/3.0.0~3.php +++ b/install/upgrades/3.0.0~3.php @@ -8,11 +8,14 @@ if(!function_exists('mysql_connect')) { exit(1); } +// If we upgrade directly to 3.1 the panel directory change +$panel=''; +if(chdir("/usr/share/alternc/panel")) $panel='/usr/share/alternc/panel'; +elseif (chdir("/var/alternc/bureau")) $panel='/var/alternc/bureau'; -// we don't check our AlternC session -if(!chdir("/var/alternc/bureau")) -exit(1); -require("/var/alternc/bureau/class/config_nochk.php"); +if (empty($panel)) { echo "Problem to load panel library"; exit(1); } + +require("$panel/class/config_nochk.php"); $db2=new DB_System(); // we go super-admin diff --git a/install/upgrades/3.0.1.php b/install/upgrades/3.0.1.php index 120f555a..a9658f52 100644 --- a/install/upgrades/3.0.1.php +++ b/install/upgrades/3.0.1.php @@ -7,10 +7,14 @@ if(!function_exists('mysql_connect')) { exit(1); } -// we don't check our AlternC session -if(!chdir("/usr/share/alternc/panel")) -exit(1); -require("/usr/share/alternc/panel/class/config_nochk.php"); +// If we upgrade directly to 3.1 the panel directory change +$panel=''; +if(chdir("/usr/share/alternc/panel")) $panel='/usr/share/alternc/panel'; +elseif (chdir("/var/alternc/bureau")) $panel='/var/alternc/bureau'; + +if (empty($panel)) { echo "Problem to load panel library"; exit(1); } + +require("$panel/class/config_nochk.php"); $db2=new DB_System(); // we go super-admin