From 822ae3578d29cb83b1bb0427e8a2ead8706e021a Mon Sep 17 00:00:00 2001 From: cookie Date: Mon, 13 Nov 2006 18:35:25 +0000 Subject: [PATCH] files werden mit fsockopen git-svn-id: svn://svn.cccv.de/engel-system@159 29ba0400-6e00-0410-a75a-ca02368028f8 --- www-ssl/admin/dbUpdateFromXLS.php | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/www-ssl/admin/dbUpdateFromXLS.php b/www-ssl/admin/dbUpdateFromXLS.php index 8afe11b8..24735788 100755 --- a/www-ssl/admin/dbUpdateFromXLS.php +++ b/www-ssl/admin/dbUpdateFromXLS.php @@ -48,37 +48,44 @@ if( isset($_POST["PentabarfUser"]) && isset($_POST["password"]) && isset($_POST[ echo "Update XCAL-File from Pentabarf.."; //user uns password in url einbauen - $StartURL = strpos( $_POST["PentabarfURL"], "://") + 3; - $FileNameIn = substr( $_POST["PentabarfURL"], 0, $StartURL). + $FileNameIn = "https://". $_POST["PentabarfUser"]. ":". $_POST["password"]. "@". - substr( $_POST["PentabarfURL"], $StartURL); - - if( ($fileIn = fopen( $FileNameIn, "r")) != FALSE) + $_POST["PentabarfURL"]; + //backup error messeges and delate + $Backuperror_messages = $error_messages; + $fp = fsockopen( $FileNameIn, 443, $errno, $errstr, 30); + $error_messages = $Backuperror_messages; + + if( !$fp) + { + echo "$errstr ($errno)
\n"; + echo "

fail: File 'https://". $_POST["PentabarfURL"]. "' not readable!

"; + } + else { if( ($fileOut = fopen( "$Tempdir/engelXML", "w")) != FALSE) { + fputs( $fp, "GET / HTTP/1.0\r\n\r\n"); $Zeilen = 0; - while (!feof($fileIn)) + while (!feof($fp)) { $Zeilen++; - fputs( $fileOut, fgets( $fileIn)); + fputs( $fileOut, fgets($fp,128)); } fclose( $fileOut); echo "
Es wurden $Zeilen Zeilen eingelesen
"; } else echo "

fail: File '$Tempdir/engelXML' not writeable!

"; - fclose( $fileIn); + fclose($fp); } - else - echo "

fail: File '". $_POST["PentabarfURL"]. "' not readable!

"; } else { echo "
\n"; echo "\n"; - echo "\t". + echo "\t". "\n"; echo "\t".
XCAL-File:
XCAL-File: https://
Username: