Only in .: .htaccess Only in .: Attach Common subdirectories: ../bbs-orig/Documentation and ./Documentation Common subdirectories: ../bbs-orig/Images and ./Images Common subdirectories: ../bbs-orig/Library and ./Library Common subdirectories: ../bbs-orig/Msg_Open and ./Msg_Open Common subdirectories: ../bbs-orig/Sessions and ./Sessions Common subdirectories: ../bbs-orig/Users and ./Users diff -u ../bbs-orig/bbs.setup ./bbs.setup --- ../bbs-orig/bbs.setup Wed Nov 25 23:13:11 1998 +++ ./bbs.setup Tue Jun 15 22:18:27 1999 @@ -148,6 +148,16 @@ $no_html = "off"; $no_html_images = "on"; +#Hack for images -- Bill Adams (bill@evil.inetarena.com) +#What extensions are allowed? Be careful that you do not include +# anything executable (i.e. bat, pl, cgi, exe, sh, dll, etc.). If +# it is not listed here it will get the extension 'bin'. +@allowed_exts = qw(jpg jpeg tif tiff png gif html htm); + +#And what extension is an image extension? +@image_exts = qw( jpg tif png gif ); + + # # $use_list_element = "on" for listing messages with little # HTML style bullets. diff -u ../bbs-orig/bbs_entrance.cgi ./bbs_entrance.cgi --- ../bbs-orig/bbs_entrance.cgi Wed Nov 25 23:13:11 1998 +++ ./bbs_entrance.cgi Tue Jun 15 22:15:24 1999 @@ -1,4 +1,4 @@ -#!/usr/local/bin/perl -T +#!/usr/bin/perl -T ####################################################################### # Application Information # diff -u ../bbs-orig/bbs_forum.cgi ./bbs_forum.cgi --- ../bbs-orig/bbs_forum.cgi Wed Nov 25 23:13:11 1998 +++ ./bbs_forum.cgi Tue Jun 15 22:45:38 1999 @@ -1,4 +1,4 @@ -#!/usr/local/bin/perl -T +#!/usr/bin/perl -T ####################################################################### # Application Information # @@ -289,11 +289,22 @@ ($post_attachment, $post_attachment_filename) = split(/\|/, $attach_info); - $post_attach_html = - qq!
Attached File: ! . - qq! - $post_attachment_filename
!; + + #Hack -- Bill Adams + my $regexp = join('|', @image_exts); + if ($post_attachment =~ /\.($regexp)$/) { + $post_message .= "
+ \"Image\"
"; + } else { + $post_attach_html = + qq!
Attached File: ! . + qq! + $post_attachment_filename
!; + } close (ATTACHFILE); + + } require "./bbs_html_read_message.pl"; @@ -718,20 +729,34 @@ $forum =~ /([\w]*)/; $forum = $1; + # Hack -- Bill Adams for attaching images... if ($post_attachment_filename ne "") { - rename($post_attachment, - "$attach_dir/$forum-$message_name.bin"); - open(WRITEATTACH, - ">$forum_dir/$message_name.attach") || - &CgiDie("Could Not Open Attachment\n"); - print WRITEATTACH - "$forum-$message_name.bin" . - "|$post_attachment_filename\n"; - close(WRITEATTACH); + my $ext; + if ($post_attachment_filename =~ /\.([\d\w]{1,4})$/i) { + $ext = $1; + $ext =~ tr/[A-Z]/[a-z]/; #Lower case only! + #Fix the extension for a couple of special cases + if ($ext eq 'jpeg') {$ext = 'jpg'} + elsif ($ext eq 'htm') {$ext = 'html'} + elsif ($ext =~ /\.(cgi|pl|exe)/) {$ext = 'bix'} #Security! + + } else { + #Default is unknown. + $ext = 'bin'; + } + rename($post_attachment, + "$attach_dir/$forum-$message_name.$ext"); + open(WRITEATTACH, + ">$forum_dir/$message_name.attach") || + &CgiDie("Could Not Open Attachment\n"); + print WRITEATTACH + "$forum-$message_name.$ext" . + "|$post_attachment_filename\n"; + close(WRITEATTACH); } else { - unlink("$post_attachment"); + unlink("$post_attachment"); } - + # # The following handles the email system #