Skip to content
Snippets Groups Projects
Commit a99b9ce8 authored by Jared Hancock's avatar Jared Hancock
Browse files

login: Send 401 to signal browser not to save creds

parent c9aa00f5
No related branches found
No related tags found
No related merge requests found
...@@ -32,7 +32,7 @@ class Http { ...@@ -32,7 +32,7 @@ class Http {
endswitch; endswitch;
} }
function response($code,$content,$contentType='text/html',$charset='UTF-8') { function response($code,$content=false,$contentType='text/html',$charset='UTF-8') {
header('HTTP/1.1 '.Http::header_code_verbose($code)); header('HTTP/1.1 '.Http::header_code_verbose($code));
header('Status: '.Http::header_code_verbose($code)."\r\n"); header('Status: '.Http::header_code_verbose($code)."\r\n");
......
...@@ -14,7 +14,7 @@ $info = ($_POST && $errors)?Format::htmlchars($_POST):array(); ...@@ -14,7 +14,7 @@ $info = ($_POST && $errors)?Format::htmlchars($_POST):array();
</a></h1> </a></h1>
<h3><?php echo Format::htmlchars($msg); ?></h3> <h3><?php echo Format::htmlchars($msg); ?></h3>
<div class="banner"><small><?php echo ($content) ? Format::display($content->getLocalBody()) : ''; ?></small></div> <div class="banner"><small><?php echo ($content) ? Format::display($content->getLocalBody()) : ''; ?></small></div>
<form action="login.php" method="post"> <form action="login.php" method="post" id="login">
<?php csrf_token(); ?> <?php csrf_token(); ?>
<input type="hidden" name="do" value="scplogin"> <input type="hidden" name="do" value="scplogin">
<fieldset> <fieldset>
......
...@@ -122,6 +122,11 @@ if (!$nav) { ...@@ -122,6 +122,11 @@ if (!$nav) {
$nav = new UserNav(); $nav = new UserNav();
$nav->setActiveNav('status'); $nav->setActiveNav('status');
} }
// Browsers shouldn't suggest saving that username/password
Http::response(401);
header('WWW-Authenticate: html-form id=clientLogin');
require CLIENTINC_DIR.'header.inc.php'; require CLIENTINC_DIR.'header.inc.php';
require CLIENTINC_DIR.$inc; require CLIENTINC_DIR.$inc;
require CLIENTINC_DIR.'footer.inc.php'; require CLIENTINC_DIR.'footer.inc.php';
......
...@@ -70,6 +70,10 @@ elseif (!$thisstaff || !($thisstaff->getId() || $thisstaff->isValid())) { ...@@ -70,6 +70,10 @@ elseif (!$thisstaff || !($thisstaff->getId() || $thisstaff->isValid())) {
@header("Location: $dest"); @header("Location: $dest");
} }
// Browsers shouldn't suggest saving that username/password
Http::response(401);
header('WWW-Authenticate: html-form id=login');
define("OSTSCPINC",TRUE); //Make includes happy! define("OSTSCPINC",TRUE); //Make includes happy!
include_once(INCLUDE_DIR.'staff/login.tpl.php'); include_once(INCLUDE_DIR.'staff/login.tpl.php');
?> ?>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment