@ -37,43 +37,29 @@ authentication_require_role('admin');
(($CONF['sendmail'] == 'NO') ? header("Location: " . $CONF['postfix_admin_url'] . "/main.php") & & exit : '1');
(($CONF['sendmail'] == 'NO') ? header("Location: " . $CONF['postfix_admin_url'] . "/main.php") & & exit : '1');
$SESSID_USERNAME = authentication_get_username();
$SESSID_USERNAME = authentication_get_username();
if ($_SERVER['REQUEST_METHOD'] == "GET")
{
include ("./templates/header.tpl");
include ("./templates/menu.tpl");
include ("./templates/sendmail.tpl");
include ("./templates/footer.tpl");
}
if ($_SERVER['REQUEST_METHOD'] == "POST")
if ($_SERVER['REQUEST_METHOD'] == "POST")
{
{
if (isset ($_POST['fTo'])) $fTo = escape_string ($_POST['fTo'] );
$fTo = safepost('fTo');
$fFrom = $SESSID_USERNAME;
$fFrom = $SESSID_USERNAME;
if (isset ($_POST['fTo'])) $fHeaders = "To: " . $fTo . "\n";
$fHeaders = "To: " . $fTo . "\n";
if (isset ($_POST['fTo'])) $fHeaders .= "From: " . $fFrom . "\n";
$fHeaders .= "From: " . $fFrom . "\n";
if (!empty ($PALANG['charset']))
$fHeaders .= "Subject: " . encode_header(safepost('fSubject')) . "\n";
{
$fHeaders .= "MIME-Version: 1.0\n";
$fHeaders .= "Subject: " . encode_header (escape_string ($_POST['fSubject']), $PALANG['charset']) . "\n";
$fHeaders .= "Content-Type: text/plain; charset=utf-8\n";
$fHeaders .= "MIME-Version: 1.0\n";
$fHeaders .= "Content-Transfer-Encoding: 8bit\n";
$fHeaders .= "Content-Type: text/plain; charset=" . $PALANG['charset'] . "\n";
$fHeaders .= "Content-Transfer-Encoding: 8bit\n";
}
else
{
$fHeaders .= "Subject: " . escape_string ($_POST['fSubject']) . "\n\n";
}
$fHeaders .= escape_string ($_POST['fBody']);
$fHeaders .= escape_string ($_POST['fBody']);
if (empty ($fTo) or !check_email ($fTo))
if (empty ($fTo) or !check_email ($fTo))
{
{
$error = 1;
$error = 1;
$tTo = escape_string ($_POST['fTo']);
$tTo = escape_string ($_POST['fTo']);
$tSubject = escape_string ($_POST['fSubject']);
$tSubject = escape_string ($_POST['fSubject']);
$tBody = escape_string ($_POST['fBody']);
$tBody = escape_string ($_POST['fBody']);
$tMessage = $PALANG['pSendmail_to_text_error'];
$tMessage = $PALANG['pSendmail_to_text_error'];
}
}
if ($error != 1)
if ($error != 1)
{
{
@ -86,10 +72,12 @@ if ($_SERVER['REQUEST_METHOD'] == "POST")
$tMessage .= $PALANG['pSendmail_result_success'];
$tMessage .= $PALANG['pSendmail_result_success'];
}
}
}
}
include ("./templates/header.tpl");
include ("./templates/menu.tpl");
include ("./templates/sendmail.tpl");
include ("./templates/footer.tpl");
}
}
include ("./templates/header.tpl");
include ("./templates/menu.tpl");
include ("./templates/sendmail.tpl");
include ("./templates/footer.tpl");
/* vim: set expandtab softtabstop=3 tabstop=3 shiftwidth=3: */
?>
?>