#!/usr/bin/perl -T use warnings; use diagnostics; use strict; use CGI; use CGI qw(:standard escapeHTML); use CGI::Carp qw(carpout fatalsToBrowser warningsToBrowser); open (LOG, ">>./admin/errorlog.txt") && carpout(*LOG); print "P3P: CP=\"NOI ADM DEV PSAi COM NAV OUR OTR STP IND DEM\"\n"; print "Expires: Wed, 11 Nov 1998 11:11:11 GMT\n"; my $requestmethod = ""; $requestmethod = $ENV{'REQUEST_METHOD'} if (defined $ENV{'REQUEST_METHOD'}); my $useragent = ""; $useragent = $ENV{'HTTP_USER_AGENT'} if (defined $ENV{'HTTP_USER_AGENT'}); our ($dbpfad, $cgipfad, $httppfad, $mday, $mon, $hour, $min, $sec, $year, $wday, $yday, $isdst, $ndate, $key1, $key2, $text, $absender, $autosperre, $kurzwahl, $keywords, $subkeyword, $lebensdauer, $preis); if (($requestmethod) && ($requestmethod ne "GET")) { print "Content-Type: text/plain; charset=ISO-8859-1\r\n\r\n"; exit(); } else { require "./admin/pfade.txt"; if ((defined param("ssl")) && (defined param("ssl") eq "ssl")) { $cgipfad=~s/http\:/https\:/i; $httppfad=~s/http\:/https\:/i; } require "$dbpfad/db/smseinstellungen.db"; &datum_zeit(); if ((defined param("key1")) && (defined param("key2")) && (defined param("text")) && (defined param("absender")) && (! $ENV{'HTTP_USER_AGENT'})) { &smsempfang(); } else { print "P3P: CP=\"NOI ADM DEV PSAi COM NAV OUR OTR STP IND DEM\"\n"; print "Expires: Wed, 11 Nov 1998 11:11:11 GMT\n"; &info(); } } ###################################################################### sub smsempfang { $key1=escapeHTML(param("key1")); $key2=escapeHTML(param("key2")); $text=escapeHTML(param("text")); $absender=escapeHTML(param("absender")); my $gefiltert=0; open (BADWORDS, "<$dbpfad/db/badwords.db"); flock(BADWORDS, 1); my @badwords = ; close(BADWORDS); foreach my $test (@badwords) { chomp($test); if ($text=~/$test/gi) { $text=~s/$test/.../gi; $gefiltert++; } } my $zeitstempel=$^T; if (($autosperre eq "off") || ($gefiltert == 0)) { open (SMS, "+<$dbpfad/db/sms.db"); flock(SMS, 2); seek(SMS, 0, 2); print SMS "$text|$absender|$zeitstempel|\n"; close(SMS); } my $filterstatus=""; if (($autosperre eq "on") && ($gefiltert > 0)) { $filterstatus="gesperrt"; } open (SMSLOGS, "+<$dbpfad/db/smslogs.db"); flock(SMSLOGS, 2); seek(SMSLOGS, 0, 2); print SMSLOGS "$text|$absender|$ndate|$zeitstempel|$filterstatus|\n"; close(SMSLOGS); print"Content-type: text/html; charset=ISO-8859-1\r\n\r\n"; print "ok"; exit(0); } sub info { print "Content-type: text/html; charset=ISO-8859-1\r\n\r\n", "", "", "Xandra-ChatBot SMS-Empfänger", "", "\n", "", "", "", "", "", "", "", "", "", "", "

Ich kann SMS empfangen!
", "Möchten Sie Jemanden grüßen oder haben Sie News die Jeder wissen sollte? ", "Schicken Sie mir doch einfach eine SMS und ich veröffentliche sie automatisch - toll oder!

", "Und so funktioniert es:", "
    ", "
  1. SMS an die Nummer:       $kurzwahl
  2. ", "
  3. Vor dem Text den Code: $keywords $subkeyword
  4. ", "
  5. Text schreiben und fertig...
  6. ", "
", "

", "", "", "", "", "", "", "", "", "", "
", "Ihre SMS wird abwechselnd für $lebensdauer Minuten mit anderen SMS eingeblendet!

", "Kosten für diesen Service: $preis/SMS. (inkl. 12Cent VFD2 Anteil, zzgl. T-D1 TPL)", "
", "", ""; exit(0); } sub datum_zeit { ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time); $mon=$mon+1; $year=1900+$year; $min="0$min" if ($min < 10); $hour="0$hour" if ($hour < 10); $mon="0$mon" if ($mon < 10); $mday="0$mday" if ($mday < 10); $ndate = "$mday.$mon.$year $hour:$min"; }