diff --git a/.gitattributes b/.gitattributes index a6605f39..956af643 100644 --- a/.gitattributes +++ b/.gitattributes @@ -256,6 +256,7 @@ bureau/admin/images/row-down.png -text bureau/admin/images/row-down.png2 -text bureau/admin/images/schedule.png -text bureau/admin/images/search.png -text +bureau/admin/images/ssh.png -text bureau/admin/images/stat.png -text bureau/admin/images/undelete.png -text bureau/admin/index.php -text diff --git a/bureau/admin/images/ssh.png b/bureau/admin/images/ssh.png new file mode 100644 index 00000000..d35b2746 Binary files /dev/null and b/bureau/admin/images/ssh.png differ diff --git a/bureau/class/m_lxc.php b/bureau/class/m_lxc.php index f32402f6..4e22efc5 100644 --- a/bureau/class/m_lxc.php +++ b/bureau/class/m_lxc.php @@ -5,11 +5,31 @@ include_once(dirname(__FILE__) . '/vm.php'); class m_lxc implements vm { - // TODO Paramétrer IP / Port - public $IP = '127.0.0.1'; - public $PORT = 6504; - public $TIMEOUT = 5; - public $error = array(); + // TODO Paramétrer IP / Port + public $IP; + public $PORT; + public $TIMEOUT = 5; + public $error = array(); + + function m_lxc() { + $this->IP = variable_get('lxc_ip', '', "IP address of the Alternc's LXC server. If empty, no LXC server."); + $this->PORT = variable_get('lxc_port', '6504', "Port of the Alternc's LXC server"); + } + + + function hook_menu() { + if ( empty($this->IP)) return ; # No menu if no server + + $obj = array( + 'title' => _("Virtual server"), + 'ico' => 'images/ssh.png', + 'link' => 'vm.php', + 'pos' => 95, + ) ; + + return $obj; + } + private function sendMessage($action, $user, $password, $uid) {