git-svn-id: svn://svn.cccv.de/engel-system@258 29ba0400-6e00-0410-a75a-ca02368028f8
This commit is contained in:
cookie 2007-12-28 13:03:24 +00:00
parent 890d7115ac
commit adacd8b1cc
1 changed files with 107 additions and 0 deletions

View File

@ -45,13 +45,30 @@ echo "\n\n<br>\n<h1>XML File:</h1>\n";
if( isset($_POST["PentabarfUser"]) && isset($_POST["password"]) && isset($_POST["PentabarfURL"])) if( isset($_POST["PentabarfUser"]) && isset($_POST["password"]) && isset($_POST["PentabarfURL"]))
{ {
echo "Update XCAL-File from Pentabarf.."; echo "Update XCAL-File from Pentabarf..";
<<<<<<< .mine
if($PentabarfGetWith=="fsockopen") if($PentabarfGetWith=="fsockopen")
{ {
<<<<<<< .mine
//backup error messeges and delate //backup error messeges and delate
$Backuperror_messages = $error_messages; $Backuperror_messages = $error_messages;
$fp = fsockopen( "ssl://$PentabarfXMLhost", 443, $errno, $errstr, 30); $fp = fsockopen( "ssl://$PentabarfXMLhost", 443, $errno, $errstr, 30);
=======
if($PentabarfGetWith=="fsockopen")
{
//backup error messeges and delate
$Backuperror_messages = $error_messages;
$fp = fsockopen( "ssl://$PentabarfXMLhost", 443, $errno, $errstr, 30);
=======
//backup error messeges and delate
$Backuperror_messages = $error_messages;
$fp = fsockopen( "ssl://$PentabarfXMLhost", 443, $errno, $errstr, 30);
>>>>>>> .r257
>>>>>>> .r256
// $error_messages = $Backuperror_messages; // $error_messages = $Backuperror_messages;
<<<<<<< .mine
<<<<<<< .mine
if( !$fp) if( !$fp)
{ {
@ -61,7 +78,39 @@ if( isset($_POST["PentabarfUser"]) && isset($_POST["password"]) && isset($_POST[
else else
{ {
if( ($fileOut = fopen( "$Tempdir/engelXML", "w")) != FALSE) if( ($fileOut = fopen( "$Tempdir/engelXML", "w")) != FALSE)
=======
if( !$fp)
=======
if( !$fp)
{ {
echo "<h2>fail: File 'https://$PentabarfXMLhost/$PentabarfXMLpath". $_POST["PentabarfURL"]. "' not readable!".
"[$errstr ($errno)]</h2>";
}
else
{
if( ($fileOut = fopen( "$Tempdir/engelXML", "w")) != FALSE)
>>>>>>> .r257
>>>>>>> .r256
{
<<<<<<< .mine
<<<<<<< .mine
$head = 'GET /'. $PentabarfXMLpath. $_POST["PentabarfURL"]. ' HTTP/1.1'."\r\n".
'Host: '. $PentabarfXMLhost. "\r\n".
'User-Agent: Engelsystem'. "\r\n".
'Authorization: Basic '.
base64_encode($_POST["PentabarfUser"]. ':'. $_POST["password"])."\r\n".
"\r\n";
fputs( $fp, $head);
$Zeilen = -1;
while (!feof($fp))
{
$Temp= fgets($fp,1024);
=======
echo "<h2>fail: File 'https://$PentabarfXMLhost/$PentabarfXMLpath". $_POST["PentabarfURL"]. "' not readable!".
"[$errstr ($errno)]</h2>";
=======
$head = 'GET /'. $PentabarfXMLpath. $_POST["PentabarfURL"]. ' HTTP/1.1'."\r\n". $head = 'GET /'. $PentabarfXMLpath. $_POST["PentabarfURL"]. ' HTTP/1.1'."\r\n".
'Host: '. $PentabarfXMLhost. "\r\n". 'Host: '. $PentabarfXMLhost. "\r\n".
'User-Agent: Engelsystem'. "\r\n". 'User-Agent: Engelsystem'. "\r\n".
@ -102,6 +151,7 @@ if( isset($_POST["PentabarfUser"]) && isset($_POST["password"]) && isset($_POST[
fclose( $fileOut); fclose( $fileOut);
echo "<br>Es wurden $Zeilen Zeilen eingelesen<br>"; echo "<br>Es wurden $Zeilen Zeilen eingelesen<br>";
>>>>>>> .r257
} }
else else
echo "<h2>fail: File '$Tempdir/engelXML' not writeable!</h2>"; echo "<h2>fail: File '$Tempdir/engelXML' not writeable!</h2>";
@ -115,6 +165,63 @@ if( isset($_POST["PentabarfUser"]) && isset($_POST["password"]) && isset($_POST[
$PentabarfXMLhost. "/". $PentabarfXMLpath. $_POST["PentabarfURL"]; $PentabarfXMLhost. "/". $PentabarfXMLpath. $_POST["PentabarfURL"];
if( ($fileIn = fopen( $FileNameIn, "r")) != FALSE)
{
if( ($fileOut = fopen( "$Tempdir/engelXML", "w")) != FALSE)
{
$Zeilen = 0;
while (!feof($fileIn))
{
$Zeilen++;
fputs( $fileOut, fgets( $fileIn));
}
fclose( $fileOut);
<<<<<<< .mine
>>>>>>> .r256
=======
>>>>>>> .r257
echo "<br>Es wurden $Zeilen Zeilen eingelesen<br>";
}
else
echo "<h2>fail: File '$Tempdir/engelXML' not writeable!</h2>";
fclose( $fileIn);
}
else
echo "<h2>fail: File 'https://$PentabarfXMLhost/$PentabarfXMLpath". $_POST["PentabarfURL"]. "' not readable!</h2>";
}
elseif( $PentabarfGetWith=="wget")
{
$Command = "wget --http-user=". $_POST["PentabarfUser"]. " --http-passwd=".$_POST["password"]. " ".
"https://$PentabarfXMLhost/$PentabarfXMLpath". $_POST["PentabarfURL"].
" --output-file=$Tempdir/engelXMLwgetLog --output-document=$Tempdir/engelXML".
" --no-check-certificate";
echo system( $Command, $Status);
if( $Status==0)
echo "OK.<br>";
else
echo "fail ($Status)($Command).<br>";
}
elseif( $PentabarfGetWith=="lynx")
{
$Command = "lynx -auth=". $_POST["PentabarfUser"]. ":".$_POST["password"]. " -dump ".
"https://$PentabarfXMLhost/$PentabarfXMLpath". $_POST["PentabarfURL"]. " > $Tempdir/engelXML";
echo system( $Command, $Status);
if( $Status==0)
echo "OK.<br>";
else
echo "fail ($Status)($Command).<br>";
}
else
echo "<h1>The PentabarfGetWith='$PentabarfGetWith' not supported</h1>";
}
elseif($PentabarfGetWith=="fopen")
{
//user uns password in url einbauen
$FileNameIn = "https://". $_POST["PentabarfUser"]. ':'. $_POST["password"]. "@".
$PentabarfXMLhost. "/". $PentabarfXMLpath. $_POST["PentabarfURL"];
if( ($fileIn = fopen( $FileNameIn, "r")) != FALSE) if( ($fileIn = fopen( $FileNameIn, "r")) != FALSE)
{ {
if( ($fileOut = fopen( "$Tempdir/engelXML", "w")) != FALSE) if( ($fileOut = fopen( "$Tempdir/engelXML", "w")) != FALSE)