Allow browser to remember Username in post.php.

This commit is contained in:
Retro_Guy 2024-11-12 07:47:04 -07:00
parent 7a0e610b22
commit 96f62762d6
1 changed files with 7 additions and 17 deletions

View File

@ -45,8 +45,8 @@ $logfile = $logdir . '/post.log';
@$group = $_REQUEST["group"]; @$group = $_REQUEST["group"];
@$type = $_REQUEST["type"]; @$type = $_REQUEST["type"];
@$subject = stripslashes($_POST[md5($fieldnamedecrypt . "subject")]); @$subject = stripslashes($_POST[md5($fieldnamedecrypt . "subject")]);
@$name = $_POST[md5($fieldnamedecrypt . "name")]; @$name = $_POST["username"];
@$email = $_POST[md5($fieldnamedecrypt . "email")]; @$password = $_POST[md5($fieldnamedecrypt . "password")];
@$body = $_POST[md5($fieldnamedecrypt . "body")]; @$body = $_POST[md5($fieldnamedecrypt . "body")];
@$abspeichern = $_REQUEST["abspeichern"]; @$abspeichern = $_REQUEST["abspeichern"];
@$references = $_REQUEST["references"]; @$references = $_REQUEST["references"];
@ -64,7 +64,7 @@ $max_followupto = 1;
// Check some header strings for bad characters // Check some header strings for bad characters
$newsgroups = sanitize_header($newsgroups); $newsgroups = sanitize_header($newsgroups);
$subject = trim(sanitize_header($subject)); $subject = trim(sanitize_header($subject));
$email = sanitize_header($email); $password = sanitize_header($password);
// Load name from cookies // Load name from cookies
if ($setcookies) { if ($setcookies) {
@ -186,22 +186,12 @@ if ((function_exists("npreg_group_has_read_access") && ! npreg_group_has_read_ac
die("access denied"); die("access denied");
} }
// Load name and email from the registration system, if available
if (function_exists("npreg_get_name")) {
$name = npreg_get_name();
}
if (function_exists("npreg_get_email")) {
$email = npreg_get_email();
$form_noemail = true;
}
if (! strcmp($name, $CONFIG['anonusername']) && (isset($CONFIG['anonuser']))) { if (! strcmp($name, $CONFIG['anonusername']) && (isset($CONFIG['anonuser']))) {
$userpass = $CONFIG['anonuserpass']; $userpass = $CONFIG['anonuserpass'];
$email = $name . $CONFIG['email_tail']; $email = $name . $CONFIG['email_tail'];
$_SESSION['pass'] = false; $_SESSION['pass'] = false;
} else { } else {
$userpass = $email; $userpass = $password;
$request = "email"; $request = "email";
$get_email = get_user_config($name, $request); $get_email = get_user_config($name, $request);
if ($get_email === FALSE) { if ($get_email === FALSE) {
@ -563,7 +553,7 @@ if ($show == 1) {
echo '<td class="np_post_header_instructions">'; echo '<td class="np_post_header_instructions">';
if (! isset($name) && $CONFIG['anonuser']) if (! isset($name) && $CONFIG['anonuser'])
$name = $CONFIG['anonusername']; $name = $CONFIG['anonusername'];
echo '<input class="post" type="text" name="' . md5($fieldencrypt . "name") . '"'; echo '<input class="post" type="text" name="username"';
if (isset($name)) if (isset($name))
echo ' value="' . htmlspecialchars($name) . '"'; echo ' value="' . htmlspecialchars($name) . '"';
if ($logged_in && isset($name)) { if ($logged_in && isset($name)) {
@ -581,10 +571,10 @@ if ($show == 1) {
echo '<td class="np_post_header_password"><b>' . $text_post["password"] . '</b></td>'; echo '<td class="np_post_header_password"><b>' . $text_post["password"] . '</b></td>';
echo '<td class = "np_post_header_instructions">'; echo '<td class = "np_post_header_instructions">';
if ($logged_in && isset($name)) { if ($logged_in && isset($name)) {
echo '<input class="post" type="password" name="' . md5($fieldencrypt . "email") . '" value="**********"'; echo '<input class="post" type="password" name="' . md5($fieldencrypt . "password") . '" value="**********"';
echo ' size="40" maxlength="40" readonly>'; echo ' size="40" maxlength="40" readonly>';
} else { } else {
echo '<input class="post" type="password" name="' . md5($fieldencrypt . "email") . '"'; echo '<input class="post" type="password" name="' . md5($fieldencrypt . "password") . '"';
echo ' size="40" maxlength="40">'; echo ' size="40" maxlength="40">';
} }
echo '</td>'; echo '</td>';