diff --git a/newsgroup/.htaccess b/newsgroup/.htaccess
deleted file mode 100644
index 7e91dfc..0000000
--- a/newsgroup/.htaccess
+++ /dev/null
@@ -1,6 +0,0 @@
-AuthPAM_Enabled on
-
'.$text_thread["button_grouplist"].' | '; - echo ''.$text_article["back_to_group"].' | '; - if ((!$readonly) && ($message) && - (!function_exists("npreg_group_has_write_access") || - npreg_group_has_write_access($group))) - echo ''.$text_article["button_answer"]. - ' | '; - - if(function_exists(npreg_user_is_moderator) && npreg_user_is_moderator($group)) { - echo ''.$text_article["button_cancel"].' | '; - } - -?> -
No articles available
"; -$text_thread["button_write"]="Write"; -$text_thread["button_grouplist"]="Newsgroups"; -$text_thread["button_top"]="Back to Top"; -$text_thread["date"]="Date"; -$text_thread["subject"]="Subject"; -$text_thread["threadsize"]="#"; -$text_thread["author"]="Author"; -$text_thread["no_such_group"]="No such Group."; -$text_thread["pages"]="Pages:"; - -$text_groups["newsgroup"]="Newsgroup"; -$text_groups["description"]="Description"; - -$text_article["button_answer"]="Answer"; -$text_article["button_cancel"]="Delete"; -$text_article["block-xnoarchive"]="This system is not an archive, but the -administrator of this system decided to block postings, where the author -doesn't want archivation."; -$text_article["full_article"]="Click here to read the complete article"; - -$text_post["name"]="Your Name:"; -$text_post["email"]="Your E-Mail:"; -$text_post["missing_message"]="You must include a message to post."; -$text_post["missing_email"]="You must include an email address."; -$text_post["missing_name"]="You must include a name or at least an alias."; -$text_post["missing_subject"]="You must include a subject."; -$text_post["button_post"]="Post"; -$text_post["remember"]="Remember name and email address"; -$text_post["message"]="Message"; -$text_post["group_head"]="Compose article for "; -$text_post["group_tail"]=""; -$text_post["followup_not_allowed"]="You aren't allowed to post to the groups:"; -$text_post["message_posted"]="Message posted"; -$text_post["message_posted2"]="The message was successfully posted."; -$text_post["button_back"]="Back"; -$text_post["button_back2"]="to"; -$text_post["error_newsserver"]="The newsserver does not accept the message:"; -$text_post["error_readonly"]="The group is write protected"; -$text_post["error_wrong_email"]="The email adress is wrong"; -$text_post["wrote_prefix"]=""; -$text_post["wrote_suffix"]=" wrote:"; -$text_post["quote"]="Quote"; - -$text_error["error:"]='Error:'; -$text_error["connection_failed"]="The connection to the Newsserver failed"; -$text_error["article_not_found"]="The article doesn't exist.
"; -$text_error["read_access_denied"]="No permission to read!
"; -$text_error["post_failed"]="Connection failed. Try to reload later."; -$text_error["auth_error"]="Authentifikation at the Newsserver failed."; -$text_error["spool_error"]="Error in spoolfile. Please reload."; - -?> diff --git a/newsgroup/lib/check.php b/newsgroup/lib/check.php deleted file mode 100644 index 05460a2..0000000 --- a/newsgroup/lib/check.php +++ /dev/null @@ -1,6 +0,0 @@ - -if(($iconv_enable==true) && - (!function_exists("iconv"))) - die('There is no iconv-extension in PHP. set $iconv_enable=false - in config.inc.php to disable automatic charset recoding.'); -?> \ No newline at end of file diff --git a/newsgroup/lib/message.inc.php b/newsgroup/lib/message.inc.php deleted file mode 100644 index 7a44c4b..0000000 --- a/newsgroup/lib/message.inc.php +++ /dev/null @@ -1,539 +0,0 @@ - -/* - * NewsPortal: Functions for handling single messages - * - * Copyright (C) 2002-2004 Florian Amrhein - * E-Mail: newsportal@florian-amrhein.de - * Web: http://florian-amrhein.de - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -function message_parse($rawmessage) { - global $attachment_delete_alternative,$attachment_uudecode,$www_charset; - global $iconv_enable; - // Read the header of the message: - $count_rawmessage=count($rawmessage); - $message = new messageType; - $rawheader=array(); - $i=0; - while ($rawmessage[$i] != "") { - $rawheader[]=$rawmessage[$i]; - $i++; - } - // Parse the Header: - $message->header=parse_header($rawheader); - // Now we know if the message is a mime-multipart message: - $content_type=split("/",$message->header->content_type[0]); - if ($content_type[0]=="multipart") { - $message->header->content_type=array(); - // We have multible bodies, so we split the message into its parts - $boundary="--".$message->header->content_type_boundary; - // lets find the first part - while($rawmessage[$i] != $boundary) - $i++; - $i++; - $part=array(); - while($i<=$count_rawmessage) { - if (($rawmessage[$i]==$boundary) || ($i==$count_rawmessage-1) || - ($rawmessage[$i]==$boundary.'--')) { - $partmessage=message_parse($part); - // merge the content-types of the message with those of the part - for ($o=0; $o'; - for($j=$body[$i]->depth; $j<$depth; $j++) - echo ''; - $t=html_parse(text2html($body[$i]->text)).'
".$text_error["error:"]."
"; - echo "".$text_thread["no_such_group"]."
"; - flush(); - } else { - $infofilename=$spooldir."/".$groupname."-info.txt"; - // lets find out, in which mode wie want to read articles: - // w: complete rebuild of the group-info file - // a: add new articles to the group-info file - // n: there are no new articles, no rebuild or actualisation - $spoolopenmodus="n"; - // if the group-info file doesn't exist: create it - if (!((file_exists($infofilename)) && (file_exists($spoolfilename)) && - (filesize($infofilename)>0) && (filesize($spoolfilename)>0))) { - $spoolopenmodus="w"; - } else { - $infofile=fopen($infofilename,"r"); - $oldid=fgets($infofile,100); - if (trim($oldid) != $idstring) { - echo "\n"; - $spoolopenmodus="w"; - } - $oldgroupinfo=explode(" ",trim(fgets($infofile,200))); - fclose($infofile); - if ($groupinfo[3] < $oldgroupinfo[1]) { - $spoolopenmodus="w"; - } - if ($maxarticles == 0) { - if ($groupinfo[2] != $oldgroupinfo[0]) $spoolopenmodus="w"; - } else { - if ($groupinfo[2] > $oldgroupinfo[0]) $spoolopenmodus="w"; - } - // if the high watermark increased, add articles to the existing spool - if (($spoolopenmodus == "n") && ($groupinfo[3] > $oldgroupinfo[1])) - $spoolopenmodus="a"; - } - if ($spoolopenmodus=="a") { - $firstarticle=$oldgroupinfo[1]+1; - $lastarticle=$groupinfo[3]; - } - if ($spoolopenmodus=="w") { - $firstarticle=$groupinfo[2]; - $lastarticle=$groupinfo[3]; - } - if ($spoolopenmodus != "n") { - if ($maxarticles != 0) { - if ($spoolopenmodus == "w") { - $firstarticle=$lastarticle-$maxarticles+1; - if ($firstarticle < $groupinfo[2]) - $firstarticle=$groupinfo[2]; - } else { - if ($lastarticle-$oldgroupinfo[0]+1 > $maxarticles + $maxarticles_extra) { - $firstarticle=$lastarticle-$maxarticles+1; - $spoolopenmodus="w"; - } - } - } - if (($maxfetch!=0) && (($lastarticle-$firstarticle+1) > $maxfetch)) { - if ($spoolopenmodus=="w") { - $tofetch=($initialfetch != 0) ? $initialfetch : $maxfetch; - $lastarticle=$firstarticle+$tofetch-1; - } else { - $lastarticle=$firstarticle+$maxfetch-1; - } - } - } - echo "\n"; - // load the old spool-file, if we do not have a complete rebuild - if ($spoolopenmodus != "w") $headers=thread_cache_load($groupname); - // read articles from the newsserver - if ($spoolopenmodus != "n") { - // order the article overviews from the newsserver - fputs($ns,"XOVER ".$firstarticle."-".$lastarticle."\r\n"); - $tmp=line_read($ns); - // have the server accepted our order? - if (substr($tmp,0,3) == "224") { - $line=line_read($ns); - // read overview by overview until the data ends - while ($line != ".") { - // parse the output of the server... - $article=thread_overview_interpret($line,$overviewformat,$groupname); - // ... and save it in our data structure - $article->threadsize++; - $article->date_thread=$article->date; - $headers[$article->id]=$article; - // if we are in poll-mode: print status information and - // decode the article itself, so it can be saved in the article - // cache - if($poll) { - echo $article->number.", "; flush(); - message_read($article->number,0,$groupname); - } - // read the next line from the newsserver - $line=line_read($ns); - } - // write information about the last article to the spool-directory - $infofile=fopen($spooldir."/".urlencode($groupname)."-lastarticleinfo.dat","w"); - $lastarticleinfo->from=$article->from; - $lastarticleinfo->date=$article->date; - $lastarticleinfo->name=$article->name; - fputs($infofile,serialize($lastarticleinfo)); - fclose($infofile); - } - // remove the old spoolfile - if (file_exists($spoolfilename)) unlink($spoolfilename); - if ((isset($headers)) && (count($headers)>0)) { - //$infofile=fopen($infofilename,"w"); - //if ($spoolopenmodus=="a") $firstarticle=$oldgroupinfo[0]; - //fputs($infofile,$idstring."\n"); - //fputs($infofile,$firstarticle." ".$lastarticle."\r\n"); - //fclose($infofile); - foreach($headers as $c) { - if (($c->isAnswer == false) && - (isset($c->references))) { // is the article an answer to an - // other article? - // try to find a matching article to one of the references - $refmatch=false; - foreach ($c->references as $reference) { - if(isset($headers[$reference])) { - $refmatch=$reference; - } - } - // have we found an article, to which this article is an answer? - if($refmatch!=false) { - $c->isAnswer=true; - $c->bestreference=$refmatch; - $headers[$c->id]=$c; - // the referenced article get the ID af this article as in - // its answers-array - $headers[$refmatch]->answers[]=$c->id; - // propagate down the number of articles in this thread - $d =& $headers[$c->bestreference]; - do { - $d->threadsize+=$c->threadsize; - $d->date_thread=max($c->date,$d->date_thread); - } while(($headers[$d->bestreference]) && - (isset($d->bestreference)) && - ($d =& $headers[$d->bestreference])); - } - } - } - reset($headers); - // sort the articles - if (($thread_sort_order != 0) && (count($headers)>0)) - uasort($headers,'thread_mycompare'); - // Save the thread-informations - thread_cache_save($headers,$groupname); - // Save the info-file - $infofile=fopen($infofilename,"w"); - if ($spoolopenmodus=="a") $firstarticle=$oldgroupinfo[0]; - fputs($infofile,$idstring."\n"); - fputs($infofile,$firstarticle." ".$lastarticle." ".count($headers)."\r\n"); - fclose($infofile); - } - // remove cached articles that are not in this group - // (expired on the server or canceled) - $dirhandle=opendir($spooldir); - while ($cachefile = readdir($dirhandle)) { - if(substr($cachefile,0,strlen($groupname)+1)==$groupname."_") { - $num=eregi_replace('^(.*)_(.*)\.(.*)$','\2',$cachefile); - if(($num<$firstarticle) || ($num>$lastarticle)) - unlink($spooldir.'/'.$cachefile); - } - // remove the html cache files of this group - if((substr($cachefile,strlen($cachefile)-5)==".html") && - (substr($cachefile,0,strlen($groupname)+1)==$groupname."-")) - unlink($spooldir.'/'.$cachefile); - } - } - if(isset($headers)) - return $headers; - return false; - //return((isset($headers)) ? $headers : false); - } -} - - -/* - * Read the Overview. - * Format of the overview-file: - * message-id - * date - * subject - * author - * email - * references - * - * $groupname: name of the newsgroup - * $readmode: if set to 0, this function only reads data from the - * newsserver, if there exists no cached data for this group - * $poll: polling mode, see description at thread_load_newsserver() - */ - -function thread_load($groupname,$readmode = 1,$poll=false) { - global $text_error, $maxarticles, $server, $port; - global $spooldir,$thread_sort_order,$cache_thread; - if (!testGroup($groupname)) { - echo $text_error["read_access_denied"]; - return; - } - // first assume that we have to query the newsserver - $query_ns=true; - // name of the file that indicates by it's timestamp when the - // last query of the newsserver was - $cachefile=$spooldir.'/'.$groupname.'-cache.txt'; - // should we load the data only from cache if it's recent enough, or - // do we have to query the newsserver every time? - if($cache_thread>0) { - if((file_exists($cachefile)) && - (filemtime($cachefile)+$cache_thread>time())) { - // cached file exists and is new enough. so lets read it out. - $articles=thread_cache_load($groupname); - return $articles; - $query_ns=false; - } - } - // do we have to query the newsserver? - if($query_ns) { - // look if there is new data on the newsserver - $ns=nntp_open($server,$port); - if ($ns == false) return false; - if (($ns!=false) && ($readmode > 0)) - $articles=thread_load_newsserver($ns,$groupname,$poll); - if ((isset($articles)) && ($articles)) { - - // write the file which indicates the time of the last newsserver query - $fp_cachefile=@fopen($cachefile,"w"); - if($fp_cachefile!==false) { - fputs($fp_cachefile,""); - fclose($fp_cachefile); - return $articles; - } - } else { - // uh, we didn't get articles from the newsservers... - // for now, return false. but it would also make sense to get - // the articles from the cache then... - return false; - } - nntp_close($ns); - } -} - -/* - * Remove re:, aw: etc. from a subject. - * - * $subject: a string containing the complete Subject - * - * The function removes the re:, aw: etc. from $subject end returns true - * if it removed anything, and false if not. - */ -function splitSubject(&$subject) { - $s=eregi_replace('^(odp:|aw:|re:|re\[2\]:| )+','',$subject); - $return=($s != $subject); - $subject=$s; - return $return; -} - -function str_change($str,$pos,$char) { - return(substr($str,0,$pos).$char.substr($str,$pos+1,strlen($str)-$pos)); -} - -/* - * calculate the graphic representation of the thread - */ -function thread_show_calculate($newtree,$depth,$num,$liste,$c) { - global $thread_show; - // displays the replies to an article? - if(!$thread_show["replies"]) { - // no - if ((isset($c->answers[0])) && (count($c->answers)>0)) - $newtree.="o"; - else - $newtree.="o"; - } else { - // yes, display the replies - if ((isset($c->answers[0])) && (count($c->answers)>0)) { - $newtree.="*"; - } else { - if ($depth == 1) { - $newtree.="o"; - } else { - $newtree.="-"; - } - } - if (($num == count($liste)-1) && ($depth>1)) { - $newtree=str_change($newtree,$depth-2,"`"); - } - } - return($newtree); -} - - -/* - * Format the message-tree - * Zeichen im Baum: - * o : leerer Kasten k1.gif - * * : Kasten mit Zeichen drin k2.gif - * i : vertikale Linie I.gif - * - : horizontale Linie s.gif - * + : T-Stueck T.gif - * ` : Winkel L.gif - */ -function thread_show_treegraphic($newtree) { - global $imgdir; - $return=""; - for ($o=0 ; $o'. - ''. - thread_format_date($c).' | '; - $output.= ''. - thread_show_treegraphic($newtree).' | '; - if ($thread_show["subject"]) - $output.= ''. - ' '. - thread_format_subject($c,$group,$highlight)." "; - if ($thread_show["author"]) - $output.= '('.thread_format_author($c).') | '; - $output.= "
'.$text_thread["date"]." | "; - if ($thread_show["subject"]) - echo ''. - $text_thread["subject"]." | "; - if ($thread_show["threadsize"]) - echo ''. - $text_thread["threadsize"]." | "; - if ($thread_show["author"]) { - echo ''; - echo ' | '.$text_thread["author"]." | \n"; - } - echo "
eval: '.$field->name.': '.$_REQUEST[$field->name].'
'; - } - return !$errors; - } - - - /* - * liefert true, falls $name fehlerhaft ausgefüllt wurde - */ - function is_error($name) { - return $this->fields[$name]->error; - } - - /* - * Liefert die individuelle Fehlermeldung, falls $name fehlerhaft - * ausgefüllt wurde. Falls keine Meldung vorliegt, wird false - * geliefert. - */ - function geterrormessage($name) { - if(isset($this->fields[$name]->errormessage)) - return $this->fields[$name]->errormessage; - else - return false; - } - - /* - * Zeigt gegebenenfalls eine Fehlermeldung an, falls $name nicht - * korrekt ausgefüllt wurde - */ - function show_error($name) { - if($this->is_error($name)) { - echo "fehler
"; - } - } - - /* - * Zeigt den Titel zu einem Feld an. Ist das zugehörige Feld fehlerhaft - * ausgefüllt worden, wird es (z.B. farblich) markiert. - * - * $name: Name des Feldes - * $text: auszugebener Text - */ - function show_title($name,$text) { - if($this->is_error($name)) - echo ''.$text.''; - else - echo $text; - } - - /* - * Zeigt die Daten an, die der Benutzer in das Formular, ob richtig oder - * falsch ist egal, eingegeben hatte. - */ - function show_value($name) { - echo stripslashes($_REQUEST[$name]); - } - - /* - * Liefert Variablenwerte ohne vorherige Umkodierung/Zusammenfassung - * zurück - */ - function value($name) { - if(is_array($_REQUEST[$name])) { - $a=$_REQUEST[$name]; - return $a; - } - return stripslashes($_REQUEST[$name]); - } - - /* Liefert Variablenwerte mit vorheriger Umkodierung/Zusammenfassung - * zurück. Vor allem wichtig bei Typ check-text und radio-text, wo - * der eigentliche Inhalt über mehrere Variablen verteilt ist, bzw. - * teilweise gar nicht zum Zuge kommt (freies Textfeld ausgefüllt, - * aber nicht angeklickt) - */ - function get_value($name) { - if(is_array($_REQUEST[$name])) { - $a=$_REQUEST[$name]; - // Freies Textfeld? - if(in_array("_frei",$a)) { - if((isset($_REQUEST[$name.'_frei'])) && - ($_REQUEST[$name.'_frei']!="")) - $a[]=$_REQUEST[$name.'_frei']; - unset($a[$name.'_frei']); - } - - return $a; - } else if(($_REQUEST[$name]=='_frei') && - ($this->fields[$name]->typ=='radio-text')) { - return stripslashes($_REQUEST[$name.'_frei']); - } else - return stripslashes($_REQUEST[$name]); - } - - /* - * gibt einfach nur " checked" aus, wenn $name den wert $value enthält. - * Nötig für das Vorselektieren von Knöpfen - */ - function show_checked($name,$value) { - global $fields; - if(($this->fields[$name]->typ!="checkbox") && - ($this->fields[$name]->typ!="check-text")) { - if($this->value($name)==$value) { - if($this->fields[$name]->typ=="pulldown") - echo ' selected'; - else - echo ' checked'; - } - } else { - if(in_array($value,$this->value($name))) - echo ' checked'; - } - } - - function show_selected($name,$value) { - global $fields; - if(($this->fields[$name]->typ!="checkbox") && - ($this->fields[$name]->typ!="check-text")) { - if($this->value($name)==$value) { - echo ' selected'; - } - } - } - - - /* - * Registriert eine Variable als zum Formular gehörend - * - * $name: Name der Variablen - * $typ: Art der Eingabe: - * - text: Textfeld mit einfacher freier Eingabe - * - textarea: Mehrzeiliger Text mit freier Eingabe - * - checkbox: Ankreuzfelder, mehrere gleichzeitig - * - radiobutton: Ankreuzfelder, nur eins gleichzeitig - * - pulldown: Pulldown-Menu, nut eins gleichzeitig - * - check-text: Ankreuzfelder+Textfeld, mehrere gleichzeitig - * - radio-text: Ankreuzfelder+Textfeld, maximal eins - * $empty: Darf das entsprechende Feld leer gelassen werden? - * bzw. mindestens kein angekreuzt bzw. ausgefüllt? - * $validator: Information, wie der Inhalt auf Korrektheit geprüft - * werden soll - * $errmsg: Fehlermeldung, die bei erkanntem Fehler ausgegeben - * werden soll - */ - function register($name,$typ,$empty=true,$validator=false,$errmsg=false) { - $var->name=$name; - $var->typ=$typ; - $var->empty=$empty; - $var->validator=$validator; - $var->errmsg=$errmsg; - $this->fields[$name]=$var; - } - - /* - * der Konstruktor - */ - function formvalidate() { - } -} -?> diff --git a/newsgroup/newsportal-0.37.zip b/newsgroup/newsportal-0.37.zip deleted file mode 100644 index a8f8d39..0000000 Binary files a/newsgroup/newsportal-0.37.zip and /dev/null differ diff --git a/newsgroup/newsportal.php b/newsgroup/newsportal.php deleted file mode 100644 index 22efe9d..0000000 --- a/newsgroup/newsportal.php +++ /dev/null @@ -1,811 +0,0 @@ - -/* Newsportal NNTP<->HTTP Gateway - * Version: 0.36 - * Download: http://florian-amrhein.de/newsportal - * - * Copyright (C) 2002-2004 Florian Amrhein - * E-Mail: newsportal@florian-amrhein.de - * Web: http://florian-amrhein.de - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -include "lib/types.inc.php"; -include "lib/thread.inc.php"; -include "lib/message.inc.php"; -include "lib/post.inc.php"; -//include "lib/validator.inc.php"; - -/* - * opens the connection to the NNTP-Server - * - * $server: adress of the NNTP-Server - * $port: port of the server - */ -function nntp_open($nserver=0,$nport=0) { - global $text_error,$server_auth_user,$server_auth_pass,$readonly; - global $server,$port; - // echo "".$text_error["error:"].$weg."
"; - fclose($ns); - $ns=false; - } else { - if ($ns != false) { - fputs($ns,"MODE reader\r\n"); - $weg=line_read($ns); // and once more - if ((substr($weg,0,2) != "20") && - ((!$authorize) || ((substr($weg,0,3) != "480") && ($authorize)))) { - echo "".$text_error["error:"].$weg."
"; - fclose($ns); - $ns=false; - } - } - if ((isset($server_auth_user)) && (isset($server_auth_pass)) && - ($server_auth_user != "")) { - fputs($ns,"AUTHINFO USER $server_auth_user\r\n"); - $weg=line_read($ns); - fputs($ns,"AUTHINFO PASS $server_auth_pass\r\n"); - $weg=line_read($ns); - if (substr($weg,0,3) != "281") { - echo "".$text_error["error:"]."
"; - echo "".$text_error["auth_error"]."
"; - } - } - } - if ($ns==false) echo "".$text_error["connection_failed"]."
"; - return $ns; -} - -/* - * Close a NNTP connection - * - * $ns: the handle of the connection - */ -function nntp_close(&$ns) { - if ($ns != false) { - fputs($ns,"QUIT\r\n"); - fclose($ns); - } -} - -/* - * Validates an email adress - * - * $address: a string containing the email-address to be validated - * - * returns true if the address passes the tests, false otherwise. - */ -function validate_email($address) -{ - global $validate_email; - $return=true; - if (($validate_email >= 1) && ($return == true)) - $return = (ereg('^[-!#$%&\'*+\\./0-9=?A-Z^_A-z{|}~]+'.'@'. - '[-!#$%&\'*+\\/0-9=?A-Z^_A-z{|}~]+\.'. - '[-!#$%&\'*+\\./0-9=?A-Z^_A-z{|}~]+$',$address)); - if (($validate_email >= 2) && ($return == true)) { - $addressarray=address_decode($address,"garantiertungueltig"); - $return=checkdnsrr($addressarray[0]["host"],"MX"); - if (!$return) $return=checkdnsrr($addressarray[0]["host"],"A"); - } - return($return); -} - -/* - * decodes a block of 7bit-data in uuencoded format to it's original - * 8bit format. - * The headerline containing filename and permissions doesn't have to - * be included. - * - * $data: The uuencoded data as a string - * - * returns the 8bit data as a string - * - * Note: this function is very slow and doesn't recognize incorrect code. - */ -function uudecode_line($line) { - $data=substr($line,1); - $length=ord($line[0])-32; - $decoded=""; - for ($i=0; $i<(strlen($data)>>2); $i++) { - $pack=substr($data,$i<<2,4); - $upack=""; - $bitmaske=0; - for ($o=0; $o<4; $o++) { - $g=((ord($pack[3-$o])-32)); - if ($g==64) $g=0; - $bitmaske=$bitmaske | ($g << (6*$o)); - } - $schablone=255; - for ($o=0; $o<3; $o++) { - $c=($bitmaske & $schablone) >> ($o << 3); - $schablone=($schablone << 8); - $upack=chr($c).$upack; - } - $decoded.=$upack; - } - $decoded=substr($decoded,0,$length); - return $decoded; -} - -/* - * decodes uuencoded Attachments. - * - * $data: the encoded data - * - * returns the decoded data - */ -function uudecode($data) { - $d=explode("\n",$data); - $u=""; - for ($i=0; $i-".base64_decode($value)."-
"; - break; - case "x-no-archive:": - $header->xnoarchive=strtolower(trim($value)); - } - } - if (!isset($header->content_type[0])) - $header->content_type[0]="text/plain"; - if (!isset($header->content_transfer_encoding)) - $header->content_transfer_encoding="8bit"; - if ($number != "") $header->number=$number; - return $header; -} - -/* - * convert the charset of a text - */ -function recode_charset($text,$source=false,$dest=false) { - global $iconv_enable,$www_charset; - if($dest==false) - $dest=$www_charset; - if(($iconv_enable) && ($source!=false)) { - $return=iconv($source, - $dest."//TRANSLIT",$text); - if($return!="") - return $return; - else - return $text; - } else { - return $text; - } -} - -function decode_body($body,$encoding) { - $bodyzeile=""; - switch ($encoding) { - case "base64": - $body=base64_decode($body); - break; - case "quoted-printable": - $body=Quoted_printable_decode($body); - $body=str_replace("=\n","",$body); -// default: -// $body=str_replace("\n..\n","\n.\n",$body); - } - - return $body; -} - -/* - * makes URLs clickable - * - * $text: A text-line probably containing links. - * - * the function returns the text-line with HTML-Links to the links or - * email-adresses. - */ -function html_parse($text) { - global $frame_externallink; - if ((isset($frame_externallink)) && ($frame_externallink != "")) { - $target=' TARGET="'.$frame_externallink.'" '; - } else { - $target=' '; - } - // regular expressions that will be applied to every word in the text - $regexp_replace=array( - 'http://((\.*([-a-z0-9_/~@?=%#;+]|&)+)+)' => - 'http://\1', - '(www\.[-a-z]+\.(de|pl|cz|sk|tk|tv|cc|cx|biz|us|uk|info|int|eu|dk|org|net|at|ch|com))' => - '\1', - 'https://([-a-z0-9_./~@?=%#&;\n]+)' => - 'https://\1', - 'gopher://([-a-z0-9_./~@?=%\n]+)' => - 'gopher://\1', - 'news://([-a-z0-9_./~@?=%\n]+)' => - 'news://\1', - 'ftp://([-a-z0-9_./~@?=%\n]+)' => - 'ftp://\1', - //'([-a-z0-9_./n]+)@([-a-z0-9_.]+)' => - // $_SESSION["loggedin"]!==true ? '(e-Mail)' : - // '\1@\2' - ); - $ntext=""; - // split every line into it's words - $words=explode(" ",$text); - $n=count($words); - for($i=0; $i<$n; $i++) { - $word=$words[$i]; - // test, if we need the slow walk through all the regular expressions - if(eregi('www|\:|@',$word)) { - // apply the regular expressions to the word until a matching - // expression is found - foreach ($regexp_replace as $key => $value) { - $nword=eregi_replace($key,$value,$word); - if($nword!=$word) { - $word=$nword; - break; - } - } - } - // add the spaces between the words - if($i>0) - $ntext.=" "; - $ntext.=$word; - } - return($ntext); -} - - -/* - * read the header of an article in plaintext into an array - * $articleNumber can be the number of an article or its message-id. - */ -function readPlainHeader(&$ns,$group,$articleNumber) { - fputs($ns,"GROUP $group\r\n"); - $line=line_read($ns); - fputs($ns,"HEAD $articleNumber\r\n"); - $line=line_read($ns); - if (substr($line,0,3) != "221") { - echo $text_error["article_not_found"]; - $header=false; - } else { - $line=line_read($ns); - $body=""; - while(strcmp(trim($line),".") != 0) { - $body .= $line."\n"; - $line=line_read($ns); - } - return split("\n",str_replace("\r\n","\n",$body)); - } -} - -/* - * cancel an article on the newsserver - * - * DO NOT USE THIS FUNCTION, IF YOU DON'T KNOW WHAT YOU ARE DOING! - * - * $ns: The handler of the NNTP-Connection - * $group: The group of the article - * $id: the Number of the article inside the group or the message-id - */ -function message_cancel($subject,$from,$newsgroups,$ref,$body,$id) { - global $server,$port,$send_poster_host,$organization,$text_error; - global $file_footer,$www_charset; - flush(); - $ns=nntp_open($server,$port); - if ($ns != false) { - fputs($ns,"POST\r\n"); - $weg=line_read($ns); - fputs($ns,'Subject: '.quoted_printable_encode($subject)."\r\n"); - fputs($ns,'From: '.$from."\r\n"); - fputs($ns,'Newsgroups: '.$newsgroups."\r\n"); - fputs($ns,"Mime-Version: 1.0\r\n"); - fputs($ns,"Content-Type: text/plain; charset=".$www_charset."\r\n"); - fputs($ns,"Content-Transfer-Encoding: 8bit\r\n"); - if ($send_poster_host) - fputs($ns,'X-HTTP-Posting-Host: '.gethostbyaddr(getenv("REMOTE_ADDR"))."\r\n"); - if ($ref!=false) fputs($ns,'References: '.$ref."\r\n"); - if (isset($organization)) - fputs($ns,'Organization: '.quoted_printable_encode($organization)."\r\n"); - fputs($ns,"Control: cancel ".$id."\r\n"); - if ((isset($file_footer)) && ($file_footer!="")) { - $footerfile=fopen($file_footer,"r"); - $body.="\n".fread($footerfile,filesize($file_footer)); - fclose($footerfile); - } - $body=str_replace("\n.\r","\n..\r",$body); - $body=str_replace("\r",'',$body); - $b=split("\n",$body); - $body=""; - for ($i=0; $iecho $text_post["message_posted2"];?>
- -'.$text_post["button_back"].' ' - .$text_post["button_back2"].' '.urlencode($group) ?>
- - } else { - // article not accepted by the newsserver - $type="retry"; - $error=$text_post["error_newsserver"]."$message"; - } - } else { - echo $text_post["error_readonly"]; - } - } -} - -// A reply of an other article. -if ($type=="reply") { - $message=message_read($id,0,$group); - $head=$message->header; - $body=explode("\n",$message->body[0]); - nntp_close($ns); - if ($head->name != "") { - $bodyzeile=$head->name; - } else { - $bodyzeile=$head->from; - } - $bodyzeile=$text_post["wrote_prefix"].$bodyzeile. - $text_post["wrote_suffix"]."\n\n"; - for ($i=0; $i<=count($body)-1; $i++) { - if((isset($cutsignature)) && ($cutsignature==true) && - ($body[$i]=='-- ')) - break; - if (trim($body[$i])!="") { - if($body[$i][0]=='>') - $bodyzeile.=">".$body[$i]."\n"; - else - $bodyzeile.="> ".$body[$i]."\n"; - } else { - $bodyzeile.="\n"; - } - } - $subject=$head->subject; - if (isset($head->followup) && ($head->followup != "")) { - $newsgroups=$head->followup; - } else { - $newsgroups=$head->newsgroups; - } - splitSubject($subject); - $subject="Re: ".$subject; - // Cut off old parts of a subject - // for example: 'foo (was: bar)' becomes 'foo'. - $subject=eregi_replace('(\(wa[sr]: .*\))$','',$subject); - $show=1; - $references=false; - if (isset($head->references[0])) { - for ($i=0; $i<=count($head->references)-1; $i++) { - $references .= $head->references[$i]." "; - } - } - $references .= $head->id; -} - -if ($type=="retry") { - $show=1; - $bodyzeile=$body; -} - -if ($show==1) { - -if ($testgroup) { - $testnewsgroups=testgroups($newsgroups); -} else { - $testnewsgroups=$newsgroups; -} - -if ($testnewsgroups == "") { - echo $text_post["followup_not_allowed"]; - echo " ".$newsgroups; -} else { - $newsgroups=$testnewsgroups; - - echo '
$error
"; ?> - - - - } } ?> - - include "tail.inc"; ?> diff --git a/newsgroup/spool/groups.dat b/newsgroup/spool/groups.dat deleted file mode 100644 index fefb157..0000000 --- a/newsgroup/spool/groups.dat +++ /dev/null @@ -1 +0,0 @@ -a:4:{i:0;O:13:"newsgroupType":4:{s:4:"name";N;s:11:"description";N;s:5:"count";N;s:4:"text";s:21:"Computer Science Club";}i:1;O:13:"newsgroupType":5:{s:4:"name";s:6:"uw.csc";s:11:"description";s:22:" Computer Science Club";s:5:"count";s:3:"115";s:4:"text";N;s:3:"age";i:1181337436;}i:2;O:13:"newsgroupType":4:{s:4:"name";s:15:"uw.csc.hardware";s:11:"description";s:16:" No description.";s:5:"count";s:1:"0";s:4:"text";N;}i:3;O:13:"newsgroupType":5:{s:4:"name";s:15:"uw.csc.software";s:11:"description";s:16:" No description.";s:5:"count";s:1:"3";s:4:"text";N;s:3:"age";i:1180792889;}} \ No newline at end of file diff --git a/newsgroup/spool/uw.csc-1-50.html b/newsgroup/spool/uw.csc-1-50.html deleted file mode 100644 index c6d0be8..0000000 --- a/newsgroup/spool/uw.csc-1-50.html +++ /dev/null @@ -1 +0,0 @@ -