Hack Name: Password Checker v1.0

Description: This hack will add a Password Checker to your forum. It will check members passwords to see how strong it is. This check will be performed on the registration page and the member profile.

Compatibility: XMB 1.9.5 - Nexus

Version: 1.0

Code based on coding from: http://www.microsoft.com/
Modified for XMB compatiblity by: FunForum

License Note: This mod is released under the GPL License.

Note: For your own safety, backup the effected PHP file and template before proceeding with this hack.
=============================================================================================================

Upload to the /include/ directory:
 - passwdcheck.css
 - passwdcheck.js


Edit PHP File: member.php

Find:
----------------------------------------------------------------------
    if (!isset($regsubmit)) {
        eval('echo "'.template('header').'";');
        if ($bbrules == "on" && !isset($rulesubmit)) {
----------------------------------------------------------------------
Replace With:
----------------------------------------------------------------------
    if (!isset($regsubmit)) {
        $css .= '<link rel="stylesheet" type="text/css" media="screen" href="include/passwdcheck.css" /><script type="text/javascript" src="include/passwdcheck.js"></script>';
        eval('echo "'.template('header').'";');
        if ($bbrules == "on" && !isset($rulesubmit)) {
----------------------------------------------------------------------


Edit PHP File: memcp.php

Find:
----------------------------------------------------------------------
// Start Profile Editor Code
if ($action == "profile") {
----------------------------------------------------------------------
Add Above:
----------------------------------------------------------------------

// Password Checker Mod Begin
// Start Profile Editor Code
if ($action == "profile") {
    $css .= '<link rel="stylesheet" type="text/css" media="screen" href="include/passwdcheck.css" /><script type="text/javascript" src="include/passwdcheck.js"></script>';
// Password Checker Mod End
----------------------------------------------------------------------


Edit language file: English.lang.php

Add to bottom:
----------------------------------------------------------------------

// Password Checker Mod Begin
$lang['pwdChk_0'] = 'Password Strength:';
$lang['pwdChk_1'] = 'Weak';
$lang['pwdChk_2'] = 'Not rated';
$lang['pwdChk_3'] = 'Medium';
$lang['pwdChk_4'] = 'Strong';
$lang['pwdChk_5'] = 'Best';
$lang['pwdChk_6'] = '<strong>Note:</strong> Password Checker can help you to gauge the strength of your password. It is for personal reference only. Password Checker does not guarantee the security of the password itself.';
// Password Checker Mod End
----------------------------------------------------------------------


Edit Template: member_reg_password

Replace With:
----------------------------------------------------------------------
<tr>
<td class="tablerow altbg1">$lang[textpassword]</td>
<td class="tablerow altbg2"><input type="password" name="password" size="25" onkeyup="EvalPwdStrength(document.forms[0],this.value);" /></td>
</tr>

<tr>
<td class="tablerow altbg1">$lang[textretypepw]</td>
<td class="tablerow altbg2"><input type="password" name="password2" size="25" /></td>
</tr>


<tr>
<td class="tablerow altbg1" width="22%">$lang[pwdChk_0]</td>
<td class="tablerow altbg2">
<table class="pwdChkTbl2" cellpadding="0" cellspacing="0" width="240">
<tr>
<td id="idSM1" class="pwdChkCon0 mediumtxt" align="center" width="25%">
<span id="idSMT1" class="mediumtxt" style="display: none;">$lang[pwdChk_1]</span>
</td>
<td id="idSM2" class="pwdChkCon0 mediumtxt" style="border-left: 1px solid rgb(255, 255, 255);" align="center" width="25%">
<span id="idSMT0" class="mediumtxt" style="display: inline; font-weight: normal; color: rgb(102, 102, 102);">$lang[pwdChk_2]</span>
<span id="idSMT2" class="mediumtxt" style="display: none;">$lang[pwdChk_3]</span>
</td>
<td id="idSM3" class="pwdChkCon0 mediumtxt" style="border-left: 1px solid rgb(255, 255, 255);" align="center" width="25%">
<span id="idSMT3" class="mediumtxt" style="display: none;">$lang[pwdChk_4]</span>
</td>
<td id="idSM4" class="pwdChkCon0 mediumtxt" style="border-left: 1px solid rgb(255, 255, 255);" align="center" width="25%">
<span id="idSMT4" class="mediumtxt" style="display: none;">$lang[pwdChk_5]</span>
</td>
</tr>
</table>
$lang[pwdChk_6]
</td>
</tr>
----------------------------------------------------------------------


Edit Template: memcp_profile

Find:
----------------------------------------------------------------------
<input type="password" name="newpassword" size="25" />
----------------------------------------------------------------------
Replace With:
----------------------------------------------------------------------
<input type="password" name="newpassword" size="25" onkeyup="EvalPwdStrength(document.forms[0],this.value);" />
----------------------------------------------------------------------

Find:
----------------------------------------------------------------------
<td class="tablerow altbg2"><input type="password" name="newpasswordcf" size="25" /></td>
</tr>
----------------------------------------------------------------------
Add Below:
----------------------------------------------------------------------
<tr>
<td class="tablerow altbg1" width="22%">$lang[pwdChk_0]</td>
<td class="tablerow altbg2">
<table class="pwdChkTbl2" cellpadding="0" cellspacing="0" width="240">
<tr>
<td id="idSM1" class="pwdChkCon0 mediumtxt" align="center" width="25%">
<span id="idSMT1" style="display: none;">$lang[pwdChk_1]</span>
</td>
<td id="idSM2" class="pwdChkCon0 mediumtxt" style="border-left: 1px solid rgb(255, 255, 255);" align="center" width="25%">
<span id="idSMT0" style="display: inline; font-weight: normal; color: rgb(102, 102, 102);">$lang[pwdChk_2]</span>
<span id="idSMT2" style="display: none;">$lang[pwdChk_3]</span>
</td>
<td id="idSM3" class="pwdChkCon0 mediumtxt" style="border-left: 1px solid rgb(255, 255, 255);" align="center" width="25%">
<span id="idSMT3" style="display: none;">$lang[pwdChk_4]</span>
</td>
<td id="idSM4" class="pwdChkCon0 mediumtxt" style="border-left: 1px solid rgb(255, 255, 255);" align="center" width="25%">
<span id="idSMT4" style="display: none;">$lang[pwdChk_5]</span>
</td>
</tr>
</table>
$lang[pwdChk_6]
</td>
</tr>
----------------------------------------------------------------------
Enjoy!
----------------------------------------------------------------------