Login authentication for xCAT-web now works, using Jarrod's code

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@2383 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
bp-sawyers 2008-10-23 17:54:02 +00:00
parent ad0fdaa805
commit c734549c32
65 changed files with 1446 additions and 252 deletions

View File

@ -10,20 +10,20 @@
<UL>
<LI><A href="man1/xcat.1.html">xCAT 2 Man Pages</A>
<LI><A href="man5/xcatdb.5.html">xCAT 2 Database Table Descriptions</A>
<LI><A href="xCAT2.0.pdf">xCAT 2.0 Linux Cookbook</A> - getting started with <FONT size="+1">installing</FONT> and setting up xCAT on Linux
<LI><A href="xCAT2onAIX.pdf">xCAT 2.0 AIX Cookbook</A> - getting started with installing and setting up xCAT on AIX
<LI><A href="xCAT2.pdf">xCAT 2 Linux Cookbook</A> - getting started with installing and setting up xCAT on Linux
<LI><A href="xCAT2onAIX.pdf">xCAT 2 AIX Cookbook</A> - getting started with installing and setting up xCAT on AIX
</UL>
<H2>xCAT 2 on the Internet</H2>
<UL>
<LI><A href="http://xcat.sf.net/xCAT2-Install-Guide.pdf">Tutorial for installing xCAT and deploying a stateless node</A>
<LI><A href="http://xcat.sourceforge.net/yum/">Download xCAT 2.0</A>
<LI><A href="http://xcat.sourceforge.net/">xCAT 2 web site</A>
<LI><A href="http://xcat.sourceforge.net/yum/download.html">Download xCAT 2</A>
<LI><A href="https://sourceforge.net/projects/xcat/">The xCAT Project on SourceForge</A>
<LI><A href="http://xcat.svn.sourceforge.net/svnroot/xcat/xcat-core/trunk/">xCAT 2.0 Source in Subversion</A>
<LI><A href="http://xcat.wiki.sourceforge.net/">xCAT 2.0 Wiki</A>
<LI><A href="https://sourceforge.net/tracker/?group_id=208749&atid=1006945">xCAT 2.0 Bugs in Tracker</A>
<LI><A href="http://xcat.wiki.sourceforge.net/">xCAT 2 Wiki</A>
<LI><A href="http://xcat.svn.sourceforge.net/svnroot/xcat/xcat-core/trunk/">xCAT 2 Source in Subversion</A>
<LI><A href="https://sourceforge.net/tracker/?group_id=208749&atid=1006945">xCAT 2 Bugs in Tracker</A>
<LI><A href="http://xcat.org/mailman/listinfo/xcat-user">xCAT Mailing List</A>
<LI>xCAT 2.0 Open Source License: <A href="http://www.opensource.org/licenses/eclipse-1.0.php">Eclipse Public License</A>
<LI>xCAT 2 Open Source License: <A href="http://www.opensource.org/licenses/eclipse-1.0.php">Eclipse Public License</A>
<LI>xCAT 1.3 Links at <A href="http://xcat.org/">xcat.org</A>
</UL>
</BODY>

View File

@ -6,7 +6,7 @@ $TOPDIR = '..';
require_once "$TOPDIR/lib/functions.php";
insertHeader('xCAT Database', array('db.css'),
array('db.js',"$TOPDIR/jq/jquery.min.js","$TOPDIR/jq/jquery.jeditable.mini.js"),
array('db.js',"$TOPDIR/jq/jquery.jeditable.mini.js"),
array('config','db'));
echo "<div id=content align=center>\n";

View File

@ -8,7 +8,7 @@ require_once "$TOPDIR/lib/functions.php";
insertHeader('Preferences', NULL, NULL, array('config','prefs'));
echo "<FORM NAME=prefs onsubmit='return false'><TABLE class=inner_table cellspacing=0 cellpadding=5><TBODY>\n";
echo "<FORM NAME=prefs onsubmit='return false'><TABLE cellspacing=0 cellpadding=5><TBODY>\n";
//foreach ($_COOKIE as $key => $value) { echo "<p>$key: {$_COOKIE[$key]}</p>\n"; }

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 58 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 56 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 62 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 64 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 61 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 61 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 56 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 61 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 61 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 53 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 53 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 58 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 56 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 62 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 64 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 61 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 61 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 56 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 61 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 53 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 53 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 219 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 221 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 214 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 180 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 58 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 56 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 62 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 64 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 61 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 61 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 56 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 61 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 53 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 53 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 B

View File

@ -0,0 +1,832 @@
/*
* jQuery UI screen structure and presentation
* This CSS file was generated by ThemeRoller, a Filament Group Project for jQuery UI
* Author: Scott Jehl, scott@filamentgroup.com, http://www.filamentgroup.com
* Visit ThemeRoller.com
*/
/*
* Note: If your ThemeRoller settings have a font size set in ems, your components will scale according to their parent element's font size.
* As a rule of thumb, set your body's font size to 62.5% to make 1em = 10px.
* body {font-size: 62.5%;}
*/
/*UI accordion*/
.ui-accordion {
/*resets*/margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none;
font-family: Lucida Grande, Lucida Sans, Arial, sans-serif;
font-size: 1.2em;
border-bottom: 1px solid #cccccc;
}
.ui-accordion-group {
/*resets*/margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none;
border: 1px solid #cccccc;
border-bottom: none;
}
.ui-accordion-header {
/*resets*/margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none;
cursor: pointer;
background: #e0e0e0 url(images/e0e0e0_40x100_textures_02_glass_80.png) 0 50% repeat-x;
}
.ui-accordion-header a {
/*resets*/margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none;
display: block;
font-size: 1em;
font-weight: normal;
text-decoration: none;
padding: .5em .5em .5em 1.7em;
color: #444444;
background: url(images/888888_7x7_arrow_right.gif) .5em 50% no-repeat;
}
.ui-accordion-header a:hover {
background: url(images/222222_7x7_arrow_right.gif) .5em 50% no-repeat;
color: #111111;
}
.ui-accordion-header:hover {
background: #d8d8d8 url(images/d8d8d8_40x100_textures_02_glass_90.png) 0 50% repeat-x;
color: #111111;
}
.selected .ui-accordion-header, .selected .ui-accordion-header:hover {
background: #8ab9ff url(images/8ab9ff_40x100_textures_02_glass_50.png) 0 50% repeat-x;
}
.selected .ui-accordion-header a, .selected .ui-accordion-header a:hover {
color: #000000;
background: url(images/ffffff_7x7_arrow_down.gif) .5em 50% no-repeat;
}
.ui-accordion-content {
padding: 1.5em 1.7em;
background: #f3f3f3 url(images/f3f3f3_40x100_textures_01_flat_0.png) 0 0 repeat-x;
color: #362b36;
font-size: 1em;
}
/*UI tabs*/
.ui-tabs-nav {
/*resets*/margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none;
font-family: Lucida Grande, Lucida Sans, Arial, sans-serif;
font-size: 1.2em;
float: left;
position: relative;
z-index: 1;
border-right: 1px solid #cccccc;
bottom: -1px;
}
.ui-tabs-nav-item {
/*resets*/margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none;
float: left;
border: 1px solid #cccccc;
border-right: none;
}
.ui-tabs-nav-item a {
/*resets*/margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none;
float: left;
font-size: 1em;
font-weight: normal;
text-decoration: none;
padding: .5em 1.7em;
color: #444444;
background: #e0e0e0 url(images/e0e0e0_40x100_textures_02_glass_80.png) 0 50% repeat-x;
}
.ui-tabs-nav-item a:hover {
background: #d8d8d8 url(images/d8d8d8_40x100_textures_02_glass_90.png) 0 50% repeat-x;
color: #111111;
}
.ui-tabs-selected {
border-bottom-color: #8ab9ff;
}
.ui-tabs-selected a, .ui-tabs-selected a:hover {
background: #8ab9ff url(images/8ab9ff_40x100_textures_02_glass_50.png) 0 50% repeat-x;
color: #000000;
}
.ui-tabs-panel {
/*resets*/margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none;
font-family: Lucida Grande, Lucida Sans, Arial, sans-serif;
clear:left;
border: 1px solid #cccccc;
background: #f3f3f3 url(images/f3f3f3_40x100_textures_01_flat_0.png) 0 0 repeat-x;
color: #362b36;
padding: 1.5em 1.7em;
font-size: 1.2em;
}
.ui-tabs-hide {
display: none;/* for accessible hiding: position: absolute; left: -99999999px*/;
}
/*slider*/
.ui-slider {
/*resets*/margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none;
font-family: Lucida Grande, Lucida Sans, Arial, sans-serif;
font-size: 1.2em;
background: #f3f3f3 url(images/f3f3f3_40x100_textures_01_flat_0.png) 0 0 repeat-x;
border: 1px solid #dddddd;
height: .8em;
position: relative;
}
.ui-slider-handle {
/*resets*/margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none;
position: absolute;
z-index: 2;
top: -3px;
width: 1.2em;
height: 1.2em;
background: #e0e0e0 url(images/e0e0e0_40x100_textures_02_glass_80.png) 0 50% repeat-x;
border: 1px solid #cccccc;
}
.ui-slider-handle:hover {
background: #d8d8d8 url(images/d8d8d8_40x100_textures_02_glass_90.png) 0 50% repeat-x;
border: 1px solid #888888;
}
.ui-slider-handle-active, .ui-slider-handle-active:hover {
background: #8ab9ff url(images/8ab9ff_40x100_textures_02_glass_50.png) 0 50% repeat-x;
border: 1px solid #2694e8;
}
.ui-slider-range {
/*resets*/margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none;
height: .8em;
background: #d8d8d8 url(images/d8d8d8_40x100_textures_02_glass_90.png) 0 50% repeat-x;
position: absolute;
border: 1px solid #cccccc;
border-left: 0;
border-right: 0;
top: -1px;
z-index: 1;
opacity:.7;
filter:Alpha(Opacity=70);
}
/*dialog*/
.ui-dialog {
/*resets*/margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none;
font-family: Lucida Grande, Lucida Sans, Arial, sans-serif;
font-size: 1.2em;
background: #f3f3f3 url(images/f3f3f3_40x100_textures_01_flat_0.png) 0 0 repeat-x;
color: #362b36;
border: 4px solid #dddddd;
position: relative;
}
.ui-resizable-handle {
position: absolute;
font-size: 0.1px;
z-index: 99999;
}
.ui-resizable .ui-resizable-handle {
display: block;
}
body .ui-resizable-disabled .ui-resizable-handle { display: none; } /* use 'body' to make it more specific (css order) */
body .ui-resizable-autohide .ui-resizable-handle { display: none; } /* use 'body' to make it more specific (css order) */
.ui-resizable-n {
cursor: n-resize;
height: 7px;
width: 100%;
top: -5px;
left: 0px;
}
.ui-resizable-s {
cursor: s-resize;
height: 7px;
width: 100%;
bottom: -5px;
left: 0px;
}
.ui-resizable-e {
cursor: e-resize;
width: 7px;
right: -5px;
top: 0px;
height: 100%;
}
.ui-resizable-w {
cursor: w-resize;
width: 7px;
left: -5px;
top: 0px;
height: 100%;
}
.ui-resizable-se {
cursor: se-resize;
width: 13px;
height: 13px;
right: 0px;
bottom: 0px;
background: url(images/222222_11x11_icon_resize_se.gif) no-repeat 0 0;
}
.ui-resizable-sw {
cursor: sw-resize;
width: 9px;
height: 9px;
left: 0px;
bottom: 0px;
}
.ui-resizable-nw {
cursor: nw-resize;
width: 9px;
height: 9px;
left: 0px;
top: 0px;
}
.ui-resizable-ne {
cursor: ne-resize;
width: 9px;
height: 9px;
right: 0px;
top: 0px;
}
.ui-dialog-titlebar {
/*resets*/margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none;
padding: .5em 1.5em .5em 1em;
color: #444444;
background: #e0e0e0 url(images/e0e0e0_40x100_textures_02_glass_80.png) 0 50% repeat-x;
border-bottom: 1px solid #cccccc;
font-size: 1em;
font-weight: normal;
position: relative;
}
.ui-dialog-title {}
.ui-dialog-titlebar-close {
/*resets*/margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none;
background: url(images/888888_11x11_icon_close.gif) 0 0 no-repeat;
position: absolute;
right: 8px;
top: .7em;
width: 11px;
height: 11px;
z-index: 100;
}
.ui-dialog-titlebar-close-hover, .ui-dialog-titlebar-close:hover {
background: url(images/222222_11x11_icon_close.gif) 0 0 no-repeat;
}
.ui-dialog-titlebar-close:active {
background: url(images/ffffff_11x11_icon_close.gif) 0 0 no-repeat;
}
.ui-dialog-titlebar-close span {
display: none;
}
.ui-dialog-content {
/*resets*/margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none;
color: #362b36;
padding: 1.5em 1.7em;
}
.ui-dialog-buttonpane {
position: absolute;
bottom: 0;
width: 100%;
text-align: left;
border-top: 1px solid #dddddd;
background: #f3f3f3;
}
.ui-dialog-buttonpane button {
margin: .5em 0 .5em 8px;
color: #444444;
background: #e0e0e0 url(images/e0e0e0_40x100_textures_02_glass_80.png) 0 50% repeat-x;
font-size: 1em;
border: 1px solid #cccccc;
cursor: pointer;
padding: .2em .6em .3em .6em;
line-height: 1.4em;
}
.ui-dialog-buttonpane button:hover {
color: #111111;
background: #d8d8d8 url(images/d8d8d8_40x100_textures_02_glass_90.png) 0 50% repeat-x;
border: 1px solid #888888;
}
.ui-dialog-buttonpane button:active {
color: #000000;
background: #8ab9ff url(images/8ab9ff_40x100_textures_02_glass_50.png) 0 50% repeat-x;
border: 1px solid #2694e8;
}
/* This file skins dialog */
.ui-dialog.ui-draggable .ui-dialog-titlebar,
.ui-dialog.ui-draggable .ui-dialog-titlebar {
cursor: move;
}
/*datepicker*/
/* Main Style Sheet for jQuery UI date picker */
.ui-datepicker-div, .ui-datepicker-inline, #ui-datepicker-div {
/*resets*/margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none;
font-family: Lucida Grande, Lucida Sans, Arial, sans-serif;
background: #f3f3f3 url(images/f3f3f3_40x100_textures_01_flat_0.png) 0 0 repeat-x;
font-size: 1.2em;
border: 4px solid #dddddd;
width: 15.5em;
padding: 2.5em .5em .5em .5em;
position: relative;
}
.ui-datepicker-div, #ui-datepicker-div {
z-index: 9999; /*must have*/
display: none;
}
.ui-datepicker-inline {
float: left;
display: block;
}
.ui-datepicker-control {
display: none;
}
.ui-datepicker-current {
display: none;
}
.ui-datepicker-next, .ui-datepicker-prev {
position: absolute;
left: .5em;
top: .5em;
background: #e0e0e0 url(images/e0e0e0_40x100_textures_02_glass_80.png) 0 50% repeat-x;
}
.ui-datepicker-next {
left: 14.6em;
}
.ui-datepicker-next:hover, .ui-datepicker-prev:hover {
background: #d8d8d8 url(images/d8d8d8_40x100_textures_02_glass_90.png) 0 50% repeat-x;
}
.ui-datepicker-next a, .ui-datepicker-prev a {
text-indent: -999999px;
width: 1.3em;
height: 1.4em;
display: block;
font-size: 1em;
background: url(images/888888_7x7_arrow_left.gif) 50% 50% no-repeat;
border: 1px solid #cccccc;
cursor: pointer;
}
.ui-datepicker-next a {
background: url(images/888888_7x7_arrow_right.gif) 50% 50% no-repeat;
}
.ui-datepicker-prev a:hover {
background: url(images/222222_7x7_arrow_left.gif) 50% 50% no-repeat;
}
.ui-datepicker-next a:hover {
background: url(images/222222_7x7_arrow_right.gif) 50% 50% no-repeat;
}
.ui-datepicker-prev a:active {
background: url(images/ffffff_7x7_arrow_left.gif) 50% 50% no-repeat;
}
.ui-datepicker-next a:active {
background: url(images/ffffff_7x7_arrow_right.gif) 50% 50% no-repeat;
}
.ui-datepicker-header select {
border: 1px solid #cccccc;
color: #444444;
background: #e0e0e0;
font-size: 1em;
line-height: 1.4em;
position: absolute;
top: .5em;
margin: 0 !important;
}
.ui-datepicker-header option:focus, .ui-datepicker-header option:hover {
background: #d8d8d8;
}
.ui-datepicker-header select.ui-datepicker-new-month {
width: 7em;
left: 2.2em;
}
.ui-datepicker-header select.ui-datepicker-new-year {
width: 5em;
left: 9.4em;
}
table.ui-datepicker {
width: 15.5em;
text-align: right;
}
table.ui-datepicker td a {
padding: .1em .3em .1em 0;
display: block;
color: #444444;
background: #e0e0e0 url(images/e0e0e0_40x100_textures_02_glass_80.png) 0 50% repeat-x;
cursor: pointer;
border: 1px solid #f3f3f3;
}
table.ui-datepicker td a:hover {
border: 1px solid #888888;
color: #111111;
background: #d8d8d8 url(images/d8d8d8_40x100_textures_02_glass_90.png) 0 50% repeat-x;
}
table.ui-datepicker td a:active {
border: 1px solid #2694e8;
color: #000000;
background: #8ab9ff url(images/8ab9ff_40x100_textures_02_glass_50.png) 0 50% repeat-x;
}
table.ui-datepicker .ui-datepicker-title-row td {
padding: .3em 0;
text-align: center;
font-size: .9em;
color: #362b36;
text-transform: uppercase;
}
table.ui-datepicker .ui-datepicker-title-row td a {
color: #362b36;
}
.ui-datepicker-cover {
display: none;
display/**/: block;
position: absolute;
z-index: -1;
filter: mask();
top: -4px;
left: -4px;
width: 193px;
height: 200px;
}
/* ui-autocomplete */
.ui-autocomplete-results {
/*resets*/margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none;
font-family: Lucida Grande, Lucida Sans, Arial, sans-serif;
font-size: 1.2em;
z-index: 9999;
}
.ui-autocomplete-results ul, .ui-autocomplete-results li {
margin: 0;
padding: 0;
list-style: none;
}
.ui-autocomplete-results ul {
border: 1px solid #cccccc;
background: #f3f3f3 url(images/f3f3f3_40x100_textures_01_flat_0.png) 0 0 repeat-x;
color: #362b36;
margin-bottom: -1px;
}
.ui-autocomplete-results li {
padding: .4em .5em;
color: #444444;
font-size: 1em;
font-weight: normal;
position: relative;
border-left: 0;
border-right: 0;
margin: 1px 0;
}
.ui-autocomplete-results li.ui-hover-state, .ui-autocomplete-results li.ui-active-state {
margin: 0;
}
/*Paul - you could add classes for these first last states instead for ie6... */
.ui-autocomplete-results li:first-child {
border-top: 0;
}
.ui-autocomplete-results li:last-child {
border-bottom: 0;
}
.ui-autocomplete-results li.ui-autocomplete-over {
border: 1px solid #888888;
background: #d8d8d8 url(images/d8d8d8_40x100_textures_02_glass_90.png) 0 50% repeat-x;
color: #111111 !important;
}
.ui-autocomplete-results li.ui-autocomplete-active {
border: 1px solid #2694e8;
background: #8ab9ff url(images/8ab9ff_40x100_textures_02_glass_50.png) 0 50% repeat-x;
color: #000000 !important;
outline: none;
}
/*UI ProgressBar */
.ui-progressbar {
/*resets*/margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none;
font-family: Lucida Grande, Lucida Sans, Arial, sans-serif;
font-size: 1.2em;
background: #f3f3f3 url(images/f3f3f3_40x100_textures_01_flat_0.png) 0 0 repeat-x;
border: 1px solid #dddddd;
position: relative;
}
.ui-progressbar-bar {
background: #e0e0e0 url(images/e0e0e0_40x100_textures_02_glass_80.png) 0 50% repeat-x;
overflow: visible;
position: relative;
border: 1px solid #cccccc;
margin-top: -1px;
margin-left: -1px;
margin-bottom: -1px;
}
.ui-progressbar-text {
color: #444444;
padding: .2em .5em;
font-weight: normal;
}
.ui-progressbar-text-back {
display: none;
/* position: absolute;
top: 1px;
left: 0px;
font-weight: normal;
color:#000;
padding-top: 1px;
padding-bottom: 1px;
padding-right: 1px;
*/
}
.ui-progressbar-disabled {
opacity:.5;
filter:Alpha(Opacity=50);
}
/*UI Colorpicker */
.ui-colorpicker {
/*resets*/margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none;
font-family: Lucida Grande, Lucida Sans, Arial, sans-serif;
font-size: 1.2em;
background: #f3f3f3 url(images/f3f3f3_40x100_textures_01_flat_0.png) 0 0 repeat-x;
border: 4px solid #dddddd;
padding: 5px;
width: 360px;
position: relative;
}
.ui-colorpicker-color {
float: left;
width: 150px;
height: 150px;
margin-right: 15px;
}
.ui-colorpicker-color div { /* is this extra div needed? why not just .ui-colorpicker-color ? */
border: 1px solid #cccccc;
height: 150px;
background: url(images/_x_.);
position: relative;
}
.ui-colorpicker-color div div {/* shouldn't this have a class like ui-colorpicker-selector ? */
width: 11px;
height: 11px;
background: url(images/_x_.);
position: absolute;
border: 0;
margin: -5px 0 0 -5px;
float: none;
}
.ui-colorpicker-hue {
border: 1px solid #cccccc;
float: left;
width: 17px;
height: 150px;
background: url(images/_x_.);
position: relative;
margin-right: 15px;
}
.ui-colorpicker-hue div {
background:transparent url(images/_x_.); /*this image should be themerollable*/
height:9px;
left:-9px;
margin:-4px 0 0;
position:absolute;
width:35px;
cursor: ns-resize;
}
.ui-colorpicker-new-color, .ui-colorpicker-current-color {
float: left;
width: 6.5em;
height: 30px;
border: 1px solid #cccccc;
margin-right: 5px;
}
.ui-colorpicker-current-color {
margin-right: 0;
}
.ui-colorpicker-field, .ui-colorpicker-hex {
position: absolute;
width: 6em;
}
.ui-colorpicker-field label, .ui-colorpicker-field input,
.ui-colorpicker-hex label, .ui-colorpicker-hex input {
font-size: 1em;
color: #ffffff;
}
.ui-colorpicker-field label, .ui-colorpicker-hex label {
width: 1em;
margin-right: .3em;
}
.ui-colorpicker-field input, .ui-colorpicker-hex input {
border: 1px solid #cccccc;
width: 4.6em;
}
.ui-colorpicker-hex {
left: 205px;
top: 134px;
}
.ui-colorpicker-rgb-r {
top: 52px;
left: 205px;
}
.ui-colorpicker-rgb-g {
top: 78px;
left: 205px;
}
.ui-colorpicker-rgb-b {
top: 105px;
left: 205px;
}
.ui-colorpicker-hsb-h {
top: 52px;
left: 290px;
}
.ui-colorpicker-hsb-s {
top: 78px;
left: 290px;
}
.ui-colorpicker-hsb-b {
top: 105px;
left: 290px;
}
.ui-colorpicker-field label {
font-weight: normal;
}
.ui-colorpicker-field span {
width: 7px;
background: url(images/888888_11x11_icon_arrows_updown.gif) 50% 50% no-repeat;
right: 5px;
top: 0;
height: 20px;
position: absolute;
}
.ui-colorpicker-field span:hover {
background: url(images/222222_11x11_icon_arrows_updown.gif) 50% 50% no-repeat;
}
.ui-colorpicker-submit {
right: 14px;
top: 134px;
position: absolute;
}
/*
Generic ThemeRoller Classes
>> Make your jQuery Components ThemeRoller-Compatible!
*/
/*component global class*/
.ui-component {
/*resets*/margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none;
font-family: Lucida Grande, Lucida Sans, Arial, sans-serif;
font-size: 1.2em;
}
/*component content styles*/
.ui-component-content {
border: 1px solid #dddddd;
background: #f3f3f3 url(images/f3f3f3_40x100_textures_01_flat_0.png) 0 0 repeat-x;
color: #362b36;
}
.ui-component-content a {
color: #362b36;
text-decoration: underline;
}
/*component states*/
.ui-default-state {
border: 1px solid #cccccc;
background: #e0e0e0 url(images/e0e0e0_40x100_textures_02_glass_80.png) 0 50% repeat-x;
font-weight: normal;
color: #444444 !important;
}
.ui-default-state a {
color: #444444;
}
.ui-default-state:hover, .ui-hover-state {
border: 1px solid #888888;
background: #d8d8d8 url(images/d8d8d8_40x100_textures_02_glass_90.png) 0 50% repeat-x;
font-weight: normal;
color: #111111 !important;
}
.ui-hover-state a {
color: #111111;
}
.ui-default-state:active, .ui-active-state {
border: 1px solid #2694e8;
background: #8ab9ff url(images/8ab9ff_40x100_textures_02_glass_50.png) 0 50% repeat-x;
font-weight: normal;
color: #000000 !important;
outline: none;
}
.ui-active-state a {
color: #000000;
outline: none;
}
/*icons*/
.ui-arrow-right-default {background: url(images/888888_7x7_arrow_right.gif) no-repeat 50% 50%;}
.ui-arrow-right-default:hover, .ui-arrow-right-hover {background: url(images/222222_7x7_arrow_right.gif) no-repeat 50% 50%;}
.ui-arrow-right-default:active, .ui-arrow-right-active {background: url(images/ffffff_7x7_arrow_right.gif) no-repeat 50% 50%;}
.ui-arrow-right-content {background: url(images/222222_7x7_arrow_right.gif) no-repeat 50% 50%;}
.ui-arrow-left-default {background: url(images/888888_7x7_arrow_left.gif) no-repeat 50% 50%;}
.ui-arrow-left-default:hover, .ui-arrow-left-hover {background: url(images/222222_7x7_arrow_left.gif) no-repeat 50% 50%;}
.ui-arrow-left-default:active, .ui-arrow-left-active {background: url(images/ffffff_7x7_arrow_left.gif) no-repeat 50% 50%;}
.ui-arrow-left-content {background: url(images/222222_7x7_arrow_left.gif) no-repeat 50% 50%;}
.ui-arrow-down-default {background: url(images/888888_7x7_arrow_down.gif) no-repeat 50% 50%;}
.ui-arrow-down-default:hover, .ui-arrow-down-hover {background: url(images/222222_7x7_arrow_down.gif) no-repeat 50% 50%;}
.ui-arrow-down-default:active, .ui-arrow-down-active {background: url(images/ffffff_7x7_arrow_down.gif) no-repeat 50% 50%;}
.ui-arrow-down-content {background: url(images/222222_7x7_arrow_down.gif) no-repeat 50% 50%;}
.ui-arrow-up-default {background: url(images/888888_7x7_arrow_up.gif) no-repeat 50% 50%;}
.ui-arrow-up-default:hover, .ui-arrow-up-hover {background: url(images/222222_7x7_arrow_up.gif) no-repeat 50% 50%;}
.ui-arrow-up-default:active, .ui-arrow-up-active {background: url(images/ffffff_7x7_arrow_up.gif) no-repeat 50% 50%;}
.ui-arrow-up-content {background: url(images/222222_7x7_arrow_up.gif) no-repeat 50% 50%;}
.ui-close-default {background: url(images/888888_11x11_icon_close.gif) no-repeat 50% 50%;}
.ui-close-default:hover, .ui-close-hover {background: url(images/222222_11x11_icon_close.gif) no-repeat 50% 50%;}
.ui-close-default:active, .ui-close-active {background: url(images/ffffff_11x11_icon_close.gif) no-repeat 50% 50%;}
.ui-close-content {background: url(images/ffffff_11x11_icon_close.gif) no-repeat 50% 50%;}
.ui-folder-closed-default {background: url(images/888888_11x11_icon_folder_closed.gif) no-repeat 50% 50%;}
.ui-folder-closed-default:hover, .ui-folder-closed-hover {background: url(images/222222_11x11_icon_folder_closed.gif) no-repeat 50% 50%;}
.ui-folder-closed-default:active, .ui-folder-closed-active {background: url(images/ffffff_11x11_icon_folder_closed.gif) no-repeat 50% 50%;}
.ui-folder-closed-content {background: url(images/888888_11x11_icon_folder_closed.gif) no-repeat 50% 50%;}
.ui-folder-open-default {background: url(images/888888_11x11_icon_folder_open.gif) no-repeat 50% 50%;}
.ui-folder-open-default:hover, .ui-folder-open-hover {background: url(images/222222_11x11_icon_folder_open.gif) no-repeat 50% 50%;}
.ui-folder-open-default:active, .ui-folder-open-active {background: url(images/ffffff_11x11_icon_folder_open.gif) no-repeat 50% 50%;}
.ui-folder-open-content {background: url(images/ffffff_11x11_icon_folder_open.gif) no-repeat 50% 50%;}
.ui-doc-default {background: url(images/888888_11x11_icon_doc.gif) no-repeat 50% 50%;}
.ui-doc-default:hover, .ui-doc-hover {background: url(images/222222_11x11_icon_doc.gif) no-repeat 50% 50%;}
.ui-doc-default:active, .ui-doc-active {background: url(images/ffffff_11x11_icon_doc.gif) no-repeat 50% 50%;}
.ui-doc-content {background: url(images/222222_11x11_icon_doc.gif) no-repeat 50% 50%;}
.ui-arrows-leftright-default {background: url(images/888888_11x11_icon_arrows_leftright.gif) no-repeat 50% 50%;}
.ui-arrows-leftright-default:hover, .ui-arrows-leftright-hover {background: url(images/222222_11x11_icon_arrows_leftright.gif) no-repeat 50% 50%;}
.ui-arrows-leftright-default:active, .ui-arrows-leftright-active {background: url(images/ffffff_11x11_icon_arrows_leftright.gif) no-repeat 50% 50%;}
.ui-arrows-leftright-content {background: url(images/222222_11x11_icon_arrows_leftright.gif) no-repeat 50% 50%;}
.ui-arrows-updown-default {background: url(images/888888_11x11_icon_arrows_updown.gif) no-repeat 50% 50%;}
.ui-arrows-updown-default:hover, .ui-arrows-updown-hover {background: url(images/222222_11x11_icon_arrows_updown.gif) no-repeat 50% 50%;}
.ui-arrows-updown-default:active, .ui-arrows-updown-active {background: url(images/ffffff_11x11_icon_arrows_updown.gif) no-repeat 50% 50%;}
.ui-arrows-updown-content {background: url(images/222222_11x11_icon_arrows_updown.gif) no-repeat 50% 50%;}
.ui-minus-default {background: url(images/888888_11x11_icon_minus.gif) no-repeat 50% 50%;}
.ui-minus-default:hover, .ui-minus-hover {background: url(images/222222_11x11_icon_minus.gif) no-repeat 50% 50%;}
.ui-minus-default:active, .ui-minus-active {background: url(images/ffffff_11x11_icon_minus.gif) no-repeat 50% 50%;}
.ui-minus-content {background: url(images/222222_11x11_icon_minus.gif) no-repeat 50% 50%;}
.ui-plus-default {background: url(images/888888_11x11_icon_plus.gif) no-repeat 50% 50%;}
.ui-plus-default:hover, .ui-plus-hover {background: url(images/222222_11x11_icon_plus.gif) no-repeat 50% 50%;}
.ui-plus-default:active, .ui-plus-active {background: url(images/ffffff_11x11_icon_plus.gif) no-repeat 50% 50%;}
.ui-plus-content {background: url(images/222222_11x11_icon_plus.gif) no-repeat 50% 50%;}
/*hidden elements*/
.ui-hidden {
display: none;/* for accessible hiding: position: absolute; left: -99999999px*/;
}
.ui-accessible-hidden {
position: absolute; left: -99999999px;
}
/*reset styles*/
.ui-reset {
/*resets*/margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none;
}
/*clearfix class*/
.ui-clearfix:after {
content: ".";
display: block;
height: 0;
clear: both;
visibility: hidden;
}
.ui-clearfix {display: inline-block;}
/* Hides from IE-mac \*/
* html .ui-clearfix {height: 1%;}
.ui-clearfix {display: block;}
/* End hide from IE-mac */
/* Note: for resizable styles, use the styles listed above in the dialog section */

View File

@ -1,56 +0,0 @@
var CommandWindow = {};
CommandWindow.updateCommandResult = function() {
//todo: add commandQueryObj.value to the history select box
var commandQueryObj = $('commandQuery');
var copyChkBoxObj = $('copyChkBox');
var nodelistTxtObj = $('nodeList');
var nodegrpsCboBoxObj = $('nodegrpsCboBox');
var pshChkBoxObj = $('pshChkBox');
var serialChkBoxObj = $('serialChkBox');
var verifyChkBoxObj = $('verifyChkBox');
var fanoutTxtBoxObj = $('fanoutTxtBox');
var userIDTxtBoxObj = $('userIDTxtBox');
var rshellTxtBoxObj = $('rshellTxtBox');
var monitorChkBoxObj = $('monitorChkBox');
var ret_codeChkBoxObj = $('ret_codeChkBox');
// Do AJAX call and get HTML here.
var url = "dsh_action.php";
var postPara = "command=" + encodeURIComponent(commandQueryObj.value);
if (nodelistTxtObj) { postPara += "&node=" + encodeURIComponent(nodelistTxtObj.value); }
if (nodegrpsCboBoxObj) { postPara += "&nodegrps=" + encodeURIComponent(nodegrpsCboBoxObj.options[nodegrpsCboBoxObj.selectedIndex].value); }
if (copyChkBoxObj.checked == true) postPara += "&copy=on"; else postPara += "&copy=off";
if (pshChkBoxObj.checked == true) postPara += "&psh=on"; else postPara += "&psh=off";
if (serialChkBoxObj.checked == true) postPara += "&serial=on"; else postPara += "&serial=off";
if (verifyChkBoxObj.checked == true) postPara += "&verify=on"; else postPara += "&verify=off";
postPara += "&fanout=" + encodeURIComponent(fanoutTxtBoxObj.value);
postPara += "&userID=" + encodeURIComponent(userIDTxtBoxObj.value);
postPara += "&rshell=" + encodeURIComponent(rshellTxtBoxObj.value);
if (monitorChkBoxObj.checked == true) postPara += "&monitor=on"; else postPara += "&monitor=off";
if (ret_codeChkBoxObj.checked == true) postPara += "&ret_code=on"; else postPara += "&ret_code=off";
new Ajax.Request(url, {
method: 'post', postBody: postPara,
onSuccess: function(transport) {
var htmlContent = transport.responseText;
var win = new Window({className: "dialog",
width: 350,
height: 400,
zIndex: 100,
resizable: true,
title: "Running commands",
showEffect: Effect.BlindDown,
hideEffect: Effect.SwitchOff,
draggable: true,
wiredDrag: true});
win.getContent().innerHTML = htmlContent;
//win.setStatusBar("Status bar info");
win.showCenter();
}
});
};

View File

@ -18,70 +18,16 @@ for (i in cookies) { var pair = cookies[i].split('='); cookret[pair[0]] = unesca
return cookret;
}
function selectAll(element, objectName)
// Check or uncheck all checkboxes that start with objectName
function selectAllCheckBoxes(element, objectName)
{
//todo: use jQuery to accomplish this
var sel = element.checked;
var form = element.form;
var searchstr = '^' + objectName + '\\d';
var searchstr = '^' + objectName + '\d';
for(var i = 0; i < form.length; i++)
{
var e = form.elements[i];
if (e.type == "checkbox" && e.name.search(searchstr) > -1) { e.checked = sel; }
}
}
function isSelected(form, objectName)
{
var searchstr = '^' + objectName + '\\d';
for(var i = 0; i < form.length; i++)
{
var e = form.elements[i];
if (e.type == "checkbox" && e.name.search(searchstr) > -1 && e.checked) { return true; }
}
return false;
}
function numSelected(form, objectName)
{
var searchstr = '^' + objectName + '\\d';
var j = 0;
for(var i = 0; i < form.length; i++)
{
var e = form.elements[i];
if (e.type == "checkbox" && e.name.search(searchstr) > -1 && e.checked)
{
if (++j == 2) { return j; }
}
}
return j;
}
function toggleSection(para, tableId)
{
var t; var i;
var imageId = tableId + '-im';
if (document.all) { t = document.all[tableId]; i = document.all[imageId]; } // IE 4+
else if (document.getElementById) { t = document.getElementById(tableId); i = document.getElementById(imageId); } // Netscape 6
else { alert('Cannot expand or collapse sections in this version of your browser.'); return false; }
if (!t) { alert('Error: section ' + tableId + ' not found.'); return false; }
if (!t.style.display || t.style.display == 'inline') // the inner table is currently visible
{
t.style.display = 'none';
para.title = 'Click to expand section';
//if (txt) { txt = txt.replace(/^-/i, '+'); }
i.src = 'images/plus-sign.gif';
//i.alt = '+';
}
else // the inner table is currently invisible
{
t.style.display = 'inline';
para.title = 'Click to collapse section';
//if (txt) { txt = txt.replace(/^\+/i, '-'); }
i.src = 'images/minus-sign.gif';
//i.alt = '-';
}
return true;
}

View File

@ -26,19 +26,24 @@ function insertHeader($title, $stylesheets, $javascripts, $currents) {
global $TOPDIR;
// Remember the current page so we can open it again the next time they come to the web interface
$expire_time = gmmktime(0, 0, 0, 1, 1, 2038);
foreach ($currents as $key => $value) { setcookie("currentpage[$key]", $value, $expire_time, '/'); }
if ($currents[0] != 'logout') {
$expire_time = gmmktime(0, 0, 0, 1, 1, 2038);
foreach ($currents as $key => $value) { setcookie("currentpage[$key]", $value, $expire_time, '/'); }
}
echo <<<EOS
echo <<<EOS1
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 Strict//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>$title</title>
<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=iso-8859-1">
<link href="$TOPDIR/lib/style.css" rel="stylesheet">
<link href="$TOPDIR/lib/style.css" rel=stylesheet type='text/css'>
<link href="$TOPDIR/jq/theme/jquery-ui-theme.css" rel=stylesheet type='text/css'>
<script src="$TOPDIR/jq/jquery.min.js" type="text/javascript"></script>
<script src="$TOPDIR/jq/jquery-ui-all.min.js" type="text/javascript"></script>
<script src="$TOPDIR/lib/functions.js" type="text/javascript"></script>
EOS;
EOS1;
if ($stylesheets) {
@ -52,23 +57,52 @@ if ($javascripts) {
}
}
echo "</head><body>\n";
echo <<<EOS
echo <<<EOS3
<table id=headingTable border=0 cellspacing=0 cellpadding=0>
<tr valign=top>
<td><img class=ImgTop src='$TOPDIR/images/topl2.jpg'></td>
<td class=TopMiddle><img id=xcatImage src='$TOPDIR/images/xCAT_icon-l.gif'></td>
<td class=TopMiddle width='100%'>
EOS;
EOS3;
//echo "<div id=top><img id=xcatImage src='$TOPDIR/images/xCAT_icon.gif'><div id=menuDiv>\n";
insertMenus($currents);
echo "</td><td><img class=ImgTop src='$TOPDIR/images/topr2.jpg'></td></tr></table>\n";
//echo "</div></div>\n"; // end the top div
if (!isAuthenticated()) {
insertLogin(); // display the login dialog and page footer
exit; // Do not want to continue with the rest of the page
// If the login dialog is successful, it will load index.php which will remember what
// page they were trying to go to.
}
} // end insertHeader
//-----------------------------------------------------------------------------
// If they are not authenticated yet, display the login dialog
function insertLogin() {
global $TOPDIR;
// The javascript in xcatauth.js will add the Login button and display the dialog
echo <<<EOS2
<script src="$TOPDIR/lib/xcatauth.js" type="text/javascript"></script>
<div id=logdialog>
<p id=logdialogNote>Note: The username and password used must be in the passwd table in the xCAT database.</p>
<form id=loginform><table cellspacing=3>
<tr><td align=right><label for=username>Username:</label></td><td align=left><input id=username type=text name=username></td></tr>
<tr><td align=right><label for=password>Password:</label></td><td align=left><input id=password type=password name=password></td></tr>
</table></form>
<p><span id=logstatus><br/></span></p>
</div>
EOS2;
insertFooter();
}
// This is the data structure that represents the menu for each page.
$MENU = array(
'machines' => array(
@ -135,6 +169,13 @@ $MENU = array(
'about' => array('label' => 'About', 'url' => "$TOPDIR/support/about.php"),
)
),
'logout' => array(
'label' => 'Logout',
'default' => 'logout',
'list' => array(
'logout' => array('label' => 'Logout/Login', 'url' => "$TOPDIR/lib/logout.php"),
)
),
);
@ -208,10 +249,18 @@ echo '<div class=PageFooter><p id=disclaimer>This interface is still under const
// args is an array of arguments to the cmd
// Returns a tree of SimpleXML objects. See perl-xCAT/xCAT/Client.pm for the format.
function docmd($cmd, $nr, $args){
// If for some reason we are not logged in yet, do not even try to communicate w/xcatd
if (!is_logged()) {
echo "<p>Docmd: not logged in yet - can not run command.</p>\n";
return simplexml_load_string('<xcat></xcat>','SimpleXMLElement', LIBXML_NOCDATA);
}
$request = simplexml_load_string('<xcatrequest></xcatrequest>');
$request->addChild('command',$cmd);
if(!empty($nr)) { $request->addChild('noderange',$nr); }
if (!empty($args)) { foreach ($args as $a) { $request->addChild('arg',$a); } }
$usernode=$request->addChild('becomeuser');
$usernode->addChild('username',$_SESSION["username"]);
$usernode->addChild('password',getpassword());
#echo $request->asXML();
$xml = submit_request($request,0);
return $xml;
@ -224,8 +273,8 @@ function docmd($cmd, $nr, $args){
// Returns a tree of SimpleXML objects. See perl-xCAT/xCAT/Client.pm for the format.
function submit_request($req, $skipVerify){
#global $cert,$port,$xcathost;
$apachehome = '/var/www'; #todo: for sles this should be /var/lib/wwwrun
$cert = "$apachehome/.xcat/client-cred.pem";
//$apachehome = '/var/www'; # for sles this should be /var/lib/wwwrun
//$cert = "$apachehome/.xcat/client-cred.pem";
$xcathost = "localhost";
$port = "3001";
$rsp = 0;
@ -233,21 +282,28 @@ function submit_request($req, $skipVerify){
$cleanexit=0;
// Open a socket to xcatd
$context = stream_context_create(array('ssl'=>array('local_cert' => $cert)));
if($fp = stream_socket_client('ssl://'.$xcathost.':'.$port,$errno,$errstr,30,
STREAM_CLIENT_CONNECT,$context)){
$context = stream_context_create(); // do not need certificate anymore: array('ssl'=>array('local_cert' => $cert))
if($fp = stream_socket_client('ssl://'.$xcathost.':'.$port,$errno,$errstr,30,STREAM_CLIENT_CONNECT,$context)){
fwrite($fp,$req->asXML()); // send the xml to xcatd
while(!feof($fp)){ // and then read until there is no more
$response .= preg_replace('/\n/','', stream_get_contents($fp)); // remove newlines and add it to the response
$response .= preg_replace('/\n/','', fgets($fp)); // remove newlines and add it to the response
// Look for the serverdone response
$pattern = '/<xcatresponse>\s*<serverdone>\s*<\/serverdone>\s*<\/xcatresponse>\s*$/';
if(preg_match($pattern,$response)) { // transaction is done, pkg up the xml and return it
#echo htmlentities($response);
$response = '<xcat>' . preg_replace($pattern,'', $response) . '</xcat>'; // remove the serverdone response and put an xcat tag around the rest
$fullpattern = '/<xcatresponse>\s*<serverdone>\s*<\/serverdone>\s*<\/xcatresponse>/';
$mixedpattern = '/<serverdone>\s*<\/serverdone>.*<\/xcatresponse>/';
//$shortpattern = '/<serverdone>\s*<\/serverdone>/';
if(preg_match($mixedpattern,$response)) { // transaction is done, pkg up the xml and return it
//echo "<p>", htmlentities($response), "</p>\n";
// remove the serverdone response and put an xcat tag around the rest
$count = 0;
$response = preg_replace($fullpattern,'', $response, -1, $count); // 1st try to remove the long pattern
if (!$count) { $response = preg_replace($mixedpattern,'', $response) . '</xcatresponse>/'; } // if its not there, then remove the short pattern
$response = "<xcat>$response</xcat>";
//echo "<p>", htmlentities($response), "</p>\n";
$rsp = simplexml_load_string($response,'SimpleXMLElement', LIBXML_NOCDATA);
//echo '<p>'; print_r($rsp); echo "</p>\n";
$cleanexit = 1;
break;
}
}
fclose($fp);
@ -256,7 +312,7 @@ function submit_request($req, $skipVerify){
}
if(! $cleanexit){
if(!$skipVerify){
echo "<p>Error: xCAT response ended prematurely.</p>";
echo "<p>Error: xCAT response ended prematurely: ", htmlentities($response), "</p>";
$rsp = 0;
}
}
@ -344,17 +400,22 @@ function runcmd ($cmd, $mode, &$output, $options=NULL){
//-----------------------------------------------------------------------------
// Send the keys and values in the primary global arrays
function dumpGlobals() {
trace('$_SERVER:');
foreach ($_SERVER as $key => $val) { trace("$key = $val"); }
trace('<br>$_ENV:');
foreach ($_ENV as $key => $val) { trace("$key = $val"); }
trace('<br>$_REQUEST:');
foreach ($_REQUEST as $key => $val) { trace("$key = $val"); }
//trace('<b>$_SERVER:</b>');
//foreach ($_SERVER as $key => $val) { trace("$key=$val."); }
//trace('<b>$_ENV:</b>');
//foreach ($_ENV as $key => $val) { trace("$key=$val."); }
trace('<b>$_GET:</b>');
foreach ($_GET as $key => $val) { trace("$key=$val."); }
trace('<b>$_POST:</b>');
foreach ($_POST as $key => $val) { trace("$key=$val."); }
trace('<b>$_COOKIE:</b>');
foreach ($_COOKIE as $key => $val) { trace("$key=$val."); }
if (isset($_SESSION)) {
trace('<br>$_SESSION:');
foreach ($_SESSION as $key => $val) { trace("$key = $val"); }
trace('<b>$_SESSION:</b>');
foreach ($_SESSION as $key => $val) { trace("$key=$val."); }
}
trace('<b>$GLOBALS:</b>');
foreach ($GLOBALS as $key => $val) { trace("$key=$val."); }
}
@ -792,18 +853,19 @@ function insertTabs ($tablist, $currentTabIndex) {
//-----------------------------------------------------------------------------
// Create the Action buttons in a table. Each argument passed in is a button, which is an array of attribute strings.
// If your onclick attribute contains javascript code that uses quotes, use double quotes instead of single quotes.
// Note: if only 1 button is passed in, the button is not put in a table.
function insertButtons () {
$num = func_num_args();
if ($num > 1) echo "<TABLE cellpadding=0 cellspacing=2><TR>";
/* if ($num > 1) */ echo "<TABLE cellpadding=0 cellspacing=2><TR>";
foreach (func_get_args() as $button) {
//echo "<td><INPUT type=submit class=but $button ></td>";
$otherattrs = @$button['otherattrs'];
if ($num > 1) echo "<td>";
echo "<a class=button href='' onclick='{$button['onclick']};return false' $otherattrs><span>{$button['label']}</span></a>";
if ($num > 1) echo "</td>";
$id = @$button['id'];
if (!empty($id)) { $id = "id=$id"; }
/* if ($num > 1) */ echo "<td>";
echo "<a class=button $id href='' onclick='{$button['onclick']};return false' $otherattrs><span>{$button['label']}</span></a>";
/* if ($num > 1) */ echo "</td>";
}
if ($num > 1) echo "</TR></TABLE>\n";
/* if ($num > 1) */ echo "</TR></TABLE>\n";
}
@ -839,4 +901,102 @@ function splitTableFields($line){
return $fields;
}
#function to enable password storage to split between cookie and session variable
function xorcrypt($data,$key) {
$datalen=strlen($data);
$keylen=strlen($key);
for ($i=0;$i<$datalen;$i++) {
$data[$i]=chr(ord($data[$i])^ord($key[$i]));
}
return $data;
}
function getpassword() {
if (isset($GLOBALS['xcatauthsecret'])) {
$cryptext=$GLOBALS['xcatauthsecret'];
} else if (isset($_COOKIE["xcatauthsecret"])) {
$cryptext = $_COOKIE["xcatauthsecret"];
} else {
return false;
}
return xorcrypt($_SESSION["secretkey"],base64_decode($cryptext));
}
#remembers the password, splitting knowledge between server and client side
#persistant storage
#Caller should regenerate session id when contemplating a new user/password,
#to preclude session fixation, though fixation is limited without the secret.
function setpassword($password) {
$randlen=strlen($password);
$key=getrandchars($randlen);
$cryptext=xorcrypt($password,$key);
$cryptext=base64_encode($cryptext); #non-ascii chars, base64 it
#Not bothering with explicit expiration, as time sync would be too hairy
#should go away when browser closes. Any timeout will be handled server
#side. If the session id invalidates and the one-time key discarded,
#the cookie contents are worthless anyway
#nevertheless, when logout happens, cookie should be reaped
setcookie("xcatauthsecret",$cryptext,0,'/');
$GLOBALS["xcatauthsecret"]=$cryptext; #May need it sooner, prefer globals
$_SESSION["secretkey"]=$key;
}
function getrandchars($length) {
$charset='0123456789abcdefghijklmnopqrstuvwxyz!@#$%^&*';
$charsize=strlen($charset);
srand();
$chars='';
for ($i=0;$i<$length;$i++) {
$num=rand()%$charsize;
$chars=$chars.substr($charset,$num,1);
}
return $chars;
}
// Determine if they at least have a user/pw that they have entered (that may or may not be valid)
function is_logged() {
if (isset($_SESSION["username"]) and !is_bool(getpassword())) {
return true;
} else {
return false;
}
}
// Determine if they are currently logged in successfully
function isAuthenticated() {
if (is_logged()) {
if ($_SESSION["xcatpassvalid"] != 1) {
$testcred=docmd("authcheck","",NULL);
if (isset($testcred->{'xcatresponse'}->{'data'})) {
$result="".$testcred->{'xcatresponse'}->{'data'};
if (is_numeric(strpos("Authenticated",$result))) {
$_SESSION["xcatpassvalid"]=1; #proven good
} else {
$_SESSION["xcatpassvalid"]=0; #proven bad
}
}
}
}
if (isset($_SESSION["xcatpassvalid"]) and $_SESSION["xcatpassvalid"]==1) { return true; }
else { return false; }
}
function logout() {
#clear the secret cookie from browser.
#expire cookie a week ago, server time, may not work if client clock way off, but the value will be cleared at least.
if (isset($_COOKIE["xcatauthsecret"])) {
setcookie("xcatauthsecret",'',time()-86400*7,'/'); #NOTE: though firefox doesn't seem to zap it dynamically from cookie store in
#the client side dialog, firefox does stop submitting the value. The sensitivity of the 'stale' cookie even if compromised
#is negligible, as the session id will be invalidated and the one-time-key needed to decrypt the password is destroyed on the server
}
#expire the sesion cookie
if (isset($_COOKIE[session_name()])) {
setcookie(session_name(),"",time()-86400*7,"/");
}
#clear server store of data
$_SESSION=array();
session_destroy();
}
?>

View File

@ -0,0 +1,6 @@
<?php
# In PHP 5.2 or higher we don't need to bring this in
if (!function_exists('json_encode')) {
require_once 'jsonwrapper_inner.php';
}
?>

View File

@ -0,0 +1,23 @@
<?php
require_once 'JSON/JSON.php';
function json_encode($arg)
{
global $services_json;
if (!isset($services_json)) {
$services_json = new Services_JSON();
}
return $services_json->encode($arg);
}
function json_decode($arg)
{
global $services_json;
if (!isset($services_json)) {
$services_json = new Services_JSON();
}
return $services_json->decode($arg);
}
?>

30
xCAT-web/lib/log.php Normal file
View File

@ -0,0 +1,30 @@
<?php
// ???
$TOPDIR = '..';
require_once "$TOPDIR/lib/functions.php";
require_once "$TOPDIR/lib/jsonwrapper.php";
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
if (isset($_REQUEST["password"])) {
$_SESSION=array(); #Clear data from session. prevent session data from migrating in a hijacking?
session_regenerate_id(true);#Zap existing session entirely..
setpassword($_REQUEST["password"]);
$_SESSION["xcatpassvalid"]=-1; #unproven password
}
if (isset($_REQUEST["username"])) {
$_SESSION["username"]=$_REQUEST["username"];
$_SESSION["xcatpassvalid"]=-1; #unproven password
}
$jdata=array();
if (isAuthenticated()) { $jdata["authenticated"]="yes"; }
else { $jdata["authenticated"]="no"; }
echo json_encode($jdata);
?>

28
xCAT-web/lib/logout.php Normal file
View File

@ -0,0 +1,28 @@
<?php
// Allow the user to log out and log back in
$TOPDIR = '..';
require_once "$TOPDIR/lib/functions.php";
logout();
insertHeader('Logout/Login', NULL, NULL, array('logout','logout'));
/*
dumpGlobals();
$xml = docmd("authcheck","",NULL);
echo "<p>authcheck:<br>\n";
foreach ($xml->children() as $response) foreach ($response->children() as $t) { echo (string) $t, "<br>\n"; }
echo "</p>\n";
$xml = docmd('tabdump','',NULL);
echo "<p>tabdump:<br>\n";
foreach ($xml->children() as $response) foreach ($response->children() as $t) { echo (string) $t, "<br>\n"; }
echo "</p>\n";
*/
//insertNotDoneYet();
insertFooter();
?>

View File

@ -1,13 +1,53 @@
<?php
//setcookie("history", "", time() - 3600); //to delete a cookie, but did not seem to work
$TOPDIR = '..';
require_once "../lib/functions.php";
echo "<p>\n";
runcmd('echo $PATH', 1, $junk);
runcmd('whoami', 1, $junk);
echo <<<EOS1
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 Strict//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>phpinfo</title>
<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=iso-8859-1">
<link href="$TOPDIR/lib/style.css" rel=stylesheet type='text/css'>
<link href="$TOPDIR/jq/theme/jquery-ui-theme.css" rel=stylesheet type='text/css'>
<script src="$TOPDIR/jq/jquery.min.js" type="text/javascript"></script>
<script src="$TOPDIR/jq/jquery-ui-all.min.js" type="text/javascript"></script>
<script src="$TOPDIR/lib/functions.js" type="text/javascript"></script>
</head>
<body>
EOS1;
//insertLogin();
echo <<<EOS2
<script src="$TOPDIR/lib/xcatauth.js" type="text/javascript"></script>
<div id=logdialog>
<form id=loginform>
<label for=username>Username:</label><input id=username type=text name=username><br/>
<label for=password>Password:</label><input id=password type=password name=password></form>
<span class=logstatus id=logstatus><br/></span>
</div>
EOS2;
/*
dumpGlobals();
$xml = docmd("authcheck","",NULL);
echo "<p>authcheck:<br>\n";
foreach ($xml->children() as $response) foreach ($response->children() as $t) { echo (string) $t, "<br>\n"; }
echo "</p>\n";
/* $output = array(); runcmd("listattr", 2, $output); foreach ($output as $line) { echo "<p>line=$line</p>"; } */
$xml = docmd('tabdump','',NULL);
echo "<p>tabdump:<br>\n";
foreach ($xml->children() as $response) foreach ($response->children() as $t) { echo (string) $t, "<br>\n"; }
echo "</p>\n";
phpinfo()
phpinfo();
*/
echo "</body></html>\n";
?>

View File

@ -177,7 +177,6 @@ TEXTAREA {vertical-align : middle; font-size : 8pt; font-family : sans-serif; fo
.TableHeader { color: black; background-color : #fffdb0; font-weight : bold; font-size : 9pt; white-space: nowrap; }
.TableRow { color: black; background-color : #b3c2d9; font-size : 9pt; white-space: nowrap; } /* #d8dff1 */
.FormTable { color: black; background-color : #CCCCCC; }
.Info {color : blue;}
.Error {font-weight : bold; color : red;}
.Trace {color: gray; padding: 0px; margin: 0px;}
@ -250,3 +249,21 @@ a.button:active span {
background-position: bottom left;
padding: 6px 0 4px 18px; /* push text down 1px */
}
/* For the Login dialog */
.LogDialog {
background-color: white;
}
#logdialog { /* the div inside the dialog */
margin: 0px 10px 20px 10px; /* for some reason the containing dialog cuts off the right 30px */
padding: 0px;
/* background-color: white;
font-family: Sans-Serif;
font-size: 7pt; */
}
#logdialogNote {
margin-top: 3px;
}

66
xCAT-web/lib/xcatauth.js Normal file
View File

@ -0,0 +1,66 @@
/* xCAT WebUI authentication handling functions/setup */
/* IBM(c) 2007 EPL license http://www.eclipse.org/legal/epl-v10.html */
function onlogin (data, textstatus) {
$("#password").val(""); //clear the password field regardless of what happens
if (data.authenticated == "yes") {
$("#logstatus").text("Logged in successfully");
//todo: nrtree.refresh(); // Fix tree potentiall broken through attempts to operate without auth
$("#logdialog").dialog("close");
window.location = '../index.php'; // it has remembered what page they were trying to go to
} else {
$("#logstatus").text("Authentication failure");
$("#logstatus").css("color","#ff0000");
}
}
function authenticate() {
$("#logstatus").css("color","#000000");
$("#logstatus").html('Authenticating...<img src="../images/throbber.gif"/>');
var passwd=$("#password").val();
$.post("../lib/log.php",{
username: $("#username").val(),
password: passwd
},onlogin,"json");
}
$(document).ready(function() {
$("#logdialog").dialog({
modal: true,
closeOnEscape: false,
closebutton: false,
/* dialogClass: 'LogDialog', */
overlay: {
backgroundColor: "#CCCCCC",
opacity: 0.3
},
height: 270,
width: 350,
autoOpen: true,
buttons: {
"Log In": authenticate
},
open: function(type, dialog) {
if (document.location.protocol == "http:") {
$("#logstatus").html("Unencrypted Session!");
$("#logstatus").css("color","#ff0000");
}
if ($("#username").val() == "") {
$("#username").focus();
} else {
$("#password").focus();
}
}
});
$("#username").keydown(function(event) { //When 'enter' is hit while in username, advance to password
if (event.keyCode==13) {
$("#password").focus();
}
});
$("#password").keydown(function(event) { //Submit authentication if enter is pressed in password field
if (event.keyCode==13) {
authenticate();
}
});
});

View File

@ -24,7 +24,7 @@ $pages = array('intro' => 'Discover Hardware',
if (isset($_REQUEST['page'])) { displayWizard($pages); }
else { // initial display of the wizard, show the whole page
insertHeader('Discover New Nodes', array('discover.css',"$TOPDIR/lib/wizard.css"), array("$TOPDIR/jq/jquery.min.js"), array('machines','discover'));
insertHeader('Discover New Nodes', array('discover.css',"$TOPDIR/lib/wizard.css"), NULL, array('machines','discover'));
echo "<div id=content align=center>\n";
displayWizard($pages);
echo "</div>\n"; // end the content div

View File

@ -0,0 +1,51 @@
<?php
// Gets the nodes and groups for group/node js widget
$TOPDIR = '..';
require_once "$TOPDIR/lib/functions.php";
require_once "$TOPDIR/lib/jsonwrapper.php";
if (isset($_GET['id'])) {
$id = $_GET['id'];
}
if ($id == "0") {
$id = '/.*';
} else {
$id=preg_replace('/^,/','',$id);
}
$rvals=docmd('extnoderange',$id,array('subgroups'));
$parents=array();
$root=1;
if ($id == '/.*') {
$id=',';
} else {
$parents=split("@",$id);
$id=",$id@";
$root=0;
}
//unset($rvals->xcatresponse->serverdone[0]);
$numsubgroups=count($rvals->xcatresponse->intersectinggroups);
$numnodes=count($rvals->xcatresponse->node);
$jdata=array();
if ($numnodes >= $numsubgroups) { #If there are few enough subgroups to be helpful filters, add them in
foreach ($rvals->xcatresponse->intersectinggroups as $group) {
if (! in_array("$group",$parents)) {
$jdata[]= array("data"=>"$group",
"attributes"=>array("id"=>"$id$group",
"rel"=>'group'),
"state"=>'closed');
}
}
} #If there were more groups than nodes, leave the signal to noise ratio down
if ($root==0) {
foreach ($rvals->xcatresponse->node as $node) {
$jdata[] = array("data"=>"$node",
"attributes"=>array("id"=>",$node",
"rel"=>'node'));
}
}
# header('Content-type: text/html');
echo json_encode($jdata);
?>

14
xCAT-web/manage/dsh.css Normal file
View File

@ -0,0 +1,14 @@
.FormTable { color: black; background-color : #CCCCCC; }
#inner_table {
margin-left: 5px;
margin-right: 10px;
}
#cmdDialog {
margin: 0px 10px 20px 10px; /* for some reason the containing dialog cuts off the right 30px */
padding: 0px;
font-family: Sans-Serif;
font-size: 7pt;
}

60
xCAT-web/manage/dsh.js Normal file
View File

@ -0,0 +1,60 @@
// Create and show the dialog that shows the dsh output
$(document).ready(function() {
var cmddialog = $('<div id=cmdDialog title=Title></div>');
cmddialog.dialog({ height: 500, width: 400, autoOpen: false});
$("input[type='text']").keypress(function(e) { if (isEnterKey(e.which)) {opencmddialog();} });
});
// Determine if the key pressed was the enter key.
// According to http://unixpapa.com/js/key.html, this is key code 13 in all browsers.
function isEnterKey(keycode) { if (keycode == 13) { return true; } else { return false; } }
// Called by the select combobox to put its value into the command field
function _setvars(){
var form = window.document.dshForm;
form.command.value = form.history.value;
}
// Pop open the dialog and fill it with the dsh output
function opencmddialog() {
// Build the property list that will get POSTed
var props = {};
props.command = $('#command').val();
props.nodegrps = $('#nodegrps option:selected').val();
// If required fields were not filled in, bail
if (props.command.length == 0 || props.nodegrps.length == 0) {
alert('Select a node group and enter a command before pressing the Run Cmd button.');
return;
}
if ($('#nodeList')) { props.nodeList = $('#nodeList').val(); }
if ($('#copy_script').attr('checked')) { props.copy_script = 1; }
if ($('#run_psh').attr('checked')) { props.run_psh = 1; }
if ($('#serial').attr('checked')) { props.serial = 1; }
if ($('#monitor').attr('checked')) { props.monitor = 1; }
if ($('#verify').attr('checked')) { props.verify = 1; }
if ($('#collapse').attr('checked')) { props.collapse = 1; }
var tmp = $('#fanout').val();
if (tmp.length) { props.fanout = tmp; }
var tmp = $('#userID').val();
if (tmp.length) { props.userID = tmp; }
var tmp = $('#rshell').val();
if (tmp.length) { props.rshell = tmp; }
var tmp = $('#shell_opt').val();
if (tmp.length) { props.shell_opt = tmp; }
if ($('#ret_code').attr('checked')) { props.ret_code = 1; }
// Open the dialog and get the output sent to it
$('#cmdDialog').children().remove(); // get rid of previous content
$('#cmdDialog').dialog("open");
$('#cmdDialog').load('dsh_action.php', props);
}

View File

@ -8,14 +8,14 @@ $expire_time = gmmktime(0, 0, 0, 1, 1, 2038);
require_once "$TOPDIR/lib/functions.php";
insertHeader('Run Commands on Nodes', array("$TOPDIR/themes/default.css"),
array("$TOPDIR/lib/CommandWindow.js", "$TOPDIR/js/prototype.js", "$TOPDIR/js/scriptaculous.js?load=effects", "$TOPDIR/js/window.js"),
insertHeader('Run Commands on Nodes', array('dsh.css'),
array('dsh.js'),
array('manage','dsh'));
echo <<<EOS
<div id=content>
<FORM NAME="dsh_options" onsubmit="checkEmpty();">
<TABLE class="inner_table" cellspacing=0 cellpadding=5>
<FORM NAME=dshForm>
<TABLE id=inner_table cellspacing=0 cellpadding=5>
<TBODY>
<TR><TD colspan=3>
EOS;
@ -23,9 +23,9 @@ EOS;
if (isset($_REQUEST['noderange'])) {
echo "<B><FONT size='+1'>Run Command on: </FONT></B>";
if (strlen($_REQUEST['noderange']) > 70) {
echo "<TEXTAREA rows=1 cols=70 readonly name=nodeList class=middle>" . $_REQUEST['noderange'] . "</TEXTAREA>\n";
echo "<TEXTAREA rows=1 cols=70 readonly name=nodeList id=nodeList>" . $_REQUEST['noderange'] . "</TEXTAREA>\n";
} else {
echo "<INPUT size=70 type=text name=nodeList id=nodeList class=middle value='" . $_REQUEST['noderange'] . "'>\n";
echo "<INPUT size=70 type=text name=nodeList id=nodeList value='" . $_REQUEST['noderange'] . "'>\n";
}
} else { echo "<B><FONT size='+1'>Run Command on a Group of Nodes</FONT></B>\n"; }
@ -36,12 +36,11 @@ echo <<<EOS2
</TD></TR>
<TR><TD colspan=3>
EOS2;
// <INPUT type="button" id="runCmdButton" name="runCmdButton" value="Run Cmd" class=middle onclick="CommandWindow.updateCommandResult()">
insertButtons(array('label' => 'Run Cmd', 'onclick' => 'CommandWindow.updateCommandResult()'));
insertButtons(array('label' => 'Run Cmd', 'id' => 'runcmdButton', 'onclick' => 'opencmddialog()'));
echo "</TD></TR>\n";
if (!isset($_REQUEST['noderange'])) {
echo "<TR class=FormTable><TD colspan=3>Run Command on Group:<SELECT name=nodegrps id=nodegrpsCboBox class=middle><OPTION value=''>Choose ...</OPTION>\n";
echo "<TR class=FormTable><TD colspan=3>Run Command on Group:<SELECT name=nodegrps id=nodegrps><OPTION value=''>Choose ...</OPTION>\n";
$nodegroups = getGroups();
foreach ($nodegroups as $group) {
//if($group == $currentGroup) { $selected = 'selected'; } else { $selected = ''; }
@ -53,9 +52,9 @@ if (!isset($_REQUEST['noderange'])) {
?>
<TR class=FormTable>
<TD colspan=3>Command:&nbsp;
<INPUT size=80 type=text name=command id=commandQuery class=middle> <!-- onchange='CommandWindow.updateCommandResult()' -->
<INPUT size=80 type=text name=command id=command>
History:
<SELECT name=history onChange="_setvars();" class=middle>
<SELECT name=history onChange="_setvars();">
<OPTION value="">Choose ...</OPTION>
<?php
if (isset($_COOKIE['history'])) {
@ -66,64 +65,64 @@ if (!isset($_REQUEST['noderange'])) {
</TD>
</TR>
<TR class=FormTable>
<TD colspan="3" nowrap><INPUT type="checkbox" name="copy_script" id="copyChkBox">
Copy command to nodes &nbsp;(The command specified above will 1st be copied
<TD colspan=3><INPUT type=checkbox name=copy_script id=copy_script>
Copy command to nodes (The command specified above will 1st be copied
to /tmp on the nodes and executed from there.)</TD>
</TR>
<TR class=FormTable>
<TD colspan="3" nowrap><INPUT type="checkbox" name="run_psh" id="pshChkBox" disabled>
Use parallel shell (psh) command instead of xdsh. Currently this option must be used, and the options below (associated with xdsh) are disabled.</TD>
<TD colspan=3><INPUT type=checkbox name=run_psh id=run_psh disabled>
Use parallel shell (psh) command instead of xdsh. When this option is chosen, some of the options below (associated with xdsh) are disabled.</TD>
</TR>
<TR class=FormTable>
<TD colspan="3"><B>Options:</TD>
<TD colspan=3><B>Options:</TD>
</TR>
<TR class=FormTable>
<TD width="37"></TD>
<TD width="210" valign="top" nowrap><INPUT type="checkbox" name="serial" id="serialChkBox">Streaming mode</TD>
<TD width="500">Specifies that output is returned as it becomes available from each target, instead of waiting for the command to be completed on a target before returning output from that target.</TD>
<TD width=37></TD>
<TD valign=top nowrap><INPUT type=checkbox name=serial id=serial>Streaming mode</TD>
<TD>Specifies that output is returned as it becomes available from each target, instead of waiting for the command to be completed on a target before returning output from that target.</TD>
</TR>
<TR class=FormTable>
<TD></TD>
<TD valign="top" nowrap><INPUT type="checkbox" name="monitor" id="monitorChkBox">Monitor</TD>
<TD valign=top nowrap><INPUT type=checkbox name=monitor id=monitor>Monitor</TD>
<TD>Prints starting and completion messages for each node. Useful with Streaming mode.</TD>
</TR>
<TR class=FormTable>
<TD></TD>
<TD valign="top" nowrap><INPUT type="checkbox" name="verify" id="verifyChkBox">Verify</TD>
<TD valign=top nowrap><INPUT type=checkbox name=verify id=verify>Verify</TD>
<TD>Verifies that nodes are responding before sending the command to them.</TD>
</TR>
<TR class=FormTable>
<TD></TD>
<TD valign="top" nowrap><INPUT type="checkbox" name="collapse" id="collapseChkBox" disabled>Collaspe Identical Output</TD>
<TD valign=top nowrap><INPUT type=checkbox name=collapse id=collapse disabled>Collaspe Identical Output</TD>
<TD>Automatically pipe the xdsh output into xdshbak which will only display output once for all the nodes that display identical output. See the xdshbak man page for more info.</TD>
</TR>
<TR class=FormTable>
<TD></TD>
<TD valign="top" nowrap>Fanout: <INPUT type="text" name="fanout" id="fanoutTxtBox"></TD>
<TD valign=top nowrap>Fanout: <INPUT type=text name=fanout id=fanout></TD>
<TD>The maximum number of nodes the command should be run on concurrently. When the command finishes on 1 of the nodes, it will be started on an additional node (the default is 64).</TD>
</TR>
<TR class=FormTable>
<TD></TD>
<TD valign="top" nowrap>UserID: <INPUT type="text" name="userID" id="userIDTxtBox"></TD>
<TD valign=top nowrap>UserID: <INPUT type=text name=userID id=userID></TD>
<TD>The user id to use to run the command on the nodes.</TD>
</TR>
<TR class=FormTable>
<TD></TD>
<TD valign="top" nowrap>Remote Shell: <INPUT type="text" name="rshell" id="rshellTxtBox" disabled></TD>
<TD valign=top nowrap>Remote Shell: <INPUT type=text name=rshell id=rshell></TD>
<TD>The remote shell program to use to run the command on the nodes. The default is /usr/bin/ssh.</TD>
</TR>
<TR class=FormTable>
<TD></TD>
<TD valign="top" nowrap>Shell Options: <INPUT type="txt" name="shell_opt" id="shell_optTxtBox" disabled></TD>
<TD valign=top nowrap>Shell Options: <INPUT type=text name=shell_opt id=shell_opt></TD>
<TD>Options to pass to the remote shell being used.</TD>
</TR>
<TR class=FormTable>
<TD></TD>
<TD valign="top" nowrap><INPUT type="checkbox" name="ret_code" id="ret_codeChkBox">Return Code</TD>
<TD valign=top nowrap><INPUT type=checkbox name=ret_code id=ret_code>Return Code</TD>
<TD>Prints the return code of the (last) command that was run remotely on each node. The return code is appended at the end of the output for each node.</TD>
</TR>
<TR><TD colspan="3">
<font class="BlueBack">Tips:</font>
<TR><TD colspan=3>
<font class=BlueBack>Tips:</font>
<UL>
<LI>See the <A href="<?php echo getDocURL('manpage','xdsh.1'); ?>">xdsh man page</A> for more information about this command.</LI>
</UL>
@ -132,27 +131,5 @@ if (!isset($_REQUEST['noderange'])) {
</TABLE>
</FORM>
<div>
<SCRIPT language="JavaScript">
<!--
// in CSM perl script this portion used to be javascript to get
// and set cookies, now php has handled it
//window.onload = function(){window.document.dsh_options.runCmdButton.focus()};
function _setvars(){
var form = window.document.dsh_options;
form.command.value = form.history.value;
}
function checkEmpty(){
var form = window.document.dsh_options;
var cmd = form.command.value;
if (cmd.length == 0)
{
alert('Enter a command before pressing the Run Cmd button.');
return false;
}
else { return true; }
}
-->
</SCRIPT>
</BODY>
</HTML>

View File

@ -30,66 +30,52 @@ if (isset($_COOKIE['history']) && array_search($_REQUEST['command'], $_COOKIE['h
//get the command and the options
$cmd = @$_REQUEST["command"];
$copy = @$_REQUEST["copy"];
$node = @$_REQUEST["node"];
$group = @$_REQUEST["nodegrps"];
$psh = @$_REQUEST["psh"];
$copy = @$_REQUEST["copy_script"];
$psh = @$_REQUEST["run_psh"];
$serial = @$_REQUEST["serial"];
$monitor = @$_REQUEST["monitor"];
$verify = @$_REQUEST["verify"];
$collapse = @$_REQUEST["collapse"];
$fanout = @$_REQUEST["fanout"];
$userID = @$_REQUEST["userID"];
$rshell = @$_REQUEST["rshell"];
$shell_opt = @$_REQUEST["shell_opt"];
$monitor = @$_REQUEST["monitor"];
$ret_code = @$_REQUEST["ret_code"];
// Set the cmd arguments
if (!empty($group)) $noderange = $group;
else $noderange = $node;
if ($serial == "on") $args[] = "-s"; //streaming mode
if ($copy) $args[] = "-e";
if ($serial) $args[] = "-s"; //streaming mode
if ($monitor) $args[] = "-m";
if ($verify) $args[] = "-v";
if (!empty($fanout)) { $args[] = "-f"; $args[] = $fanout; }
if (!empty($userID)) { $args[] = "-l"; $args[] = $userID; }
if ($verify == "on") $args[] = "-v";
if ($monitor == "on") $args[] = "-m";
if ($copy == "on") $args[] = "-e";
if ($ret_code == "on") $args[] = "-z";
if (!empty($rshell)) { $args[] = "-r"; $args[] = $rshell; }
if (!empty($shell_opt)) { $args[] = "-o"; $args[] = $shell_opt; }
//$exp_cmd = "export DSH_CONTEXT=XCAT XCATROOT=/opt/xcat; ";
if ($ret_code) $args[] = "-z";
/*
if ($copy == "on"){ //using dcp/prcp
//extract the script name from the command
$script = strtok($cmd,' ');
//copy the command to the remote node
$source = $script;
$target = "/tmp";
if (empty($psh) || $psh!="on"){
$xml = docmd('xdcp',$noderange,array($source, $target));
//todo: check if copy succeeded
}else{
runcmd("pscp $source $noderange:$target",1,$outp);
}
$cmd = "/tmp/$cmd";
}
*/
if (empty($psh) || $psh!="on") $command = "xdsh";
if (!$psh) $command = "xdsh";
else $command = "psh";
//if ($collapse == "on") $command_string .= " | dshbak -c";
//todo: if ($collapse == "on") $command_string .= " | dshbak -c";
// Run the script
$args[] = $cmd;
echo "<p><b>Command: $command $noderange " . implode(' ',$args) . "</b></p>";
//echo "<p><b>Command Ouput:</b></br></p>"; //output will be returned from the runcmd function call
//$rc = runcmd($command_string,1, $outp); //streaming mode - DOES NOT WORK YET
$xml = docmd($command, $noderange, $args);
echo "<p>Command: &nbsp;<b>$command $noderange " . implode(' ',$args) . "</b></p><p>";
$xml = docmd($command, $noderange, $args); //todo: do streaming output
foreach ($xml->children() as $response) foreach ($response->children() as $line) { echo "$line<br>"; }
echo "</p>\n";

View File

@ -6,6 +6,20 @@ $TOPDIR = '..';
require_once "$TOPDIR/lib/functions.php";
insertHeader('Diagnose', NULL, NULL, array('support','diagnose'));
dumpGlobals();
$xml = docmd("authcheck","",NULL);
echo "<p>authcheck:<br>\n";
foreach ($xml->children() as $response) foreach ($response->children() as $t) { echo (string) $t, "<br>\n"; }
echo "</p>\n";
$xml = docmd('tabdump','',NULL);
echo "<p>tabdump:<br>\n";
foreach ($xml->children() as $response) foreach ($response->children() as $t) { echo (string) $t, "<br>\n"; }
echo "</p>\n";
insertNotDoneYet();
insertFooter();
?>

View File

@ -79,8 +79,8 @@ then
#fi
# Authorize the apacheuser to xcatd
echo -e "y\ny\ny" | %{prefix}/share/xcat/scripts/setup-local-client.sh $apacheuser
XCATROOT=%{prefix} %{prefix}/sbin/chtab priority=5 policy.name=$apacheuser policy.rule=allow
#echo -e "y\ny\ny" | %{prefix}/share/xcat/scripts/setup-local-client.sh $apacheuser
#XCATROOT=%{prefix} %{prefix}/sbin/chtab priority=5 policy.name=$apacheuser policy.rule=allow
fi