SISSy/proxy.php

69 lines
2 KiB
PHP
Raw Normal View History

<?php
// Konfiguration
$iserv_gpu001_url = 'https://webdav.iserv.de/Groups/Stundenplan/Auto-Import/GPU001.TXT';
$iserv_gpu002_url = 'https://webdav.iserv.de/Groups/Stundenplan/Auto-Import/GPU002.TXT';
$iserv_gpu005_url = 'https://webdav.iserv.de/Groups/Stundenplan/Auto-Import/GPU005.TXT';
$iserv_gpu009_url = 'https://webdav.iserv.de/Groups/Stundenplan/Auto-Import/GPU009.TXT';
$iserv_gpu014_url = 'https://webdav.iserv.de/Groups/Stundenplan/Auto-Import/GPU014.TXT';
$iserv_gpu017_url = 'https://webdav.iserv.de/Groups/Stundenplan/Auto-Import/GPU017.TXT';
$iserv_rsslul_url = 'https://iserv.de/iserv/public/news/rss/Lehrer?pwd=<PASSWORT>';
$iserv_rsssul_url = 'https://iserv.de/iserv/public/news/rss/Lehrer%20und%20Sch%C3%BCler?pwd=<PASSWORT>';
$iserv_rsssus_url = 'https://iserv.de/iserv/public/news/rss/Sch%C3%BCler?pwd=<PASSWORT>';
$iserv_username = 'webexport.system';
$iserv_password = '<PASSWORT>';
// Angefragte Datei auswerten
switch ($_GET["file"]) {
case "G001":
$iserv_url = $iserv_gpu001_url;
break;
case "G002":
$iserv_url = $iserv_gpu002_url;
break;
case "G005":
$iserv_url = $iserv_gpu005_url;
break;
case "G009":
$iserv_url = $iserv_gpu009_url;
break;
case "G014":
$iserv_url = $iserv_gpu014_url;
break;
case "G017":
$iserv_url = $iserv_gpu017_url;
break;
case "rsslul":
$iserv_url = $iserv_rsslul_url;
break;
case "rsssul":
$iserv_url = $iserv_rsssul_url;
break;
case "rsssus":
default:
$iserv_url = $iserv_rsssus_url;
break;
}
// Daten via Curl aus IServ laden
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $iserv_url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_USERPWD, "$iserv_username:$iserv_password");
curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
$output = curl_exec($ch);
curl_close($ch);
// Datei ausgeben
echo $output;
exit();
?>