Index: wp-admin/includes/user.php
===================================================================
--- wp-admin/includes/user.php	(revision 6752)
+++ wp-admin/includes/user.php	(working copy)
@@ -101,6 +101,9 @@
 	/* checking the password has been typed twice the same */
 	if ( $pass1 != $pass2 )
 		$errors->add( 'pass', __( '<strong>ERROR</strong>: Please enter the same password in the two password fields.' ), array( 'form-field' => 'pass1' ) );
+		
+	/* Check password strength */
+	if ( get_option("strong_passwords") == 1 && wp_test_password($pass1) != "") $errors->add( 'pass', __('<strong>ERROR</strong>: ') .wp_test_password($pass1), array( 'form-field' => 'pass1' ) );
 
 	if (!empty ( $pass1 ))
 		$user->user_pass = $pass1;
Index: wp-admin/js/password-strength-meter.js
===================================================================
--- wp-admin/js/password-strength-meter.js	(revision 6752)
+++ wp-admin/js/password-strength-meter.js	(working copy)
@@ -1,162 +1,71 @@
-// Password strength meter
-// This jQuery plugin is written by firas kassem [2007.04.05]
-// Firas Kassem  phiras.wordpress.com || phiras at gmail {dot} com
-// for more information : http://phiras.wordpress.com/2007/04/08/password-strength-meter-a-jquery-plugin/
-
-var shortPass = 'Too short'
-var badPass = 'Bad'
-var goodPass = 'Good'
-var strongPass = 'Strong'
-
-
-
-function passwordStrength(password,username)
+function passwordStrength(password)
 {
-    score = 0 
-    
-    //password < 4
-    if (password.length < 4 ) { return shortPass }
-    
-    //password == username
-    if (password.toLowerCase()==username.toLowerCase()) return badPass
-    
-    //password length
-    score += password.length * 4
-    score += ( checkRepetition(1,password).length - password.length ) * 1
-    score += ( checkRepetition(2,password).length - password.length ) * 1
-    score += ( checkRepetition(3,password).length - password.length ) * 1
-    score += ( checkRepetition(4,password).length - password.length ) * 1
+	var desc = new Array();
+	desc[0] = "Too Short";
+	desc[1] = "Very Weak";
+	desc[2] = "Weak";
+	desc[3] = "Medium";
+	desc[4] = "Better";
+	desc[5] = "Strong";
+	desc[6] = "Very Strong";
 
-    //password has 3 numbers
-    if (password.match(/(.*[0-9].*[0-9].*[0-9])/))  score += 5 
-    
-    //password has 2 sybols
-    if (password.match(/(.*[!,@,#,$,%,^,&,*,?,_,~].*[!,@,#,$,%,^,&,*,?,_,~])/)) score += 5 
-    
-    //password has Upper and Lower chars
-    if (password.match(/([a-z].*[A-Z])|([A-Z].*[a-z])/))  score += 10 
-    
-    //password has number and chars
-    if (password.match(/([a-zA-Z])/) && password.match(/([0-9])/))  score += 15 
-    //
-    //password has number and symbol
-    if (password.match(/([!,@,#,$,%,^,&,*,?,_,~])/) && password.match(/([0-9])/))  score += 15 
-    
-    //password has char and symbol
-    if (password.match(/([!,@,#,$,%,^,&,*,?,_,~])/) && password.match(/([a-zA-Z])/))  score += 15 
-    
-    //password is just a nubers or chars
-    if (password.match(/^\w+$/) || password.match(/^\d+$/) )  score -= 10 
-    
-    //verifing 0 < score < 100
-    if ( score < 0 )  score = 0 
-    if ( score > 100 )  score = 100 
-    
-    if (score < 34 )  return badPass 
-    if (score < 68 )  return goodPass
-    return strongPass
-}
+	var strength = 100; 
+	var score	 = 0;
+		
+	if ( password.length <= 7 )
+		strength -= ( password.length * 5 );
+	
+	if ( password.length > 7 )
+		strength -= ( ( password.length * 10 ) - ( 7 * 5 ) );
+	
+	var characters = "";
+	var nNumbers = 0;
+	var nLowercase = 0;
+	var nUppercase = 0;
+	var nSymbols = 0;
+	
+	for ( i = 0; i < password.length; i++ )
+	{
+		characters = password.charAt(i);
+		if ( characters >= "0" && characters <= "9" ) nNumbers++;
+		else if ( characters >= "a" && characters <= "z" ) nLowercase++;
+		else if ( characters >= "A" && characters <= "Z" ) nUppercase++;
+		else nSymbols++;
+	}
+	
+	if ( nLowercase > 0 )
+		strength -= ( nLowercase * 1 );
+	
+	if ( nUppercase >= 1 )
+		strength -= ( nUppercase * 3 );
+	
+	if ( nNumbers >= 1 )
+		strength -= ( nNumbers * 7 );
+	
+	if ( nSymbols >= 1 )
+		strength -= ( nSymbols * 10 );
+	
+	//verifing 0 < strength < 100
+	if ( strength < 0 ) strength = 0;
+	if ( strength > 100 ) strength = 100;
 
+	var lca = password.match(/[a-z]/);
+	var uca = password.match(/[A-Z]/);
+	var nmb = password.match(/[0-9]/);
+	var smb = password.match(/[~,!,@,#,$,%,^,&,*,(,),\-,_,\=,\+,\[,\],\{,\},\;,\:,\,,\.,\/,\<,\>,?,\|,\',\",\`]/)
 
-// checkRepetition(1,'aaaaaaabcbc')   = 'abcbc'
-// checkRepetition(2,'aaaaaaabcbc')   = 'aabc'
-// checkRepetition(2,'aaaaaaabcdbcd') = 'aabcd'
-
-function checkRepetition(pLen,str) {
-    res = ""
-    for ( i=0; i<str.length ; i++ ) {
-        repeated=true
-        for (j=0;j < pLen && (j+i+pLen) < str.length;j++)
-            repeated=repeated && (str.charAt(j+i)==str.charAt(j+i+pLen))
-        if (j<pLen) repeated=false
-        if (repeated) {
-            i+=pLen-1
-            repeated=false
-        }
-        else {
-            res+=str.charAt(i)
-        }
-    }
-    return res
-}
-// Password strength meter
-// This jQuery plugin is written by firas kassem [2007.04.05]
-// Firas Kassem  phiras.wordpress.com || phiras at gmail {dot} com
-// for more information : http://phiras.wordpress.com/2007/04/08/password-strength-meter-a-jquery-plugin/
-
-var shortPass = 'Too short'
-var badPass = 'Bad'
-var goodPass = 'Good'
-var strongPass = 'Strong'
-
-
-
-function passwordStrength(password,username)
-{
-    score = 0 
-    
-    //password < 4
-    if (password.length < 4 ) { return shortPass }
-    
-    //password == username
-    if (password.toLowerCase()==username.toLowerCase()) return badPass
-    
-    //password length
-    score += password.length * 4
-    score += ( checkRepetition(1,password).length - password.length ) * 1
-    score += ( checkRepetition(2,password).length - password.length ) * 1
-    score += ( checkRepetition(3,password).length - password.length ) * 1
-    score += ( checkRepetition(4,password).length - password.length ) * 1
-
-    //password has 3 numbers
-    if (password.match(/(.*[0-9].*[0-9].*[0-9])/))  score += 5 
-    
-    //password has 2 sybols
-    if (password.match(/(.*[!,@,#,$,%,^,&,*,?,_,~].*[!,@,#,$,%,^,&,*,?,_,~])/)) score += 5 
-    
-    //password has Upper and Lower chars
-    if (password.match(/([a-z].*[A-Z])|([A-Z].*[a-z])/))  score += 10 
-    
-    //password has number and chars
-    if (password.match(/([a-zA-Z])/) && password.match(/([0-9])/))  score += 15 
-    //
-    //password has number and symbol
-    if (password.match(/([!,@,#,$,%,^,&,*,?,_,~])/) && password.match(/([0-9])/))  score += 15 
-    
-    //password has char and symbol
-    if (password.match(/([!,@,#,$,%,^,&,*,?,_,~])/) && password.match(/([a-zA-Z])/))  score += 15 
-    
-    //password is just a nubers or chars
-    if (password.match(/^\w+$/) || password.match(/^\d+$/) )  score -= 10 
-    
-    //verifing 0 < score < 100
-    if ( score < 0 )  score = 0 
-    if ( score > 100 )  score = 100 
-    
-    if (score < 34 )  return badPass 
-    if (score < 68 )  return goodPass
-    return strongPass
-}
-
-
-// checkRepetition(1,'aaaaaaabcbc')   = 'abcbc'
-// checkRepetition(2,'aaaaaaabcbc')   = 'aabc'
-// checkRepetition(2,'aaaaaaabcdbcd') = 'aabcd'
-
-function checkRepetition(pLen,str) {
-    res = ""
-    for ( i=0; i<str.length ; i++ ) {
-        repeated=true
-        for (j=0;j < pLen && (j+i+pLen) < str.length;j++)
-            repeated=repeated && (str.charAt(j+i)==str.charAt(j+i+pLen))
-        if (j<pLen) repeated=false
-        if (repeated) {
-            i+=pLen-1
-            repeated=false
-        }
-        else {
-            res+=str.charAt(i)
-        }
-    }
-    return res
-}
+	if ( ( strength <= 100 ) && ( ( lca ) || ( uca ) || ( nmb ) || ( smb ) ) ) score ++;
+	if ( ( strength <= 58 ) && ( ( ( lca ) && ( uca ) ) || ( ( lca ) && ( nmb ) ) || ( ( lca ) && ( smb ) ) || ( ( uca ) && ( nmb ) ) || ( ( uca ) && ( smb ) ) || ( ( nmb ) && ( smb ) ) ) ) score++;
+	if ( ( strength <= 54 ) && ( ( ( lca ) && ( uca ) && ( nmb ) ) || ( ( lca ) && ( uca ) && ( smb ) ) || ( ( lca ) && ( nmb ) && ( smb ) ) || ( ( uca ) && ( nmb ) && ( smb ) ) ) ) score++; 
+	if ( ( strength <= 48 ) && ( password.length >= 7 ) && ( ( ( lca ) && ( uca ) && ( nmb ) ) || ( ( lca ) && ( uca ) && ( smb ) ) || ( ( lca ) && ( nmb ) && ( smb ) ) || ( ( uca ) && ( nmb ) && ( smb ) ) ) ) score++;
+	if ( ( strength <= 35 ) && ( password.length >= 7 ) && ( lca ) && ( uca ) && ( nmb ) && ( smb ) ) score++;
+	if ( ( strength <= 24 ) && ( password.length >= 12 ) && ( lca ) && ( uca ) && ( nmb ) && ( smb ) ) score++;
+	
+	if ( ( password.length > 0 ) && ( score <= 3 ) )
+		document.getElementById("submit").disabled = true;
+	else
+		document.getElementById("submit").disabled = false;
+	
+	document.getElementById("passwordDescription").innerHTML = desc[score];
+	document.getElementById("passwordStrength").className = "strength" + score;
+}
\ No newline at end of file
Index: wp-admin/options-general.php
===================================================================
--- wp-admin/options-general.php	(revision 6752)
+++ wp-admin/options-general.php	(working copy)
@@ -54,6 +54,12 @@
 <select name="default_role" id="default_role"><?php wp_dropdown_roles( get_option('default_role') ); ?></select></label>
 </td>
 </tr>
+<tr valign="top">
+<th scope="row"><?php _e('Security:') ?></th>
+<td><label for="strong_passwords">
+<input name="strong_passwords" type="checkbox" id="strong_passwords" value="1" <?php checked('1', get_option('strong_passwords')); ?> />
+<?php _e('Enforce Strong Passwords') ?></label>
+</td>
 <tr>
 <th scope="row"><?php _e('<abbr title="Coordinated Universal Time">UTC</abbr> time is:') ?> </th>
 <td><code><?php echo gmdate(__('Y-m-d g:i:s a')); ?></code></td>
@@ -92,7 +98,7 @@
 
 <p class="submit"><input type="submit" name="Submit" value="<?php _e('Update Options &raquo;') ?>" />
 <input type="hidden" name="action" value="update" />
-<input type="hidden" name="page_options" value="<?php if ( ! defined( 'WP_SITEURL' ) ) echo 'siteurl,'; if ( ! defined( 'WP_HOME' ) ) echo 'home,'; ?>blogname,blogdescription,admin_email,users_can_register,gmt_offset,date_format,time_format,start_of_week,comment_registration,default_role" />
+<input type="hidden" name="page_options" value="<?php if ( ! defined( 'WP_SITEURL' ) ) echo 'siteurl,'; if ( ! defined( 'WP_HOME' ) ) echo 'home,'; ?>blogname,blogdescription,admin_email,users_can_register,gmt_offset,date_format,time_format,start_of_week,comment_registration,default_role,strong_passwords" />
 </p>
 </form>
 
Index: wp-admin/user-edit.php
===================================================================
--- wp-admin/user-edit.php	(revision 6752)
+++ wp-admin/user-edit.php	(working copy)
@@ -9,40 +9,52 @@
 
 function profile_js ( ) {
 ?>
-<script type="text/javascript">
-	function check_pass_strength ( ) {
-
-		var pass = jQuery('#pass1').val();
-		var user = jQuery('#user_login').val();
-
-		// get the result as an object, i'm tired of typing it
-		var res = jQuery('#pass-strength-result');
-
-		var strength = passwordStrength(pass, user);
-
-		jQuery(res).removeClass('short bad good strong');
-
-		if ( strength == 'Bad' ) {
-			jQuery(res).addClass('bad');
-			jQuery(res).html( pwsL10n.bad );
-		}
-		else if ( strength == 'Good' ) {
-			jQuery(res).addClass('good');
-			jQuery(res).html( pwsL10n.good );
-		}
-		else if ( strength == 'Strong' ) {
-			jQuery(res).addClass('strong');
-			jQuery(res).html( pwsL10n.strong );
-		}
-		else {
-			// this catches 'Too short' and the off chance anything else comes along
-			jQuery(res).addClass('short');
-			jQuery(res).html( pwsL10n.short );
-		}
-
-	}
-
-	jQuery(document).ready( function() { jQuery('#pass1').keyup( check_pass_strength ) } );
+<script type="text/javascript"> 
+	function check_pass_strength ( ) { 
+ 
+		var pass = jQuery('#pass1').val(); 
+		var user = jQuery('#user_login').val(); 
+ 
+		// get the result as an object, i'm tired of typing it 
+		var res = jQuery('#pass-strength-result'); 
+ 
+ 		var strength = passwordStrength(pass, user);
+ 
+        jQuery(res).removeClass('short vweak weak medium better strong vstrong'); 
+		
+		if ( strength == 'Very Weak' ) { 
+			jQuery(res).addClass('vweak'); 
+			jQuery(res).html( pwsL10n.vweak ); 
+		} 
+		else if ( strength == 'Weak' ) { 
+			jQuery(res).addClass('weak'); 
+			jQuery(res).html( pwsL10n.weak ); 
+		} 
+		else if ( strength == 'Medium' ) { 
+			jQuery(res).addClass('medium'); 
+			jQuery(res).html( pwsL10n.medium ); 
+		} 
+		else if ( strength == 'Better' ) { 
+			jQuery(res).addClass('better'); 
+			jQuery(res).html( pwsL10n.better ); 
+		} 
+		else if ( strength == 'Strong' ) { 
+			jQuery(res).addClass('strong'); 
+			jQuery(res).html( pwsL10n.strong ); 
+		} 
+		else if ( strength == 'Very Strong' ) { 
+			jQuery(res).addClass('vstrong'); 
+			jQuery(res).html( pwsL10n.vstrong ); 
+		} 
+		else { 
+			// this catches 'Too short' and the off chance anything else comes along 
+			jQuery(res).addClass('short'); 
+			jQuery(res).html( pwsL10n.short ); 
+		} 
+ 
+	} 
+ 
+jQuery(document).ready( function() { jQuery('#pass1').keyup( check_pass_strength ) } ); 
 </script>
 <?php
 }
@@ -261,8 +273,10 @@
 </label></p>
 <?php if ( $is_profile_page ): ?>
 <p><strong><?php _e('Password Strength:'); ?></strong></p>
-<div id="pass-strength-result"><?php _e('Too short'); ?></div>
-<p><?php _e('Hint: Use upper and lower case characters, numbers and symbols like !"?$%^&( in your password.'); ?></p>
+<p><div id="passwordDescription">Password not entered</div>
+<div id="passwordStrength" class="strength0"></div></p>
+<p><?php _e('Hint: You must use upper and lower case characters as well as numbers and/or symbols in your password with a minimum password length of 7 characters.'); ?></p>
+<p><?php _e('You <strong>MUST</strong> have a strength of "Better," "Strong," or "Very Strong" to change your password.'); ?></p>
 <?php endif; ?>
 </fieldset>
 <?php endif; ?>
@@ -300,7 +314,7 @@
 <p class="submit">
 	<input type="hidden" name="action" value="update" />
 	<input type="hidden" name="user_id" id="user_id" value="<?php echo $user_id; ?>" />
-	<input type="submit" value="<?php $is_profile_page? _e('Update Profile &raquo;') : _e('Update User &raquo;') ?>" name="submit" />
+	<input type="submit" value="<?php $is_profile_page? _e('Update Profile &raquo;') : _e('Update User &raquo;') ?>" name="submit" id="submit" />
  </p>
 </form>
 </div>
Index: wp-admin/wp-admin.css
===================================================================
--- wp-admin/wp-admin.css	(revision 6752)
+++ wp-admin/wp-admin.css	(working copy)
@@ -772,32 +772,45 @@
 	color: #036;
 }
 
-#pass-strength-result { 
-	padding: 3px 5px 3px 5px;
-	margin-top: 3px;
-	text-align: center; 
-	background-color: #e3e3e3;
-	border: 1px solid #000000;
+#passwordStrength {
+	height:10px;
+	display:block;
+	float:left;
 }
-
-#pass-strength-result.short { 
-	background-color: #e3e3e3;
-	border: 1px solid #000000; 
+ 
+.strength0 {
+	width:102%;
+	background:#cccccc;
 }
-
-#pass-strength-result.bad { 
-	background-color: #ffeff7;
-	border: 1px solid #cc6699; 
+ 
+.strength1 {
+	width:17%;
+	background:#ff0000;
 }
+ 
+.strength2 {
+	width:34%;	
+	background:#ff5f5f;
+}
+ 
+.strength3 {
+	width:51%;
+	background:#ffff66;
+}
+ 
+.strength4 {
+	width:68%;
+	background:#aefe36;
+}
 
-#pass-strength-result.good { 
-	background-color: #effff4;
-	border: 1px solid #66cc87; 
+.strength5 {
+	background:#4dcd00;
+	width:85%;
 }
 
-#pass-strength-result.strong { 
-	background-color: #59ef86;
-	border: 1px solid #319f52;
+.strength6 {
+	background:#308000;
+	width:102%;
 }
 
 a.view-comment-post-link {
Index: wp-includes/pluggable.php
===================================================================
--- wp-includes/pluggable.php	(revision 6752)
+++ wp-includes/pluggable.php	(working copy)
@@ -973,6 +973,33 @@
 }
 endif;
 
+if ( !function_exists('wp_test_password') ) :
+function wp_test_password($password) {
+	$error = "";
+	
+	// Check that the password containes lowercase and uppercase letters, numbers, and symbols
+	$lowercase = false;
+	$uppercase = false;
+	$numbers   = false;
+	$symbols   = false;
+	for($i=0;$i<strlen($password) && !($lowercase && $uppercase && $numbers && $symbols);$i++){
+		$lowercase = $lowercase || (ord(substr($password,$i,1)) > 96 && ord(substr($password,$i,1)) < 123);
+		$uppercase = $uppercase || (ord(substr($password,$i,1)) > 64 && ord(substr($password,$i,1)) < 91);
+		$numbers   = $numbers || (ord(substr($password,$i,1)) > 47 && ord(substr($password,$i,1)) < 58);
+		$symbols   = $symbols || ((ord(substr($password,$i,1)) > 32 && ord(substr($password,$i,1)) < 48) || (ord(substr($password,$i,1)) > 57 && ord(substr($password,$i,1)) < 65) || (ord(substr($password,$i,1)) > 90 && ord(substr($password,$i,1)) < 97) || (ord(substr($password,$i,1)) > 122 && ord(substr($password,$i,1)) < 127));
+	}
+	
+	if (!($lowercase)) $error .= __("The password does not contain lowercase letters<br/>\n");
+	if (!($uppercase)) $error .= __("The password does not contain uppercase letters<br/>\n");
+	if (!($numbers)) $error .= __("The password does not contain numbers<br/>\n");
+	if (!($symbols)) $error .= __("The password does not contain symbols<br/>\n");
+	
+	// Check password length
+	if(strlen($password) < 7) $error .= __("The password is not long enough<br/>\n");
+	return $error;
+}
+endif;
+
 if ( !function_exists('wp_salt') ) :
 /**
  * wp_salt() - Get salt to add to hashes to help prevent attacks
Index: wp-includes/script-loader.php
===================================================================
--- wp-includes/script-loader.php	(revision 6752)
+++ wp-includes/script-loader.php	(working copy)
@@ -121,9 +121,12 @@
 			$this->add( 'password-strength-meter', '/wp-admin/js/password-strength-meter.js', array('jquery'), '20070405' );
 			$this->localize( 'password-strength-meter', 'pwsL10n', array(
 				'short' => __('Too short'),
-				'bad' => __('Bad'),
-				'good' => __('Good'),
-				'strong' => __('Strong')
+				'vweak' => __('Very Weak'),
+				'weak' => __('Weak'),
+				'medium' => __('Medium'), 
+				'better' => __('Better'),
+				'strong' => __('Strong'),
+				'vstrong' => __('Very Strong')
 			) );
 			$this->add( 'admin-comments', '/wp-admin/js/edit-comments.js', array('wp-lists'), '20071104' );
 			$this->add( 'admin-posts', '/wp-admin/js/edit-posts.js', array('wp-lists'), '20071023' );

