Random generate a "pronounceable" password for your users.
This modification is in the archives.
Since VB3's expire function for passwords, you can now force your members to change password. But very often, people tend to forget their recently changed password.
Also, if you add the "history" option, people will have to come up with a new password everytime and that particular detail is not always appreciated. One thing to do is random generate a password but you can be sure you users will never remember this one. So I came up with the idea to random generate an "easy to remember" password. A while back I read on php.net about a small piece of code that generates a "pronouncable" password which is easier to remember, so I decided to integrate this function into vB. What the hack does is add a link in the "Change password" page which makes the page auto-generate a "pronounceable" password. Also, it changes the inputfields from passwordfields to regular textfields. In the first passwordfield, the generated password is placed. The second field will still be empty so the user will have to retype the password. Changes to do: -file edits (2) -template edits (1) -adding phrases (1) Installation: Open admincp/functions_user.php and look for: PHP Code:
return $word;
PHP Code:
// ############ Extra function to create random pronouncable password ##########
Open profile.php and look for: PHP Code:
// show Optional because password expired
PHP Code:
if ($_REQUEST['extra'] == 'genrandom') {
In the template "modifypassword", look for: PHP Code:
<input type="password" class="bginput" name="newpassword" size="50" maxlength="50" />
PHP Code:
<input type="$passwordfield" class="bginput" name="newpassword" size="50" maxlength="50" value="$randompass" />
PHP Code:
<input type="password" class="bginput" name="newpasswordconfirm" size="50" maxlength="50" />
PHP Code:
<input type="$passwordfield" class="bginput" name="newpasswordconfirm" size="50" maxlength="50" />
Add the following phrase: Code:
Phrase Type: User tools (global) Varname: generate_random_password Text: <a href="profile.php?s={$session['sessionhash']}&do=editpassword&extra=genrandom">Click here to have a random password generated for you.</a> That's it! Small note: A 7 char "pronounceable" password is generated every time. If you want more or less characters, all you have to do is change this value in admincp/functions_user.php: PHP Code:
$num_letters = 7; //The number of letters
Download No files for download. Screenshots
|