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

Password check

parent 6343e747
No related branches found
No related tags found
No related merge requests found
......@@ -25,7 +25,7 @@ if (isset($_POST['submitchangepassword'])) {
// Don't rely on php PRNG
$newpassword = exec("openssl rand -base64 32 | tr -dc A-Za-z0-9 | head -c 10 ; echo -n ''");
if ((preg_match('/[^A-Za-z0-9]/', $newpassword)) && (strlen($newpassword)>9)) {
if ((preg_match('/^[a-z\d_]$/i', $newpassword)) && (strlen($newpassword)>9)) {
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