diff --git a/README b/README index cb399a89..6ee1ee5b 100644 --- a/README +++ b/README @@ -14,3 +14,8 @@ Systemconfig: ./www-ssl/inc/db.php einstellungen der DB Achtung: DB user braucht folgende Rechte: SELECT, CREATE, INSERT, ALTER, UPDATE, INDEX, DELETE, DROP + +php.ini: +-------- +add: + allow_url_fopen = On diff --git a/default-conf/www-ssl/inc/config.php b/default-conf/www-ssl/inc/config.php index 21f9c847..ccf359c4 100755 --- a/default-conf/www-ssl/inc/config.php +++ b/default-conf/www-ssl/inc/config.php @@ -38,6 +38,8 @@ $ModemEnable = false; $Tempdir="/tmp"; //Pentabarf ConferenzDI für UpdateDB -$PentabarXCALurl="https://pentabarf.cccv.de/xcal/conference/"; +$PentabarfXMLhost = "pentabarf.cccv.de"; +$PentabarfXMLpath = "Xcal/conference/"; +$PentabarfXMLEventID = "31"; ?> diff --git a/www-ssl/admin/dbUpdateFromXLS.php b/www-ssl/admin/dbUpdateFromXLS.php index ab2794b6..e4ec65eb 100755 --- a/www-ssl/admin/dbUpdateFromXLS.php +++ b/www-ssl/admin/dbUpdateFromXLS.php @@ -47,35 +47,59 @@ if( isset($_POST["PentabarfUser"]) && isset($_POST["password"]) && isset($_POST[ { echo "Update XCAL-File from Pentabarf.."; - //user uns password in url einbauen - $FileNameIn = "pentabarf.cccv.de";/*. - $_POST["PentabarfUser"]. ":". - $_POST["password"]. "@". - $_POST["PentabarfURL"];*/ //backup error messeges and delate $Backuperror_messages = $error_messages; - $fp = fsockopen( $FileNameIn, 443, $errno, $errstr, 30); + $fp = fsockopen( "ssl://$PentabarfXMLhost", 443, $errno, $errstr, 30); $error_messages = $Backuperror_messages; if( !$fp) { - echo "

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

". - "[$errstr ($errno)]
\n"; + echo "

fail: File 'https://$PentabarfXMLhost/$PentabarfXMLpath$PentabarfXMLEventID' not readable!". + "[$errstr ($errno)]

"; } else { -// if( ($fileOut = fopen( "$Tempdir/engelXML", "w")) != FALSE) - if( 1) + if( ($fileOut = fopen( "$Tempdir/engelXML", "w")) != FALSE) { - fputs( $fp, "GET / HTTP/1.0\r\n\r\n"); - $Zeilen = 0; + $head = 'GET /'. $PentabarfXMLpath. $PentabarfXMLEventID. ' 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)) { - $Zeilen++; -// fputs( $fileOut, fgets($fp,128)); - echo fgets($fp,128); + $Temp= fgets($fp,1024); + + // ende des headers + if( $Temp== "f20\r\n" ) + { + $Zeilen = 0; + $Temp=""; + } + + //file ende? + if( $Temp=="0\r\n") + break; + + if( ($Zeilen>-1) && ($Temp!="ffb\r\n") ) + { + //steuerzeichen ausfiltern + if( strpos( "#$Temp", "\r\n") > 0) + $Temp = substr($Temp, 0, strlen($Temp)-2); + if( strpos( "#$Temp", "1005") > 0) + $Temp = ""; + if( strpos( "#$Temp", "783") > 0) + $Temp = ""; + //schreiben in file + fputs( $fileOut, $Temp); + $Zeilen++; + } } -// fclose( $fileOut); + fclose( $fileOut); + echo "
Es wurden $Zeilen Zeilen eingelesen
"; } else @@ -87,9 +111,9 @@ else { echo "
\n"; echo "\n"; - echo "\t". - "\n"; + echo "\t". + "\n"; echo "\t". "\n"; echo "\t".
XCAL-File: https://
XCAL-File: https://$PentabarfXMLhost/$PentabarfXMLpath
Username:
Password: