示例#1
0
 public function listDom0Index($idGroup)
 {
     $bd = new db();
     $bd->connect();
     $domU = new domUManager();
     $this->query = mysql_query("SELECT * FROM dom0_hosts ORDER by name ASC");
     $this->total = mysql_num_rows($this->query);
     if ($this->total == "") {
         echo "Doen't exist dom0!";
     } else {
         while ($this->data = mysql_fetch_array($this->query)) {
             if ($idGroup == 1) {
                 // Admin Group
                 if ($this->data['state'] == "up") {
                     echo '<div class="right_dm0">
                             &nbsp;<img src="img/up.png" /> ' . $this->data['name'] . ' <a href="removeDom0.php?id=' . $this->data['id'] . '"><img src="img/remove.png" alt="Remove dom0" border="0" /></a><br>
                             &nbsp;' . $this->data['ip'] . '<br>';
                     $domU->listDomUIndex($this->data['ip'], $idGroup);
                 } else {
                     echo '<div class="right_dm0">
                              &nbsp;<img src="img/down.png" /> ' . $this->data['name'] . ' <a href="removeDom0.php?id=' . $this->data['id'] . '"><img src="img/remove.png" alt="Remove dom0" border="0" /></a><br>
                             &nbsp;' . $this->data['ip'] . '<br>';
                 }
                 echo '</div>';
             } else {
                 // Monitor Group
                 if ($this->data['state'] == "up") {
                     echo '<div class="right_dm0">
                             &nbsp;<img src="img/up.png" /> ' . $this->data['name'] . ' </a><br>
                             &nbsp;' . $this->data['ip'] . '<br>';
                     $domU->listDomUIndex($this->data['ip'], $idGroup);
                 } else {
                     echo '<div class="right_dm0">
                             &nbsp;<img src="img/down.png" /> ' . $this->data['name'] . ' </a><br>
                             &nbsp;' . $this->data['ip'] . '<br>';
                 }
                 echo '</div>';
             }
         }
     }
 }
示例#2
0
<?php

session_start();
if (isset($_SESSION['xo']) and $_SESSION['xo_idGroup'] == 1) {
    // Admin Group
    include 'class/db.php';
    include 'class/domUManager.php';
    include 'class/xenapi.php';
    $domUManager = new domUManager();
    $domUManager->unpauseDomU($_GET['id']);
} else {
    echo "Restricted area.";
}
示例#3
0
<?php

session_start();
if (isset($_SESSION['xo']) and $_SESSION['xo_idGroup'] == 1) {
    // Admin Group
    include 'class/db.php';
    include 'class/domUManager.php';
    include 'class/xenapi.php';
    $domUManager = new domUManager();
    $domUManager->rebootDomU($_GET['id']);
} else {
    echo "Restricted area.";
}