init web ems all
This commit is contained in:
127
wxc2_omc/configuration/fileTransConf/fileTransferConfiguration.php
Executable file
127
wxc2_omc/configuration/fileTransConf/fileTransferConfiguration.php
Executable file
@@ -0,0 +1,127 @@
|
||||
<?php
|
||||
require("../../inc/header.inc");
|
||||
?>
|
||||
|
||||
<style type="text/css">
|
||||
<!--
|
||||
.style {font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 8pt;background: url(--.gif); border: 0px; height: 16px;}
|
||||
-->
|
||||
</style>
|
||||
|
||||
<script language="JavaScript">
|
||||
function openSet(instanceNo,showIndex,operation)
|
||||
{
|
||||
URL="./operation.php?instanceNo="+instanceNo+"&showIndex="+showIndex+"&operation="+operation;
|
||||
//var setWindow = open(URL, 'newWin', 'toolbar=no,directories=no,menubar=no,scrollbars=yes,resizable=yes,status=yes,width=400,height=350');
|
||||
//setWindow.focus();
|
||||
window.location.href=URL;
|
||||
}
|
||||
|
||||
</script>
|
||||
<body onload="javascript:adjust();" onresize="javascript:adjust();" leftmargin="15" style="overflow:hidden;overflow-x:hidden;overflow-y:hidden;">
|
||||
|
||||
<?php
|
||||
adjust_head();
|
||||
adjust_title_head();
|
||||
echo "<FORM NAME=\"downForm\">";
|
||||
echo "<table id=\"table_up\" border=\"0\" width=\"100%\">";
|
||||
echo "<tr>";
|
||||
echo "<td width=\"50%\">";
|
||||
echo "Template > File Transfer";
|
||||
echo "</td>";
|
||||
echo "<td width=\"50%\" align=\"right\" title=\"Help\">";
|
||||
//showHelp($helpId);
|
||||
echo "</td>";
|
||||
echo "</tr>";
|
||||
echo "</table>";
|
||||
adjust_title_tail();
|
||||
adjust_content_head();
|
||||
echo "<br>";
|
||||
|
||||
?>
|
||||
|
||||
<?php
|
||||
$DEBUG=0;
|
||||
//delete one file transfer object
|
||||
if($delete==1)
|
||||
{
|
||||
|
||||
if($DEBUG)echo "instanceNo=$instanceNo<br>";
|
||||
|
||||
//delete from the wsmsServConf
|
||||
$pubDb="OMC_PUB";
|
||||
$delSql = "DELETE FROM fileTransConf WHERE instanceNo='$instanceNo' ";
|
||||
if($DEBUG) echo "<br>delSql=$delSql";
|
||||
$delRes = @mysqli_query($pubConn,$delSql);
|
||||
echo mysqli_error($pubConn);
|
||||
|
||||
echo "<font color=blue>Delete successfully!</font><br>";
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
//Get the hpmn server info from database
|
||||
$database="OMC_PUB";
|
||||
$selSql = "SELECT * FROM fileTransConf where srcDir IS NOT NULL and dstDir IS NOT NULL AND dstIP IS NOT NULL AND filter IS NOT NULL AND logName IS NOT NULL AND logPass IS NOT NULL ";
|
||||
$selRes = @mysqli_query($pubConn,$selSql);
|
||||
$FileTransObjCount=mysqli_num_rows($selRes);
|
||||
echo mysqli_error($pubConn);
|
||||
//echo "FileTransObjCount:$FileTransObjCount<br>";
|
||||
|
||||
$typeLabel=array(0=>"FTP",1=>"SFTP");
|
||||
|
||||
$FileTransObjIndex=0;
|
||||
while($selRow = @mysqli_fetch_array($selRes))
|
||||
{
|
||||
$FileTransObjInstanceNo[$FileTransObjIndex]=$selRow[instanceNo];
|
||||
$FileTransObjType[$FileTransObjIndex]=$selRow[type]+0;
|
||||
$FileTransObjSrcDir[$FileTransObjIndex]=$selRow[srcDir];
|
||||
$FileTransObjDstDir[$FileTransObjIndex]=$selRow[dstDir];
|
||||
$FileTransObjDstIP[$FileTransObjIndex]=$selRow[dstIP];
|
||||
$FileTransObjFilter[$FileTransObjIndex]=$selRow[filter];
|
||||
$FileTransObjLogName[$FileTransObjIndex]=$selRow[logName];
|
||||
$FileTransObjLogPass[$FileTransObjIndex]=$selRow[logPass];
|
||||
if(0)
|
||||
{
|
||||
echo "{$FileTransObjInstanceNo[$FileTransObjIndex]} {$typeLabel[$FileTransObjType[$FileTransObjIndex]]} {$FileTransObjSrcDir[$FileTransObjIndex]} {$FileTransObjDstDir[$FileTransObjIndex]} {$FileTransObjDstIP[$FileTransObjIndex]} {$FileTransObjFilter[$FileTransObjIndex]} {$FileTransObjLogName[$FileTransObjIndex]} {$FileTransObjLogPass[$FileTransObjIndex]}<br>";
|
||||
}
|
||||
$FileTransObjIndex++;
|
||||
}
|
||||
|
||||
echo "<p><table border=\"1\" width=\"100%\" cellpadding=\"1\" cellspacing=\"0\" bordercolor=\"#666666\" bordercolordark=\"#FFFFFF\">";
|
||||
echo "<tr bgcolor=\"#E6E6E6\">";
|
||||
echo "<td width=\"5%\" align=center>No.</td>";
|
||||
echo "<td width=\"5%\" align=center>Type</td>";
|
||||
echo "<td width=\"4%\" align=center>Filter</td>";
|
||||
echo "<td width=\"4%\" align=center><nobr>Login Name</td>";
|
||||
echo "<td width=\"4%\" align=center><nobr>Login PW</td>";
|
||||
echo "<td width=\"14%\" align=center>Destination IP</td>";
|
||||
echo "<td width=\"30%\" align=center>Source Directory</td>";
|
||||
echo "<td width=\"30%\" align=center>Destination Directory</td>";
|
||||
echo "<td width=\"2%\" align=center>Delete</td>";
|
||||
echo "</tr>";
|
||||
|
||||
for($i=0;$i<$FileTransObjCount;$i++)
|
||||
{
|
||||
echo "<tr>";
|
||||
$showIndex=$i+1;
|
||||
echo "<td align=center><a href=# onClick=\"javascript:openSet('{$FileTransObjInstanceNo[$i]}','$showIndex','edit')\">$showIndex</a></td>";
|
||||
echo "<td>{$typeLabel[$FileTransObjType[$i]]}</td>";
|
||||
echo "<td>{$FileTransObjFilter[$i]}</td>";
|
||||
echo "<td>{$FileTransObjLogName[$i]}</td>";
|
||||
echo "<td>{$FileTransObjLogPass[$i]}</td>";
|
||||
echo "<td>{$FileTransObjDstIP[$i]}</td>";
|
||||
echo "<td>{$FileTransObjSrcDir[$i]}</td>";
|
||||
echo "<td>{$FileTransObjDstDir[$i]}</td>";
|
||||
|
||||
echo "<td><a href=\"./fileTransferConfiguration.php?instanceNo={$FileTransObjInstanceNo[$i]}&delete=1\">Delete</a></td>";
|
||||
echo "</tr>";
|
||||
}
|
||||
$ti=$FileTransObjCount+1;
|
||||
echo "<tr><td><a href=# onClick=\"javascript:openSet('','$ti','new')\">New</a></td><td>--</td><td>--</td><td>--</td><td>--</td><td>--</td><td>--</td><td>--</td><td>--</td>";
|
||||
|
||||
echo "</table>";
|
||||
adjust_content_tail();
|
||||
?>
|
||||
276
wxc2_omc/configuration/fileTransConf/operation.php
Executable file
276
wxc2_omc/configuration/fileTransConf/operation.php
Executable file
@@ -0,0 +1,276 @@
|
||||
<?php
|
||||
require("../../inc/header.inc");
|
||||
?>
|
||||
<body onload="javascript:adjust();" onresize="javascript:adjust();" leftmargin="15" style="overflow:hidden;overflow-x:hidden;overflow-y:hidden;">
|
||||
|
||||
<script language="JavaScript">
|
||||
function saveObj(operation)
|
||||
{
|
||||
//var no=document.myform.no_text.value;
|
||||
var typ=document.myform.type_text.value;
|
||||
var filter=document.myform.filter_text.value;
|
||||
var logName=document.myform.logName_text.value;
|
||||
var logPass=document.myform.logPass_text.value;
|
||||
var srcDir=document.myform.srcDir_text.value;
|
||||
var dstDir=document.myform.dstDir_text.value;
|
||||
var dstIP=document.myform.dstIP_text.value;
|
||||
|
||||
if(filter.length == 0 || logName.length == 0 || logPass.length == 0
|
||||
|| srcDir.length == 0 || dstDir.length == 0 || dstIP.length == 0)
|
||||
{
|
||||
alert("Please input the intact value!");
|
||||
return;
|
||||
}
|
||||
if(operation == 0)
|
||||
{
|
||||
window.location.href="./operation.php?save_new_obj=1&type="+typ+"&filter="+filter+"&logName="+logName+"&logPass="+logPass+"&srcDir="+srcDir+"&dstDir="+dstDir+"&dstIP="+dstIP;
|
||||
}
|
||||
else
|
||||
{
|
||||
var instance=document.myform.instanceNo_text.value;
|
||||
window.location.href="./operation.php?save_old_obj=1&instance="+instance+"&type="+typ+"&filter="+filter+"&logName="+logName+"&logPass="+logPass+"&srcDir="+srcDir+"&dstDir="+dstDir+"&dstIP="+dstIP;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function closeWindow()
|
||||
{
|
||||
//window.close();
|
||||
//window.opener.location.href="./fileTransferConfiguration.php";
|
||||
//window.opener.location.href="./fileTransferConfiguration.php";
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
<?php
|
||||
adjust_head();
|
||||
adjust_title_head();
|
||||
//echo "<FORM NAME=\"downForm\">";
|
||||
echo "<table id=\"table_up\" border=\"0\" width=\"100%\">";
|
||||
echo "<tr>";
|
||||
echo "<td width=\"50%\">";
|
||||
echo "Template > File Transfer";
|
||||
echo "</td>";
|
||||
echo "<td width=\"50%\" align=\"right\" title=\"Help\">";
|
||||
//showHelp($helpId);
|
||||
echo "</td>";
|
||||
echo "</tr>";
|
||||
echo "</table>";
|
||||
adjust_title_tail();
|
||||
adjust_content_head();
|
||||
echo "<br>";
|
||||
$DEBUG=0;
|
||||
//debug_log("/tmp/sysCommand.txt","save file transfer object,save_new_obj=$save_new_obj\n");
|
||||
|
||||
if($save_new_obj == 1)
|
||||
{
|
||||
//get the new instanceNo
|
||||
$database="OMC_PUB";
|
||||
$selSql = "SELECT max(instanceNo) as maxInstanceNo FROM fileTransConf ";
|
||||
$selRes = @mysqli_query($pubConn,$selSql);
|
||||
$count=mysqli_num_rows($selRes);
|
||||
if($count == 1)
|
||||
{
|
||||
$selRow = @mysqli_fetch_array($selRes);
|
||||
$maxInstanceNo=$selRow[maxInstanceNo];
|
||||
//echo "maxInstanceNo=$maxInstanceNo<br>";
|
||||
}
|
||||
//insert the new record
|
||||
$newInstaceNo=$maxInstanceNo+1;
|
||||
$saveSql="INSERT INTO fileTransConf values('$newInstaceNo','$type','$srcDir','$dstDir','$dstIP','$filter','$logName','$logPass')";
|
||||
debug_log("/tmp/sysCommand.txt",$saveSql);
|
||||
mysqli_query($pubConn,$saveSql);
|
||||
echo mysqli_error($pubConn);
|
||||
|
||||
echo "\n<script language=\"JavaScript\">\n";
|
||||
echo "window.location.href=\"./fileTransferConfiguration.php\";\n";
|
||||
echo "</script>\n";
|
||||
|
||||
}
|
||||
if($save_old_obj == 1)
|
||||
{
|
||||
//update the old file transfer object
|
||||
$pubDb="OMC_PUB";
|
||||
|
||||
$saveSql="UPDATE fileTransConf SET type=$type,srcDir='$srcDir',dstDir='$dstDir',dstIP='$dstIP',filter='$filter',logName='$logName',logPass='$logPass' where instanceNo=$instance ";
|
||||
//echo "saveSql=$saveSql<br>";
|
||||
mysqli_query($pubConn,$saveSql);
|
||||
echo mysqli_error($pubConn);
|
||||
|
||||
echo "\n<script language=\"JavaScript\">\n";
|
||||
echo "window.location.href=\"./fileTransferConfiguration.php\";\n";
|
||||
echo "</script>\n";
|
||||
}
|
||||
|
||||
|
||||
$typeLabel=array(0=>"FTP",1=>"SFTP");
|
||||
echo "<form name=\"myform\" action=\"./operation.php\">";
|
||||
if($DEBUG) echo "instanceNo=$instanceNo,showIndex=$showIndex,operation=$operation<br>";
|
||||
//Add a new file transfer object
|
||||
if($operation=="new")
|
||||
{
|
||||
|
||||
echo "<p><table border=\"1\" width=\"100%\" cellpadding=\"1\" cellspacing=\"0\" bordercolor=\"#666666\" bordercolordark=\"#FFFFFF\">";
|
||||
echo "<tr bgcolor=\"#E6E6E6\">";
|
||||
echo "<td width=\"50%\">Name</td><td width=\"50%\">Value</td>";
|
||||
echo "</tr>";
|
||||
|
||||
//No.
|
||||
echo "<tr>";
|
||||
echo "<td>No.</td>";
|
||||
echo "<td>$showIndex</td>";
|
||||
echo "<input type=\"hidden\" name=\"no_text\" value=$HpmnMcc>";
|
||||
echo "</tr>";
|
||||
|
||||
//Type
|
||||
echo "<tr>";
|
||||
echo "<td>Type</td>";
|
||||
$type=0;
|
||||
echo "<td><select name=\"type_text\">";
|
||||
for($i=0;$i< sizeof($typeLabel);$i++)
|
||||
{
|
||||
if($i==$type)
|
||||
echo "<option value=\"$i\" selected>{$typeLabel[$i]}</option>";
|
||||
else
|
||||
echo "<option value=\"$i\">{$typeLabel[$i]}</option>";
|
||||
}
|
||||
echo "</td>";
|
||||
echo "</tr>";
|
||||
|
||||
//Filter
|
||||
echo "<tr>";
|
||||
echo "<td>Filter</td>";
|
||||
echo "<td><input type=\"text\" name=\"filter_text\" value=\"txt\" class=\"text\"></td>";
|
||||
echo "</tr>";
|
||||
|
||||
//Login Name
|
||||
echo "<tr>";
|
||||
echo "<td>Login Name</td>";
|
||||
echo "<td><input type=\"text\" name=\"logName_text\" value=\"\" class=\"text\"></td>";
|
||||
echo "</tr>";
|
||||
|
||||
//Login Pass
|
||||
echo "<tr>";
|
||||
echo "<td>Login PW</td>";
|
||||
echo "<td><input type=\"text\" name=\"logPass_text\" value=\"\" class=\"text\"></td>";
|
||||
echo "</tr>";
|
||||
|
||||
//Destination IP
|
||||
echo "<tr>";
|
||||
echo "<td>Destination IP</td>";
|
||||
echo "<td><input type=\"text\" name=\"dstIP_text\" value=\"\" class=\"text\"></td>";
|
||||
echo "</tr>";
|
||||
|
||||
|
||||
//Source Directory
|
||||
echo "<tr>";
|
||||
echo "<td>Source Directory</td>";
|
||||
echo "<td><input type=\"text\" name=\"srcDir_text\" value=\"\" class=\"text\" size=32 maxlength=256></td>";
|
||||
echo "</tr>";
|
||||
|
||||
//Destination Directory
|
||||
echo "<tr>";
|
||||
echo "<td>Destination Directory</td>";
|
||||
echo "<td><input type=\"text\" name=\"dstDir_text\" value=\"\" class=\"text\" size=32 maxlength=256></td>";
|
||||
echo "</tr>";
|
||||
|
||||
echo "</table>";
|
||||
|
||||
//save button
|
||||
echo "<input type=button onClick=\"javascript:saveObj(0);javascript:closeWindow();\" value=\"Save\" class=\"button\">";
|
||||
|
||||
}
|
||||
else if($operation=="edit")
|
||||
{
|
||||
//Get the hpmn server info from database
|
||||
$database="OMC_PUB";
|
||||
$selSql = "SELECT instanceNo,type,srcDir,dstDir,dstIP,filter,logName,logPass FROM fileTransConf where instanceNo='$instanceNo' ";
|
||||
$selRes = @mysqli_query($pubConn,$selSql);
|
||||
echo mysqli_error($pubConn);
|
||||
|
||||
|
||||
$selRow = @mysqli_fetch_array($selRes);
|
||||
$fileTransObjInstanceNo=$selRow[instanceNo];
|
||||
$fileTransObjType=$selRow[type]+0;
|
||||
$fileTransObjSrcDir=$selRow[srcDir];
|
||||
$fileTransObjDstDir=$selRow[dstDir];
|
||||
$fileTransObjDstIP=$selRow[dstIP];
|
||||
$fileTransObjFilter=$selRow[filter];
|
||||
$fileTransObjLogName=$selRow[logName];
|
||||
$fileTransObjLogPass=$selRow[logPass];
|
||||
|
||||
|
||||
|
||||
echo "<p><table border=\"1\" width=\"100%\" cellpadding=\"1\" cellspacing=\"0\" bordercolor=\"#666666\" bordercolordark=\"#FFFFFF\">";
|
||||
echo "<tr bgcolor=\"#E6E6E6\">";
|
||||
echo "<td width=\"50%\">Name</td><td width=\"50%\">Value</td>";
|
||||
echo "</tr>";
|
||||
|
||||
//No
|
||||
echo "<tr>";
|
||||
echo "<td>No.</td><td>$showIndex</td>";
|
||||
echo "<input type=\"hidden\" name=\"no_text\" value=$showIndex>";
|
||||
echo "<input type=\"hidden\" name=\"instanceNo_text\" value=$fileTransObjInstanceNo>";
|
||||
echo "</tr>";
|
||||
|
||||
//Type
|
||||
echo "<tr>";
|
||||
echo "<td>Type</td>";
|
||||
echo "<td><select name=\"type_text\">";
|
||||
for($i=0;$i< sizeof($typeLabel);$i++)
|
||||
{
|
||||
if($i==$fileTransObjType)
|
||||
echo "<option value=\"$i\" selected>{$typeLabel[$i]}</option>";
|
||||
else
|
||||
echo "<option value=\"$i\">{$typeLabel[$i]}</option>";
|
||||
}
|
||||
echo "</td>";
|
||||
echo "</tr>";
|
||||
|
||||
|
||||
//Filter
|
||||
echo "<tr>";
|
||||
echo "<td>Filter</td>";
|
||||
echo "<td><input type=\"text\" name=\"filter_text\" value=\"$fileTransObjFilter\" class=\"text\"></td>";
|
||||
echo "</tr>";
|
||||
|
||||
//Login Name
|
||||
echo "<tr>";
|
||||
echo "<td>Login Name</td>";
|
||||
echo "<td><input type=\"text\" name=\"logName_text\" value=\"$fileTransObjLogName\" class=\"text\"></td>";
|
||||
echo "</tr>";
|
||||
|
||||
//Login Pass
|
||||
echo "<tr>";
|
||||
echo "<td>Login PW</td>";
|
||||
echo "<td><input type=\"text\" name=\"logPass_text\" value=\"$fileTransObjLogPass\" class=\"text\"></td>";
|
||||
echo "</tr>";
|
||||
|
||||
//Destination IP
|
||||
echo "<tr>";
|
||||
echo "<td>Destination IP</td>";
|
||||
echo "<td><input type=\"text\" name=\"dstIP_text\" value=\"$fileTransObjDstIP\" class=\"text\"></td>";
|
||||
echo "</tr>";
|
||||
|
||||
|
||||
//Source Directory
|
||||
echo "<tr>";
|
||||
echo "<td>Source Directory</td>";
|
||||
echo "<td><input type=\"text\" name=\"srcDir_text\" value=\"$fileTransObjSrcDir\" class=\"text\" size=32 maxlength=256></td>";
|
||||
echo "</tr>";
|
||||
|
||||
//Destination Directory
|
||||
echo "<tr>";
|
||||
echo "<td>Destination Directory</td>";
|
||||
echo "<td><input type=\"text\" name=\"dstDir_text\" value=\"$fileTransObjDstDir\" class=\"text\" size=32 maxlength=256></td>";
|
||||
echo "</tr>";
|
||||
|
||||
|
||||
echo "</table>";
|
||||
|
||||
//save button
|
||||
echo "<input type=button onClick=\"javascript:saveObj(1);javascript:closeWindow();\" value=\"Save\" class=\"button\">";
|
||||
|
||||
}
|
||||
adjust_content_tail();
|
||||
?>
|
||||
Reference in New Issue
Block a user