Beispiel #1
0
    } else {
        if (($ref = xenapi_vm_by_name($session, $vmname)) === false) {
            return;
        }
    }
    if (!xvp_db_user_may_perform($vm, null, "reset")) {
        return;
    }
    if (xenapi_vm_hard_reboot($session, $ref)) {
        $reset = "true";
    }
}
$poolname = stripslashes($_POST['poolname']);
$jsvmname = $_POST['vmname'];
$vmname = stripslashes($jsvmname);
$fullname = xvp_make_fullname($poolname, $vmname);
$reset = "false";
main();
echo <<<EOF
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>xvp VM Force Reboot</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta http-equiv="Imagetoolbar" content="no" />
<meta http-equiv="pragma" content="no-cache" />
<meta http-equiv="Cache-Control" content="no-cache" />
<meta name="description" content="xvp VM Force Reboot" />
<meta name="copyright" content="(C) Colin Dean" />
<meta name="author" content="Colin Dean" />
<meta name="robots" content="noindex,nofollow,noarchive" />
<link rel="stylesheet" type="text/css" href="css/styles.css" />
Beispiel #2
0
function vm_display($vm, &$groupname)
{
    if (xvp_db_user_rights($vm, null) == "none") {
        return;
    }
    $poolname = $vm->pool->poolname;
    $vmname = $vm->vmname;
    $label = xvp_is_uuid($vmname) ? "&nbsp;" : $vmname;
    $form = "form-" . $vm->fullname;
    $busy = "busy-" . $vm->fullname;
    $button = "button-" . $vm->fullname;
    $osicon = "osicon-" . $vm->fullname;
    $jsfullname = addslashes($vm->fullname);
    $groupclass = xvp_make_fullname($poolname, $groupname);
    if ($vm->groupname != $groupname) {
        $groupname = $vm->groupname;
        $displayname = htmlspecialchars($groupname, ENT_QUOTES);
        $groupclass = xvp_make_fullname($poolname, $groupname);
        $jsgroupclass = addslashes($groupclass);
        echo <<<EOF
  <tr>
    <td class="group">
      <img class="toggle" id="toggle-{$groupclass}" alt="" title="" src="images/minus.png" onclick="groupToggle('{$jsgroupclass}');" />{$displayname}&nbsp;
    </td>
  </tr>

EOF;
    }
    // Note target below is not used - overriden from click.js on click,
    // as is setting for action
    echo <<<EOF
  <tr class="group-{$groupclass}">
    <td class="vm">
      <form class="vm" id="{$form}" method="post" action="blank.html" target="_blank">
        <input type="hidden" name="poolname" value="{$poolname}" />
        <input type="hidden" name="vmname" value="{$vmname}" />
        <input type="hidden" name="action" class="action" value="" />
        <input type="hidden" name="busy" id="{$busy}" class="busy" value="false" />
        <table>
          <tr class="vm">
            <td class="oslogo"><img class="oslogo" id="{$osicon}" alt="" title="" src="images/blank.png" /></td>
            <th class="vm" id="label-{$vm->fullname}">{$label}</th>
\t    <td class="button"><img class="button" id="{$button}" alt="" title="" src="images/blank.png" onclick="vmClick('left', '{$jsfullname}');" /></td>
\t    <td class="unknown" id="state-{$vm->fullname}">&nbsp;</td>
\t    <td class="memtotal" id="memtotal-{$vm->fullname}">&nbsp;</td>
          </tr>
        </table>
      </form>
    </td>
  </tr>

EOF;
}