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

Don't need to check password

parent 022dc6c8
No related branches found
No related tags found
No related merge requests found
...@@ -13,15 +13,13 @@ if (isset($_POST['submitnewuser'])) { ...@@ -13,15 +13,13 @@ if (isset($_POST['submitnewuser'])) {
else { else {
// Don't rely on php PRNG // 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("openssl rand -base64 32 | tr -dc A-Za-z0-9 | head -c 10 ; echo -n ''");
if (preg_match('/^[a-z\d_]{8,32}$/i', $newpassword)) { $new_user_file = fopen(".new_user.txt", "w") or die("Unable to write to new_user file");
$new_user_file = fopen(".new_user.txt", "w") or die("Unable to write to new_user file"); fwrite($new_user_file, $username.",".$newpassword);
fwrite($new_user_file, $username.",".$newpassword); fclose($new_user_file);
fclose($new_user_file);
exec('cp new_user_confirm_template.html new_user_confirm.html'); exec('cp new_user_confirm_template.html new_user_confirm.html');
exec('sed -i "s|NEWPASSWORD|'.$newpassword.'|g" new_user_confirm.html'); exec('sed -i "s|NEWPASSWORD|'.$newpassword.'|g" new_user_confirm.html');
$output_filename = "new_user_confirm.html"; $output_filename = "new_user_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