From 3351fc493b9393534795f836c0a14b262946a36b Mon Sep 17 00:00:00 2001 From: Alan Garcia Date: Fri, 19 Apr 2013 07:16:31 +0000 Subject: [PATCH] Menu pour les vm (a toi fser ;) ) --- .gitattributes | 1 + bureau/admin/images/ssh.png | Bin 0 -> 397 bytes bureau/class/m_lxc.php | 30 +++++++++++++++++++++++++----- 3 files changed, 26 insertions(+), 5 deletions(-) create mode 100644 bureau/admin/images/ssh.png 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 0000000000000000000000000000000000000000..d35b274682d64cece47e1dfd96584fe2b52bf32f GIT binary patch literal 397 zcmV;80doF{P)jXSC?fG-Frd+BM9bxpf*_#7;Xu7!FOpe6 zP1AzOWa8(i)2V70#`}K1f8K01Sg+S$2s}$L3WWj~POPdbT-Sx7D5%%#AB{%iHSaji zgK3(NoQ^OI!9keM=kR@BLgahl*=&Y5j!~=CbO2Ae)9I9el}ZKWav7Fof!DlhX+Kv^ z-pc{h@AqNbHrnlW0`N_~4dDMT19rO|c#E{*M_BIgRk>EH6?vW)-h!owh_V3;V>ldA zr_;fBJjQCZI^RSNDRT;Eluw7nVv(4Y9x4M}3&>pdHkjQYu2!qRhNQ4mDoG1TK-6qD r--^ZJ%RSA^xBxumJQ(+h*nih2sS`9~NY&Mz00000NkvXXu0mjf2~fEs literal 0 HcmV?d00001 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) {