MY CHANGE DO FOLLOWING. PLEASE DO ALL CHANGES.UPDATE 11.10.2010 - 08:15 - ALL MY CHANGES. The rest is deleted.Tested with FF 3.6
IE 6
IE 8- Use Password Check in the Controlpanel.
- Password_1 / Password_2 Input flields empty, then the signs not show.
- EMail_1 / EMail_2 Input fields empty, then the signs not show.
- check the valid of the email-adress
- if invalid email-adress, then show a text next the first email field
- It inspect the password. I Looks that
- the pw is 6 Signs long
- the pw has 1 little a-z (german äöü)
- the pw has 1 Big A-Z (german ÄÖÜ)
- the pw has 1 Number 0-9
- the pw has 1 special character
Then It Shows a graphic.
Look @
Demo[1].OPEN templates/YOUR_TEMPLATE/member_editprofile.html[1].1 Find
<form method="post" action="{url_member}">
Replace with
<form method="post" action="{url_member}" name="password_form">
<script type="text/javascript" src="./js/verifynotify.js"></script>
[1].2 Find
<tr>
<td class="row2"><b>{lang_new_password}</b></td>
<td class="row2"><input type="password" name="user_password" size="30" class="input" /></td>
</tr>
<tr>
<td class="row1"><b>{lang_new_password_confirm}</b></td>
<td class="row1"><input type="password" name="user_password2" size="30" class="input" /></td>
</tr>
Replace with
<tr>
<td class="row1"><b>{lang_new_password}</b></td>
<td class="row1">
<input type="password" name="user_password" size="30" class="input" value="" onkeyup="checkPassword()"/>
<span style="position:absolute;z-index:2" class="row2" id="save_result"> </span>
</td>
</tr>
<tr>
<td class="row1"><b>{lang_new_password_confirm}</b></td>
<td class="row1" style="position:relative;z-index:1">
<input type="password" name="user_password_2" size="30" class="input" value="" onkeyup="checkPassword()"/>
<span style="position:absolute;z-index:2" class="row1" id="password_result"> </span></td>
</tr>
[2].OPEN templates/YOUR_TEMPLATE/register_form.html[2].1 Find
<tr>
<td class="row2"><b>{lang_password}</b></td>
<td class="row2">
<input type="password" name="user_password" size="30" class="input" />
</td>
</tr>
Replace with
<tr>
<td class="row2"><b>{lang_password}</b></td>
<td class="row2" style = "position:relative;z-index:1">
<input type="password" name="user_password" size="30" class="input" value="" onkeyup="checkPassword()"/>
<span style="position:absolute;z-index:2" class="row2" id="save_result"> </span>
</td>
</tr>
2.2 Find
<input type="text" name="user_email" size="30" class="input" value="{user_email}" onkeyup="checkMail()">
Add
after <span style="position:absolute;z-index:2" class="row2" id="valid_result"> </span>
[3].OPEN templates/YOUR_TEMPLATE/header.html[3].1 Find
-->
Add
before{password_strong_lang}
[4].OPEN lang/YOUR_LANGUAGE/main.php[for German use 4.1][for English use 4.2] [4].1 Find
?>
Add
before [GERMAN]
//-----------------------------------------------------
//--- Passwordsicherheit ------------------------------
//-----------------------------------------------------
$lang['pw_js_step_1'] = "zu kurz (mind. 6 Zeichen)";
$lang['pw_js_step_2'] = "schlecht";
$lang['pw_js_step_3'] = "gut";
$lang['pw_js_step_4'] = "stark";
$lang['pw_js_pw_strong'] = "Passwortstärke";
$lang['email_js_fail'] = "ungültige eMail-Adresse";
[4].2 Find
?>
Add
before [ENGLISH]
//-----------------------------------------------------
//--- password strength -------------------------------
//-----------------------------------------------------
$lang['pw_js_step_1'] = "to short (not less than 6 Signs)";
$lang['pw_js_step_2'] = "bad";
$lang['pw_js_step_3'] = "good";
$lang['pw_js_step_4'] = "strong";
$lang['pw_js_pw_strong'] = "password strength";
$lang['email_js_fail'] = " invalid email address";
[5].OPEN includes/page_header.php[5].1 Find
// Replace Globals in $lang
$lang = $site_template->parse_array($lang);
Add
after$password_js_vars = " var step_1 = \"".$lang['pw_js_step_1']."\";\n";
$password_js_vars .= " var step_2 = \"".$lang['pw_js_step_2']."\";\n";
$password_js_vars .= " var step_3 = \"".$lang['pw_js_step_3']."\";\n";
$password_js_vars .= " var step_4 = \"".$lang['pw_js_step_4']."\";\n";
$password_js_vars .= " var pw_strong = \"".$lang['pw_js_pw_strong']."\";\n";
$password_js_vars .= " var email_valid = \"".$lang['email_js_fail']."\";\n";
[5].2 Find
"direction" => $lang['direction']
Replace with
"direction" => $lang['direction'],
###########################################################
# PASSOWRD TEST #
"password_strong_lang" => $password_js_vars
###########################################################
[6].OPEN js/verifynotisy.js[6].1 Find
var nomatch_html = "<img src=\"js/no.png\">";
Add
after var save_1_html = " <img src=\"js/02.png\"><img src=\"js/01.png\"><img src=\"js/01.png\"><img src=\"js/01.png\"><img src=\"js/01.png\">";
var save_2_html = " <img src=\"js/02.png\"><img src=\"js/02.png\"><img src=\"js/01.png\"><img src=\"js/01.png\"><img src=\"js/01.png\">";
var save_3_html = " <img src=\"js/03.png\"><img src=\"js/03.png\"><img src=\"js/03.png\"><img src=\"js/01.png\"><img src=\"js/01.png\">";
var save_4_html = " <img src=\"js/03.png\"><img src=\"js/03.png\"><img src=\"js/03.png\"><img src=\"js/03.png\"><img src=\"js/01.png\">";
var save_5_html = " <img src=\"js/04.png\"><img src=\"js/04.png\"><img src=\"js/04.png\"><img src=\"js/04.png\"><img src=\"js/04.png\">";
function validEmail(email) {
var strReg = "^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$";
var regex = new RegExp(strReg);
return(regex.test(email));
}
6.2 Find
password_id = "password_result";
Add
after save_id = "save_result";
6.3 Find
r = document.getElementById(this.password_id);
Add
after s = document.getElementById(this.save_id);
if ((document.password_form.user_password.value == ""))
{
s.innerHTML = "";
document.password_form.user_password_2.value = "";
document.password_form.user_password.focus();
}
else
{
score = 0;
if(document.password_form.user_password.value.match(/[a-zäöü]{1,}/)) {score = score + 1;}
if(document.password_form.user_password.value.match(/[A-ZÄÖÜ]{1,}/)) {score = score + 1;}
if(document.password_form.user_password.value.match(/\d{1,}/)) {score = score + 1;}
if(document.password_form.user_password.value.match(/\W/)) {score = score + 1;}
if (document.password_form.user_password.value.length >= 6)
{
if (score == 4)
{
s.innerHTML = this.save_5_html + " <b>" + pw_strong + "</b>: " + step_4 + " ";
}
else if (score == 3)
{
s.innerHTML = this.save_4_html + " <b>" + pw_strong + "</b>: " + step_3 + " ";
}
else if (score == 2)
{
s.innerHTML = this.save_3_html + " <b>" + pw_strong + "</b>: " + step_3 + " ";
}
else if (score == 1)
{
s.innerHTML = this.save_2_html + " <b>" + pw_strong + "</b>: " + step_2 + " " ;
}
}
else
{
s.innerHTML = this.save_1_html + " <b>" + pw_strong + "</b>: " + step_1 + " ";
}
}
6.3 Find
if (document.password_form.user_password.value != "" && document.password_form.user_password.value == document.password_form.user_password_2.value) {
Replace with
if ((document.password_form.user_password.value == "") && (document.password_form.user_password_2.value == ""))
{
r.innerHTML = "";
}
else if (document.password_form.user_password.value != "" && document.password_form.user_password.value == document.password_form.user_password_2.value) {
6.4 Find
email_id = "email_result";
Add
after valid_id = "valid_result";
6.5 Find
r = document.getElementById(this.email_id);
Add
after s = document.getElementById(this.valid_id);
if (!s){ return false;}
6.6 Find
if (!r){ return false; }
if (this.field_email.value != "" && this.field_email.value == this.field_email2.value) {
r.innerHTML = this.match_html;
}
else {
r.innerHTML = this.nomatch_html;
}
Replace with
if (!validEmail(this.field_email.value) && this.field_email.value == "")
{
r.innerHTML = "";
s.innerHTML = "";
}
else if (!validEmail(this.field_email.value))
{
r.innerHTML = this.nomatch_html;
s.innerHTML = "<b>" + email_valid + "</b>";
}
else
{
if ((this.field_email.value == "") && (this.field_email2.value == ""))
{
r.innerHTML = "";
s.innerHTML = "";
}
else if (this.field_email.value != "" && this.field_email.value == this.field_email2.value)
{
r.innerHTML = this.match_html;
s.innerHTML = "";
}
else
{
r.innerHTML = this.nomatch_html;
s.innerHTML = "";
}
}
Save 01.png/02.png/03.png/04.png. Copy the 4 Files into
/js/!
Please Say Thanks or Say what is not good.
[UPDATE]
my function validEmail()
say OK when email Adress is following
name@example.com
or
name@exampel
because
http://forum.de.selfhtml.org/archiv/2003/4/t43470/#m237448
Maybe SomeOne will update my Function.