From 6dd3e7e17ec151ea523f5b99cf0bd30dc441b030 Mon Sep 17 00:00:00 2001 From: cookie Date: Thu, 31 Aug 2006 04:40:50 +0000 Subject: pentabarf xcal url jetzt zentral configurierbar daten aus pentabarf werden jetzt mit fopen geholt git-svn-id: svn://svn.cccv.de/engel-system@147 29ba0400-6e00-0410-a75a-ca02368028f8 --- www-ssl/admin/dbUpdateFromXLS.php | 48 ++++++++++++++++++++++++--------------- 1 file changed, 30 insertions(+), 18 deletions(-) (limited to 'www-ssl/admin/dbUpdateFromXLS.php') diff --git a/www-ssl/admin/dbUpdateFromXLS.php b/www-ssl/admin/dbUpdateFromXLS.php index 80cf5419..8afe11b8 100755 --- a/www-ssl/admin/dbUpdateFromXLS.php +++ b/www-ssl/admin/dbUpdateFromXLS.php @@ -43,36 +43,48 @@ CreateRoomArrays(); F I L E ##############################################################################################*/ echo "\n\n
\n

XML File:

\n"; -if( isset($_POST["PentabarfUser"]) && isset($_POST["PentabarfPasswd"]) && isset($_POST["PentabarfURL"])) +if( isset($_POST["PentabarfUser"]) && isset($_POST["password"]) && isset($_POST["PentabarfURL"])) { - echo "Update XML-File from Pentabarf.."; + echo "Update XCAL-File from Pentabarf.."; - if( $DataGetMeth=="wget") - $Command = "wget --http-user=". $_POST["PentabarfUser"]. " --http-passwd=".$_POST["PentabarfPasswd"]. " ". - $_POST["PentabarfURL"]. - " --output-file=$Tempdir/engelXMLwgetLog --output-document=$Tempdir/engelXML". - " --no-check-certificate"; - elseif( $DataGetMeth=="lynx") - $Command = "lynx -auth=". $_POST["PentabarfUser"]. ":".$_POST["PentabarfPasswd"]. " -dump ". - $_POST["PentabarfURL"]. " > $Tempdir/engelXML"; - echo system( $Command, $Status); - - if( $Status==0) - echo "OK.
"; + //user uns password in url einbauen + $StartURL = strpos( $_POST["PentabarfURL"], "://") + 3; + $FileNameIn = substr( $_POST["PentabarfURL"], 0, $StartURL). + $_POST["PentabarfUser"]. ":". + $_POST["password"]. "@". + substr( $_POST["PentabarfURL"], $StartURL); + + 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); + echo "
Es wurden $Zeilen Zeilen eingelesen
"; + } + else + echo "

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

"; + fclose( $fileIn); + } else - echo "fail ($Status)($Command).
"; + echo "

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

"; } else { echo "
\n"; echo "\n"; - echo "\t". + echo "\t". "\n"; + "value=\"$PentabarXCALurl\">\n"; echo "\t". "\n"; echo "\t". - "\n"; + "\n"; echo "\t\n"; echo "
XML-File:
XCAL-File:
Username:
Password:
\n"; echo "
\n"; -- cgit v1.2.3-54-g00ecf