<?php
// ======================================================================== //
//                                                                          //
//   KooBI- Webportalsystem                                                 //
//   SCRiPTMAFiA 2005 - THE DiRTY HANDS ON YOUR SCRiPTS                     //
//                                                                          //
//   ====================================================================   //
//                                                                          //   
//   dream4 | webservices - Am Michelsgrund 7 - 69469 Weinheim - Germany    //    
//   tel. +49(0) 6201 - 980442 / fax. +49(0) 6201 - 64809                   //
//                                                                          //
// ======================================================================== //
if(!checkactive('tell')) include(dirname(__FILE__)."/lib/notactive.php" );
$sname = simpletitle($lang['pagetell_title']);
$tmpl->assign('lang', $lang);
$tmpl->assign('area', $area);
$tmpl->assign('page', $HTTP_SERVER_VARS['HTTP_REFERER']);

if (!permission("tell")) {
	$EOUT = stderror("nopermission", $lang['nopermission_t'], str_replace("__URL__", "index.php", $lang['redirect']), "index.php", 1);
	$error = 1;
	$NOOUT = 1;
}

if($_REQUEST['action']=="send"){
	$message = str_replace("__PAGE__", $_REQUEST['page'], $lang['pagetell_text']);
	$message = str_replace("__USER__", $_REQUEST['name'], $message);
	$message = str_replace("__EMAIL__", $_REQUEST['email_abs'], $message);
	
	
	$body = str_replace("\n","\n\n", $message);
	@mail($pref['sendemail'], $lang['pagetell_subject'], stripslashes($body),
			"From: $pref[sendemail]\r\n"
			."Reply-To: $pref[sendemail]\r\n"
			."X-Mailer: PHP/" . phpversion());
			
	
	header("Location:index.php?p=tell&area=".$_REQUEST['area']."&action=ok");
}
$tmpl->assign("content", parsetrue("container/".container("tell"), $lang['pagetell_title'], $tmpl->fetch("mail/tell.tpl")));
?>