[fix] m_lxc didn't work on new instead of ...

This commit is contained in:
Benjamin Sonntag 2018-10-16 23:04:46 +02:00
parent e118f31397
commit 13564a9d73
1 changed files with 9 additions and 9 deletions

View File

@ -99,8 +99,8 @@ class m_lxc implements vm {
} }
} }
$msg = serialize($params); $message = serialize($params);
if (fwrite($fp, $msg . "\n") < 0) { if (fwrite($fp, $message . "\n") < 0) {
$this->error[] = 'Unable to send data'; $this->error[] = 'Unable to send data';
return FALSE; return FALSE;
} }
@ -135,22 +135,22 @@ class m_lxc implements vm {
$pass = $pass ? $pass : $mem->user['pass']; $pass = $pass ? $pass : $mem->user['pass'];
$uid = $uid ? $uid : $mem->user['uid']; $uid = $uid ? $uid : $mem->user['uid'];
$msgg = array('action' => 'start', 'login' => $login, 'pass' => $pass, 'uid' => $uid); $message = array('action' => 'start', 'login' => $login, 'pass' => $pass, 'uid' => $uid);
$msgg['mysql_host'] = $mysql->dbus->Host; $message['mysql_host'] = $mysql->dbus->Host;
$res = $this->sendMessage($msgg); $res = $this->sendMessage($message);
if ($res === FALSE) { if ($res === FALSE) {
return $this->error; return $this->error;
} else { } else {
$data = unserialize($res); $data = unserialize($res);
$error = (int) $data['error']; $error = (int) $data['error'];
$hostname = $data['hostname']; $hostname = $data['hostname'];
$msg = $data['msg']; $message = $data['msg'];
$date_start = 'NOW()'; $date_start = 'NOW()';
$uid = $mem->user['uid']; $uid = $mem->user['uid'];
if ($error != 0) { if ($error != 0) {
$msg->raise("ERROR", 'lxc', _($msg)); $msg->raise("ERROR", 'lxc', _($message));
return FALSE; return FALSE;
} }
$db->query("INSERT INTO vm_history (ip,date_start,uid,serialized_object) VALUES (?, ?, ?, ?);", array($hostname, $date_start, $uid, $res)); $db->query("INSERT INTO vm_history (ip,date_start,uid,serialized_object) VALUES (?, ?, ?, ?);", array($hostname, $date_start, $uid, $res));
@ -166,8 +166,8 @@ class m_lxc implements vm {
global $mem; global $mem;
$login = $login ? $login : $mem->user['login']; $login = $login ? $login : $mem->user['login'];
$msgg = array('action' => 'get', 'login' => $login); $message = array('action' => 'get', 'login' => $login);
$res = $this->sendMessage($msgg); $res = $this->sendMessage($message);
if (!$res) { if (!$res) {
return FALSE; return FALSE;
} }