diff --git a/xCAT-web/.htpasswd b/xCAT-web/.htpasswd
deleted file mode 100644
index 64f3fa432..000000000
--- a/xCAT-web/.htpasswd
+++ /dev/null
@@ -1 +0,0 @@
-root:FY0Bc7abHEm5w
diff --git a/xCAT-web/.project b/xCAT-web/.project
deleted file mode 100644
index a0cbb5ccb..000000000
--- a/xCAT-web/.project
+++ /dev/null
@@ -1,17 +0,0 @@
-
-
- xCAT-web
-
-
-
-
-
- net.sourceforge.phpeclipse.parserbuilder
-
-
-
-
-
- net.sourceforge.phpeclipse.phpnature
-
-
diff --git a/xCAT-web/config/change.php b/xCAT-web/config/change.php
new file mode 100644
index 000000000..beff421fa
--- /dev/null
+++ b/xCAT-web/config/change.php
@@ -0,0 +1,39 @@
+";
+
+ # Get an easier alias for the table array
+ $editable = & $_SESSION["editable-$tab"];
+
+ # Modify the array with the new value from the editable widget
+ //$oldValue = $editable[$theLine][$theField];
+ $editable[$theLine][$theField] = $value;
+ //$s = 's=' . $editable[$theLine][$theField] . '.';
+
+ // This value goes back to the javascript editable object in the browser
+ echo "$value";
+}
+?>
diff --git a/xCAT-web/config/db.css b/xCAT-web/config/db.css
new file mode 100644
index 000000000..1ae34f199
--- /dev/null
+++ b/xCAT-web/config/db.css
@@ -0,0 +1,104 @@
+
+/* Styles specific to the db.php page */
+
+#tableNames {
+ position: relative; /* so the h3 inside can be absolute to this div */
+ border: 1px solid black;
+ text-align: left;
+ padding: 12px 5px 10px 5px;
+ margin-top: 10px;
+ margin-bottom: 10px;
+}
+
+#tableNames H3 {
+ position: absolute;
+ top: -25px;
+ left: 15px;
+ background-color: white;
+ padding: 0px 5px;
+}
+
+#tableNames A {
+ font-size: 9pt;
+ margin-left: 0.6em;
+ margin-right: 0.6em;
+}
+
+#helpLinks A {
+ margin-left: 0.4em;
+ margin-right: 0.4em;
+}
+
+
+.middlepane {
+ /* float: left; */
+ padding: 5px;
+ margin: 10px;
+ min-width: 600px;
+}
+
+/*
+.bottompane {
+ float: left;
+ padding: 5px;
+ margin: 10px;
+ min-width: 600px;
+ border-top: 1px dotted #555;
+}
+*/
+
+
+
+.colHeaders {
+ font-weight: bold;
+ text-align: center;
+}
+
+/* the alternating rows of the table */
+.ListLine0 { background: #e0f8f8; }
+.ListLine1 { background: #b0f8f8; }
+
+.Xcell { /* the table cell that contains the red x */
+ background-color: white;
+ vertical-align: middle;
+}
+
+.Ximg { padding-right: 15px; }
+.Ximg2 { padding-right: 15px; }
+
+.edit {
+ background: #8f8f0b;
+}
+
+a.gbutton {
+ background: transparent url('../images/bg_button_a.gif') no-repeat scroll top right;
+ color: #444;
+ display: inline-block;
+ /* float: left; */
+ font: normal 12px arial, sans-serif;
+ height: 24px;
+ margin-right: 6px;
+ padding-right: 18px; /* sliding doors padding */
+ text-decoration: none;
+}
+
+a.gbutton span {
+ background: transparent url('../images/bg_button_span.gif') no-repeat;
+ display: inline-block;
+ line-height: 14px;
+ padding: 5px 0 5px 18px;
+ cursor: pointer;
+}
+
+
+a.gbutton:active {
+ background-position: bottom right;
+ color: #000;
+ outline: none; /* hide dotted outline in Firefox */
+}
+
+a.gbutton:active span {
+ background-position: bottom left;
+ padding: 6px 0 4px 18px; /* push text down 1px */
+ cursor: pointer;
+}
diff --git a/xCAT-web/config/db.js b/xCAT-web/config/db.js
new file mode 100644
index 000000000..0db225664
--- /dev/null
+++ b/xCAT-web/config/db.js
@@ -0,0 +1,59 @@
+// Javascript functions needed by the db page.
+
+// Make this class of elements editable
+function makeEditable(table, cellclass, imgclass, linkclass) {
+ // Make all the cells editable
+ //todo: figure out how to make the tab key commit the current cell and edit the next
+ $(cellclass).editable('change.php?tab=' + table, {
+ indicator : "",
+ type : 'text',
+ tooltip : 'Click to edit...',
+ style : 'inherit',
+ cssclass : 'inherit',
+ placeholder : ''
+ // callback : function(value,settings) { alert(dump(settings)); }
+ });
+
+ // Set up rollover and action for red x to delete row
+ $(imgclass).hover(function() { $(this).attr('src','../images/red-x2.gif'); },
+ function() { $(this).attr('src','../images/red-x2-light.gif'); }
+ );
+ $(linkclass).click(function() {
+ var tr = $(this).parent().parent();
+ var rowid = tr.attr('id');
+ var match = rowid.match(/\d+/);
+ $.get('change.php?tab=' + table + '&delrow=' + match[0]);
+ tr.remove();
+ });
+}
+
+
+// Form a table row to add to the table
+function formRow(linenum, numCells, ooe) {
+var newrow = '
| ';
+for (var i=1; i<=numCells; i++) {
+ var val = '';
+ if (i == 1) { val = 'x'; }
+ newrow += '' + val + ' | ';
+}
+newrow += '
';
+return newrow;
+}
+
+
+// Load edittab.php, specifying this table as a param
+function loadTable(table) {
+var url = 'edittab.php?tab=' + table;
+$('#middlepane').load(url);
+}
+
+
+// Associate a click event with each table link to get its url (which is
+// the table name) and load edittab.php with that table name.
+function bindTableLinks() {
+$('#tableNames A').click(function(e) {
+ var tableName = this.hash.substr(1); // strip off the leading # in the hash string
+ loadTable(tableName);
+ return false;
+ });
+}
\ No newline at end of file
diff --git a/xCAT-web/config/db.php b/xCAT-web/config/db.php
new file mode 100644
index 000000000..8534b0274
--- /dev/null
+++ b/xCAT-web/config/db.php
@@ -0,0 +1,47 @@
+\n";
+
+// Display all the table links
+echo "Tables
\n";
+$tables = getTabNames();
+foreach ($tables as $t) {
+ //if ($i++ > 7) { echo "\n
"; $i = 1; }
+ echo "$t ";
+}
+echo "\n\n";
+
+if(isset($_REQUEST['tab'])) { $tab = $_REQUEST['tab']; }
+else { $tab = "nodelist"; }
+$p = "edittab.php?tab=$tab";
+
+echo "Loading $tab ...
\n";
+//echo "\n";
+echo "\n";
+
+
+insertFooter();
+
+
+//-----------------------------------------------------------------------------
+// Return the list of database table names
+function getTabNames() {
+ $xml = docmd('tabdump','',NULL);
+ $tabs = array();
+ foreach ($xml->children() as $response) foreach ($response->children() as $t) { $tabs[] = (string) $t; }
+ return $tabs;
+}
+
+?>
diff --git a/xCAT-web/config/edittab.php b/xCAT-web/config/edittab.php
new file mode 100644
index 000000000..5b6c80319
--- /dev/null
+++ b/xCAT-web/config/edittab.php
@@ -0,0 +1,154 @@
+No table name specified. Please specify a table to edit.\n"; exit; }
+
+//echo "" . implode(',',array_keys($_SESSION)) . "
\n";
+//if (array_key_exists("editable-$tab",$_SESSION)) { echo "count=".count($_SESSION["editable-$tab"])."
\n"; }
+
+if(isset($_REQUEST['kill'])) {
+ unset($_SESSION["editable-$tab"]);
+}
+
+if(isset($_REQUEST['save'])) {
+ $rsp = savexCATchanges($tab,$_SESSION["editable-$tab"]);
+ $errors = array();
+ if (getXmlErrors($rsp,$errors)) { echo "Tabrestore failed: ", implode(' ',$errors), "
\n"; }
+ else { echo "Changes have been saved.
\n"; }
+}
+
+// Get table contents
+//$f = splitTableFields2('"node01","node02","5000","off",,'); echo ''; foreach ($f as $k => $v) { echo "$k=$v
"; } echo "
\n";
+echo "$tab Table
";
+echo "\n";
+
+// Display the column names
+$xml = docmd('tabdump','',array($tab));
+$headers = getTabHeaders($xml);
+if(!is_array($headers)){ die("Can't find header line in $tab
"); }
+echo "\n";
+echo "\n"; # close header table
+
+// Save the width of the table for adding a new row when they click that button
+$tableWidth = count($headers);
+
+// Display table contents and remember its contents in a session variable.
+$ooe = 0; // alternates the background of the table
+$item = 0; // the column #
+$line = 0;
+$editable = array();
+foreach ($xml->children() as $response) foreach ($response->children() as $arr){
+ $arr = (string) $arr;
+ if(ereg("^#", $arr)){ // handle the header specially
+ $editable[$line++][$item] = $arr;
+ continue;
+ }
+ $cl = "ListLine$ooe";
+ $values = splitTableFields($arr);
+ // If you change this line, be sure to change the formRow function in db.js
+ echo " | ";
+ foreach($values as $v){
+ //$v = preg_replace('/\"/','', $v);
+ echo "$v | ";
+ $editable[$line][$item++] = $v;
+ }
+ echo "
\n";
+ $line++;
+ $item = 0;
+ $ooe = 1 - $ooe;
+}
+echo "
\n";
+$_SESSION["editable-$tab"] = & $editable; // save the array so we can access it in the next call of this file or change.php
+//unset($_SESSION["editable-$tab"]);
+
+echo "Add Row\n";
+echo "Save\n";
+echo "Cancel
\n";
+?>
+
+
+
+
+children() as $response) foreach ($response->children() as $line) {
+ $line = (string) $line;
+ if (ereg("^#", $line)) {
+ $line = preg_replace('/^#/','', $line);
+ $headers = explode(',', $line);
+ return $headers;
+ }
+ }
+ // If we get here, we never found the header line
+ return NULL;
+}
+
+
+//-----------------------------------------------------------------------------
+function savexCATchanges($tab, & $editable){
+ $request = simplexml_load_string('');
+ $request->addChild('command','tabrestore');
+ foreach($editable as $line){
+ foreach ($line as &$f) { if (!empty($f) && !preg_match('/^".*"$/', $f)) { $f = '"'.$f.'"'; } }
+ $linestr = implode(",",$line);
+ $linestr = str_replace('"', '"',$linestr); //todo: should we use the htmlentities function?
+ $linestr = str_replace("'", ''',$linestr);
+ //echo "addChild:$linestr.
\n";
+ $request->addChild('data', $linestr);
+ }
+ $request->addChild('table',$tab);
+ $resp = submit_request($request, 0);
+ return $resp;
+}
+
+
+//-----------------------------------------------------------------------------
+function getTabDescription($tab) {
+ $xml = docmd('tabdump','',array('-d'));
+ foreach ($xml->children() as $response) foreach ($response->children() as $line) {
+ $line = (string) $line;
+ if (ereg("^$tab:",$line)) {
+ $line = preg_replace("/^$tab:\s*/", '', $line);
+ return $line;
+ }
+ }
+ return '';
+}
+
+?>
\ No newline at end of file
diff --git a/xCAT-web/config/site.php b/xCAT-web/config/site.php
deleted file mode 100644
index 838cec91e..000000000
--- a/xCAT-web/config/site.php
+++ /dev/null
@@ -1,11 +0,0 @@
-