Minor code cleanup in mail.php and user.php

This commit is contained in:
Retro_Guy 2021-11-13 04:37:33 +00:00
parent 82f4bdf4f0
commit 1f9344bbe9
2 changed files with 5 additions and 4 deletions

View File

@ -13,7 +13,6 @@ include "newsportal.php";
$keyfile = $spooldir.'/keys.dat';
$keys = unserialize(file_get_contents($keyfile));
include "head.inc";
// How long should cookie allow user to stay logged in?
// 14400 = 4 hours
@ -42,6 +41,8 @@ include "head.inc";
$logged_in = true;
}
}
include "head.inc";
echo '<h1 class="np_thread_headline">';
echo '<a href="mail.php" target='.$frame['menu'].'>mail</a> / ';
@ -77,7 +78,7 @@ if(isset($_POST['username'])) {
$name = $_POST['username'];
// Save name in cookie
if ($setcookies==true) {
setcookie("mail_name",stripslashes($name),time()+(3600*24*90));
setcookie("mail_name",stripslashes($name),time()+(3600*24*90),"/");
}
} else {
if ($setcookies) {
@ -176,7 +177,7 @@ echo '</table>';
$dbh = null;
}
if (isSet($_POST['sendMessage'])) {
if (isset($_POST['sendMessage'])) {
if (isSet($_POST['to']) && $_POST['to'] != '' && isSet($_POST['from']) && $_POST['from'] != '' && isSet($_POST['message']) && $_POST['message'] != '') {
if(($to = get_config_value('aliases.conf', strtolower($_POST['to']))) == false) {
$to = strtolower($_POST['to']);

View File

@ -64,7 +64,7 @@ echo '<table cellpadding="0" cellspacing="0" class="np_buttonbar"><tr>';
if($logged_in == true) {
echo '<td>';
echo '<form target="'.$frame['content'].'" method="post" action="mail.php">';
echo '<input name="command" type="hidden" id="command" value="Message" readonly="readonly">';
echo '<input name="command" type="hidden" id="command" value="Mail" readonly="readonly">';
echo "<input type='hidden' name='username' value='".$_POST['username']."' />";
echo "<input type='hidden' name='password' value='".$_POST['password']."' />";
echo '<button class="np_button_link" type="submit">Mail</button>';