= sfPasswordStrengthPlugin plugin = The `sfPasswordStrengthPlugin` allows you to easily measure the strength of a password.[[BR]] It is displayed as a pretty progress bar.[[BR]] [[BR]] Inspired from [http://www.symfony-project.org/snippets/snippet/235 Password Strength validator] snippet[[BR]] Uses [http://www.alixaxel.com/wordpress/2007/06/09/php-password-strength-algorithm/ Alix Axel algorithm] == Installation == * Install the plugin {{{ symfony plugin-install http://plugins.symfony-project.com/sfPasswordStrengthPlugin }}} * Create a symbolic link {{{ $ cd web $ ln -s ../plugins/sfPasswordStrengthPlugin/web sfPasswordStrengthPlugin }}} * Create an action {{{ public function executeCalculateStrength() { $strength = PasswordStrength::calculate( $this->getRequestParameter('passwd'), $this->getRequestParameter('login') ); return $this->renderText(PasswordStrength::getBar($strength)); } }}} * Add a DIV element where the bar will be placed and observe your field (note: you can see that the login is sent too, in order to test if the login is in the password, which is very bad!) {{{ echo observe_field('passwd', array( 'update' => 'strength', 'url' => 'user_account/calculateStrength', 'with' => "$('passwd').serialize() + '&' + $('login').serialize()", 'script' => true, 'frequency'=> 0.5, )); }}} * Insert the style sheet (I hope this step will be automated soon!) {{{ <?php use_stylesheet('/sfPasswordStrengthPlugin/css/sfPasswordStrengthStyle.css'); ?> }}} * You should be done.