Ajoute l'aide pour quelqu'un qui veux scripter le démarrage ou l'arret d'une vm
This commit is contained in:
parent
a98688768a
commit
a24dab4a0b
|
@ -1,21 +1,35 @@
|
|||
<?php
|
||||
|
||||
require_once("../class/config.php");
|
||||
include_once("head.php");
|
||||
|
||||
$fields = array (
|
||||
"action" => array ("get", "string", ''),
|
||||
"script" => array ("get", "boolean", 0),
|
||||
);
|
||||
getFields($fields);
|
||||
|
||||
if (in_array($action, array('start', 'stop', 'monit'))) {
|
||||
$res = $hooks->invoke($action, array(), 'lxc');
|
||||
printvar($res);
|
||||
}
|
||||
|
||||
$infos = $lxc->getvm();
|
||||
|
||||
if ($script) {
|
||||
// FIXME afficher les variables pertinentes de manière pertinente pour quelqu'un qui veux scripter :)
|
||||
print_r($infos);
|
||||
if (isset($res)) print_r($res);
|
||||
die();
|
||||
}
|
||||
|
||||
# Show the header after the "if script" ;)
|
||||
include_once("head.php");
|
||||
|
||||
# Debug
|
||||
echo "<fieldset><legend>debug</legend>res<br/>";
|
||||
if (isset($res)) { printvar($res); }
|
||||
echo "infos getvm";
|
||||
printvar($infos);
|
||||
echo "</fieldset>";
|
||||
?>
|
||||
|
||||
<h3><?php __('Console access'); ?></h3>
|
||||
|
@ -49,6 +63,24 @@ printvar($infos);
|
|||
} // empty infos ?>
|
||||
</div>
|
||||
|
||||
<br/>
|
||||
<br/>
|
||||
<hr/>
|
||||
<br/>
|
||||
<fieldset><legend><?php __("Tips");?></legend>
|
||||
<?php __("You can script the launch the console access in command line by using this url:"); ?>
|
||||
<pre>
|
||||
http://<?php echo $mem->user['login'].':ALTERNC_PASSWORD@'.$host.'/vm.php?http_auth=1&script=1&action=start' ?>
|
||||
</pre>
|
||||
<?php __("You can halt the vm by using:"); ?>
|
||||
<pre>
|
||||
http://<?php echo $mem->user['login'].':ALTERNC_PASSWORD@'.$host.'/vm.php?http_auth=1&script=1&action=stop' ?>
|
||||
</pre>
|
||||
<?php __("And you can see existing vm informations (if exist) by using:"); ?>
|
||||
<pre>
|
||||
http://<?php echo $mem->user['login'].':ALTERNC_PASSWORD@'.$host.'/vm.php?http_auth=1&script=1' ?>
|
||||
</pre>
|
||||
</fieldset>
|
||||
<?php
|
||||
include_once("foot.php");
|
||||
?>
|
||||
|
|
|
@ -90,7 +90,7 @@ class m_lxc implements vm
|
|||
|
||||
$res = $this->sendMessage('start', $user, $pass, $uid);
|
||||
if ($res === FALSE)
|
||||
return $this->error[0];
|
||||
return $this->error;
|
||||
else
|
||||
{
|
||||
$data = unserialize($res);
|
||||
|
|
|
@ -238,7 +238,7 @@ class m_mem {
|
|||
return false;
|
||||
}
|
||||
if ($_REQUEST["username"] && $_REQUEST["password"]) {
|
||||
return $this->login($_REQUEST["username"],$_REQUEST["password"],$_REQUEST["restrictip"]);
|
||||
return $this->login($_REQUEST["username"],$_REQUEST["password"], (isset($_REQUEST["restrictip"])?$_REQUEST["restrictip"]:0) );
|
||||
}
|
||||
} // end isset
|
||||
$_COOKIE["session"]=isset($_COOKIE["session"])?addslashes($_COOKIE["session"]):"";
|
||||
|
|
Loading…
Reference in New Issue