From 6dd3e7e17ec151ea523f5b99cf0bd30dc441b030 Mon Sep 17 00:00:00 2001 From: cookie Date: Thu, 31 Aug 2006 04:40:50 +0000 Subject: [PATCH] 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 --- default-conf/www-ssl/inc/config.php | 13 ++++---- www-ssl/admin/dbUpdateFromXLS.php | 48 ++++++++++++++++++----------- 2 files changed, 36 insertions(+), 25 deletions(-) diff --git a/default-conf/www-ssl/inc/config.php b/default-conf/www-ssl/inc/config.php index cef402f9..21f9c847 100755 --- a/default-conf/www-ssl/inc/config.php +++ b/default-conf/www-ssl/inc/config.php @@ -1,6 +1,6 @@ AF:32:B9:BE:3F:AE:53:78:1E:1B:6E:82:48:E0:DB:94
\n". - "SHA1:
B8:07:E8:A4:F3:1A:EF:03:81:C2:44:0C:50:25:3D:1A:A0:E4:AA:76"; +$show_SSLCERT = "MD5:
FF:FF:FF:FF:FF:FF:FF:FF:FF:FF:FF:FF:FF:FF:FF:FF
\n". + "SHA1:
FF:FF:FF:FF:FF:FF:FF:FF:FF:FF:FF:FF:FF:FF:FF:FF:FF:FF:FF:FF"; //globale const. fuer schischtplan $GlobalZeileProStunde = 4; @@ -34,11 +34,10 @@ $GlobalZeileProStunde = 4; //ist ein modem angeschlossen $ModemEnable = false; -//soll das xcal-file von penterbarf -//$DataGetMeth="wget"; -$DataGetMeth="lynx"; - //Tempdir $Tempdir="/tmp"; +//Pentabarf ConferenzDI für UpdateDB +$PentabarXCALurl="https://pentabarf.cccv.de/xcal/conference/"; + ?> 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";