#!/usr/bin/perl
#############################################################
# Ikonboard v2.1
# Copyright 2001 Ikonboard.com - All Rights Reserved
# Ikonboard is a trademark of Ikonboard.com
#
# Software Distributed by: Ikonboard.com
# Visit us online at http://www.ikonboard.com
# Email us on boards@ikonboard.com
#
# All files written by Matthew Mecham
#############################################################
use CGI::Carp "fatalsToBrowser"; # Output errors to browser
use CGI qw(:standard); # Saves loads of work
$CGI::POST_MAX=1024 * 150; # limit post data
$CGI::DISABLE_UPLOADS = 1; # Disable uploads
eval {
($0 =~ m,(.*)/[^/]+,) and unshift (@INC, "$1");
($0 =~ m,(.*)\\[^\\]+,) and unshift (@INC, "$1");
require "ikon.lib"; # Require ikonboard ()
require "data/progs.cgi"; # Require prog names
require "data/boardinfo.cgi";# Require board info
require "data/styles.cgi"; # Require styles info
require "ikonmail.lib"; # Require email func ()
};
if ($@) {
print header(); print start_html(-title=>"Ikonboard Error!");
print "Could not find these files: $@\nIf you are running NT you may need to enter the full path in each require statement in each script";
print end_html; exit;
}
$|++; # Unbuffer the output
#################--- Begin the program ---###################
$thisprog = "ikonfriend.cgi";
$query = new CGI;
$inforum = $query -> param('forum');
$intopic = $query -> param('topic');
$action = $query -> param('action');
$inrealname = $query -> param('realname');
$intoname = $query -> param('toname');
$infromemail = $query -> param('fromemail');
$intoemail = $query -> param('toemail');
$insubject = $query -> param('subject');
$inemailmessage = $query -> param('emailmessage');
$emailtopictitle = $query -> param('emailtopictitle');
$inrealname = &cleaninput($inrealname);
$insubject = &cleaninput($insubject);
$inemailmessage = &cleaninput($inemailmessage);
$emailtopictitle = &cleaninput($emailtopictitle);
$inforum = &cleaninput($inforum);
$intopic = &cleaninput($intopic);
$inmembername = cookie("amembernamecookie");
$inpassword = cookie("apasswordcookie");
print header(-charset=>'windows-1256');
if (($inforum) && ($inforum !~ /^[0-9]+$/)) { &error("General&Please do not modify the URL's generated."); }
if (($intopic ) && ($intopic !~ /^[0-9]+$/)) { &error("General&Please do not modify the URL's generated."); }
&title;
$output .= qq~
~;
### Do we have email functions for this board?
if ($emailfunctions ne "on") { &error("ارسال موضوع لصديق&Sorry, the board administrator has email functions disabled"); }
if ($action eq "send") {
### Check for blank fields and invalid email addresses
$blankfields = "";
if(!$inrealname) { $blankfields = "yes"; }
elsif(!$intoname) { $blankfields = "yes"; }
elsif(!$intoemail) { $blankfields = "yes"; }
elsif(!$infromemail) { $blankfields = "yes"; }
elsif(!$insubject) { $blankfields = "yes"; }
elsif(!$inemailmessage) { $blankfields = "yes"; }
if ($blankfields) {
&error("ارسال موضوع لصديق&الرجاء التاكد من صحة كافة المعلومات قبل الارسال");
}
if ($infromemail !~ /^.+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,3}|[0-9]{1,3})(\]?)$/) { &error("ارسال موضوع لصديق&خطا في الايميل"); }
if ($intoemail !~ /^.+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,3}|[0-9]{1,3})(\]?)$/) { &error("ارسال موضوع لصديق&خطا في الايميل"); }
### If were still here, lets send the email
$to = "$intoemail";
$from = "$boardname <$infromemail>";
$subject = "$insubject";
$message .= "\n";
$message .= "$boardname\n";
$message .= "$boardurl/$forumsummaryprog\n";
$message .= "Ikonfriend from Ikonboard\n";
$message .= "---------------------------------------------------------------------\n\n";
$message .= "$inrealname sent you this email from $homename\n";
$message .= "---------------------------------------------------------------------\n\n";
$message .= "$inemailmessage\n\n";
$message .= "Topic Title: $emailtopictitle\n\n\n";
$message .= "$boardurl/$threadprog?forum=$inforum&topic=$intopic\n";
$message .= "---------------------------------------------------------------------\n\n";
$message .= "$homename can take no liability for messages emailed by the users\n";
$message .= "of the bulletin board.\n\n";
$message .= "Ikonboard (c)2000 Ikonboard.com\n";
&sendmail($from, $from, $to, $SMTP_SERVER, $subject, $message);
### Print message to user
$output .= qq~
لقد تم ارسال الايميل |
ماذا تريد ان تعمل الان؟
|
|
~;
} # end if action
else {
### Get Details
$filetoopen = "$ikondir" . "data/allforums.cgi";
$filetoopen = &stripMETA($filetoopen);
open(FILE, "$filetoopen");
flock FILE,2;
@forums = ;
close(FILE);
foreach $forumline (@forums) { #start foreach @forums
($tempno, $trash) = split(/\|/,$forumline);
if ($inforum eq $tempno) {
($forumid, $category, $categoryplace, $forumname, $forumdescription, $forummoderator ,$htmlstate ,$idmbcodestate ,$privateforum, $startnewthreads ,$lastposter ,$lastposttime, $threads, $posts, $forumgraphic) = split(/\|/,$forumline);
}
}
$filetoopen = "$ikondir" . "forum$inforum/list.cgi";
$filetoopen = &stripMETA($filetoopen);
open(FILE, "$filetoopen");
flock FILE,1;
@allthreads = ;
close(FILE);
foreach $line (@allthreads) { #start foreach @threads
($tempno, $trash) = split(/\|/, $line);
if ($intopic eq $tempno) {
$linetokeep = $line;
}
} # end foreach
($topicid, $topictitle, $topicdescription, $threadstate, $threadposts ,$threadviews, $startedby, $startedpostdate, $lastposter, $lastpostdate) = split(/\|/,$linetokeep);
### print form
$topictitle = &cleanarea("$topictitle");
$output .= qq~