2010-06-16 18:21:58 +00:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* Main xCAT page
|
|
|
|
*/
|
|
|
|
require_once "lib/functions.php";
|
|
|
|
require_once "lib/ui.php";
|
|
|
|
require_once "lib/jsonwrapper.php";
|
|
|
|
|
|
|
|
/* Load page */
|
|
|
|
loadPage();
|
|
|
|
|
|
|
|
/* Login user */
|
|
|
|
if (!isAuthenticated()) {
|
|
|
|
login();
|
|
|
|
} else {
|
|
|
|
loadContent();
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Test lib/cmd.php
|
|
|
|
*/
|
|
|
|
function testCmdPhp() {
|
2010-07-22 19:56:09 +00:00
|
|
|
$xml = docmd('rinv', 'ca4dsls08', array('all'));
|
2010-06-16 18:21:58 +00:00
|
|
|
$rsp = array();
|
|
|
|
|
|
|
|
foreach ($xml->children() as $child) {
|
2010-07-22 19:56:09 +00:00
|
|
|
// Get the 1st level child
|
|
|
|
foreach ($child->children() as $level_one) {
|
|
|
|
if ($level_one->children()) {
|
|
|
|
// Get the 2nd level child
|
|
|
|
foreach ($level_one->children() as $level_two) {
|
|
|
|
if ($level_two->children()) {
|
|
|
|
// Get the 3rd level child
|
|
|
|
foreach ($level_two->children() as $level_three) {
|
|
|
|
array_push($rsp, "$level_three");
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
array_push($rsp, "$level_two");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
array_push($rsp, "$level_one");
|
|
|
|
}
|
2010-06-16 18:21:58 +00:00
|
|
|
}
|
|
|
|
}
|
2010-07-22 19:56:09 +00:00
|
|
|
|
2010-06-16 18:21:58 +00:00
|
|
|
$rtn = array("rsp" => $rsp, "msg" => '');
|
|
|
|
echo json_encode($rtn);
|
|
|
|
}
|
|
|
|
?>
|