Skip to content
Snippets Groups Projects
Commit 0a8f8d8f authored by Bob Mottram's avatar Bob Mottram
Browse files

Switch to diceware passwords

parent 657e4301
No related branches found
No related tags found
No related merge requests found
......@@ -23,8 +23,7 @@ if (isset($_POST['submitremoveuser'])) {
if (isset($_POST['submitchangepassword'])) {
$username = htmlspecialchars($_POST['myuser']);
// Don't rely on php PRNG
$newpassword = exec("openssl rand -base64 32 | tr -dc A-Za-z0-9 | head -c 10 ; echo -n ''");
$newpassword = exec("diceware");
exec('cp password_confirm_template.html password_confirm.html');
exec('sed -i "s|USERNAME|'.$username.'|g" password_confirm.html');
exec('sed -i "s|NEWPASSWORD|'.$newpassword.'|g" password_confirm.html');
......
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