Hack Name: Password Checker v1.0

Description: This modification 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 editor page.

Compatibility: XMB 1.9.8 Engage Final SP2

Updated for 1.9.8 by: WormHole @ XMB Garage

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

Upload to the /js/ directory
 - passwdcheck.js
----------------------------------------------------------------------


Edit PHP File: member.php

Find:
----------------------------------------------------------------------

        if (noSubmit('regsubmit')) {

----------------------------------------------------------------------
Replace With:
----------------------------------------------------------------------

        if (noSubmit('regsubmit')) {
            // Password Checker Mod Begin
            $css .= '<link rel="stylesheet" type="text/css" media="screen" href="include/passwdcheck.css" /><script type="text/javascript" src="js/passwdcheck.js"></script>';
            // Password Checker Mod End

----------------------------------------------------------------------


Edit PHP File: memcp.php

Find:
----------------------------------------------------------------------

if ($action == 'profile') {

----------------------------------------------------------------------
Replace With:
----------------------------------------------------------------------

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

----------------------------------------------------------------------


Edit language file: English.lang.php

Add to end of file above ?>
----------------------------------------------------------------------

// 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 class="tablerow">
<td bgcolor="$THEME[altbg1]">$lang[textpassword]</td>
<td bgcolor="$THEME[altbg2]"><input type="password" name="password" size="25" onkeyup="EvalPwdStrength(document.forms[0],this.value);" /></td>
</tr>

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

<tr class="tablerow">
<td bgcolor="$THEME[altbg1]" width="22%">$lang[pwdChk_0]</td>
<td bgcolor="$THEME[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 bgcolor="$altbg2"><input type="password" name="newpasswordcf" size="25" /></td>
</tr>

----------------------------------------------------------------------
Add Below:
----------------------------------------------------------------------

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

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

<tr class="tablerow">
<td bgcolor="$THEME[altbg1]" width="22%">$lang[pwdChk_0]</td>
<td bgcolor="$THEME[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>

----------------------------------------------------------------------
Enjoy!
----------------------------------------------------------------------