} else { echo 'Domain doesn\'t have any network devices'; } if ($dom['state'] == 1) { echo "<h3>Screenshot</h3><img src=\"?action=get-screenshot&uuid={$_GET['uuid']}&width=640\">"; } } else { echo "Hypervisor URI: <i>{$uri}</i>, hostname: <i>{$hn}</i><br />\n\t\t\t Statistics: {$tmp['total']} domains, {$tmp['active']} active, {$tmp['inactive']} inactive<br /><br />"; $ret = false; if ($action) { $domName = $lv->domain_get_name_by_uuid($_GET['uuid']); if ($action == 'domain-start') { $ret = $lv->domain_start($domName) ? "Domain has been started successfully" : 'Error while starting domain: ' . $lv->get_last_error(); } else { if ($action == 'domain-stop') { $ret = $lv->domain_shutdown($domName) ? "Domain has been stopped successfully" : 'Error while stopping domain: ' . $lv->get_last_error(); } else { if ($action == 'domain-destroy') { $ret = $lv->domain_destroy($domName) ? "Domain has been destroyed successfully" : 'Error while destroying domain: ' . $lv->get_last_error(); } else { if ($action == 'domain-get-xml' || $action == 'domain-edit') { $inactive = !$lv->domain_is_running($domName) ? true : false; $xml = $lv->domain_get_xml($domName, $inactive); if ($action == 'domain-edit') { if (@$_POST['xmldesc']) { $ret = $lv->domain_change_xml($domName, $_POST['xmldesc']) ? "Domain definition has been changed" : 'Error changing domain definition: ' . $lv->get_last_error(); } else { $ret = 'Editing domain XML description: <br /><br /><form method="POST"><table><tr><td>Domain XML description: </td>' . '<td><textarea name="xmldesc" rows="25" cols="90%">' . $xml . '</textarea></td></tr><tr align="center"><td colspan="2">' . '<input type="submit" value=" Edit domain XML description "></tr></form>'; } } else { $ret = "Domain XML for domain <i>{$domName}</i>:<br /><br />" . htmlentities($xml);