From 32346783a2b803c2adb5c92762d99633b9c962d4 Mon Sep 17 00:00:00 2001 From: Steven Mondji-Lerider Date: Fri, 1 Feb 2013 15:40:13 +0000 Subject: [PATCH] Should fix #1439. needs testing --- bureau/class/m_mysql.php | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/bureau/class/m_mysql.php b/bureau/class/m_mysql.php index 73585159..31d85362 100644 --- a/bureau/class/m_mysql.php +++ b/bureau/class/m_mysql.php @@ -90,7 +90,7 @@ class DB_users extends DB_Sql { // c'est pas étanche : $db se retrouve avec Database de $sql->dbu . Danger, faut comprendre pourquoi // Si on veux que ca marche, il faut Database=alternc. //$this->Database = "mysql"; - $this->Database = "alternc"; + $this->Database = "mysql_schema"; #if dbus is on a different host the alternc database will not be there and trying to use it might cause an error $this->HumanHostname = $human_hostname; } @@ -474,8 +474,7 @@ class m_mysql { * @return boolean TRUE if the database has been restored, or FALSE if an error occurred */ function restore($file,$stdout,$id) { - // TODO don't work with the separated sql serveur for dbusers - global $err,$bro,$mem,$L_MYSQL_HOST; + global $err,$bro,$mem,$L_MYSQL_HOST,$db; if (empty($file)) { $err->raise("mysql",_("No file specified")); return false; @@ -493,11 +492,11 @@ class m_mysql { } if (substr($fi,-3)==".gz") { - $exe="/bin/gzip -d -c <".escapeshellarg($fi)." | /usr/bin/mysql -h".escapeshellarg($L_MYSQL_HOST)." -u".escapeshellarg($r["login"])." -p".escapeshellarg($r["pass"])." ".escapeshellarg($r["db"]); + $exe="/bin/gzip -d -c <".escapeshellarg($fi)." | /usr/bin/mysql -h".escapeshellarg($this->dbus->Host)." -u".escapeshellarg($r["login"])." -p".escapeshellarg($r["pass"])." ".escapeshellarg($r["db"]); } elseif (substr($fi,-4)==".bz2") { - $exe="/usr/bin/bunzip2 -d -c <".escapeshellarg($fi)." | /usr/bin/mysql -h".escapeshellarg($L_MYSQL_HOST)." -u".escapeshellarg($r["login"])." -p".escapeshellarg($r["pass"])." ".escapeshellarg($r["db"]); + $exe="/usr/bin/bunzip2 -d -c <".escapeshellarg($fi)." | /usr/bin/mysql -h".escapeshellarg($this->dbus->Host)." -u".escapeshellarg($r["login"])." -p".escapeshellarg($r["pass"])." ".escapeshellarg($r["db"]); } else { - $exe="/usr/bin/mysql -h".escapeshellarg($L_MYSQL_HOST)." -u".escapeshellarg($r["login"])." -p".escapeshellarg($r["pass"])." ".escapeshellarg($r["db"])." <".escapeshellarg($fi); + $exe="/usr/bin/mysql -h".escapeshellarg($this->dbus->Host)." -u".escapeshellarg($r["login"])." -p".escapeshellarg($r["pass"])." ".escapeshellarg($r["db"])." <".escapeshellarg($fi); } $exe .= " 2>&1";