cvs: pear /Text_Password Password.php

From: Date: Sun, 12 Jan 2003 08:08:45 +0000
Subject: cvs: pear /Text_Password Password.php
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-8199@lists.php.net to get a copy of this message
mj Sun Jan 12 03:08:45 2003 EDT Modified files: /pear/Text_Password Password.php Log: * Update PHPDoc. Index: pear/Text_Password/Password.php diff -u pear/Text_Password/Password.php:1.5 pear/Text_Password/Password.php:1.6 --- pear/Text_Password/Password.php:1.5 Sat Jan 4 06:56:26 2003 +++ pear/Text_Password/Password.php Sun Jan 12 03:08:45 2003 @@ -17,13 +17,13 @@ // | Olivier Vanhoucke <olivier@php.net> | // +----------------------------------------------------------------------+ // -// $Id: Password.php,v 1.5 2003/01/04 11:56:26 mj Exp $ +// $Id: Password.php,v 1.6 2003/01/12 08:08:45 mj Exp $ // /** * Number of possible characters in the password */ - $_Text_Password_NumberOfPossibleCharacters = 0; +$_Text_Password_NumberOfPossibleCharacters = 0; /** * Create passwords @@ -39,9 +39,11 @@ * * @access public * @param integer Length of the password. - * @param string Type of password (pronounceable, unpronounceable etc.) - * @param string Character which could be use in the unpronounceable password ex : 'A,B,C,D,E,F,G' or numeric or alphanumeric - * @return string + * @param string Type of password (pronounceable, unpronounceable) + * @param string Character which could be use in the + * unpronounceable password ex : 'A,B,C,D,E,F,G' + * or numeric or alphanumeric. + * @return string Returns the generated password. */ function create($length = 10, $type = 'pronounceable', $chars = '') { @@ -51,7 +53,7 @@ case 'unpronounceable' : return Text_Password::_createUnpronounceable($length, $chars); - case 'pronounceable' : + case 'pronounceable' : default : return Text_Password::_createPronounceable($length); } @@ -66,8 +68,10 @@ * @access public * @param integer Number of different password * @param integer Length of the password - * @param string Type of password (pronounceable, unpronounceable etc.) - * @param string Character which could be use in the unpronounceable password ex : 'A,B,C,D,E,F,G' or numeric or alphanumeric + * @param string Type of password (pronounceable, unpronounceable) + * @param string Character which could be use in the + * unpronounceable password ex : 'A,B,C,D,E,F,G' + * or numeric or alphanumeric. * @return array Array containing the passwords */ function createMultiple($number, $length = 10, $type = 'pronounceable', $chars = '') { @@ -164,7 +168,7 @@ } /** - * Create password from login + * Helper method to create password * * Method to create a password from a login * @@ -191,7 +195,7 @@ } /** - * Create password from login + * Helper method to create password * * Method to create a password from a login * lowercase only @@ -224,7 +228,7 @@ } /** - * Create password from login + * Helper method to create password * * Method to create a password from a login * lowercase only @@ -257,7 +261,7 @@ } /** - * Create password from login + * Helper method to create password * * Method to create a password from a login * lowercase only @@ -290,7 +294,7 @@ } /** - * Create password from login + * Helper method to create password * * Method to create a password from a login * @@ -317,7 +321,7 @@ } /** - * Create password from login + * Helper method to create password * * Method to create a password from a login * @@ -344,7 +348,7 @@ } /** - * Create password from login + * Helper method to create password * * Method to create a password from a login * @@ -371,7 +375,7 @@ } /** - * Create password from login + * Helper method to create password * * Method to create a password from a login * @@ -443,7 +447,9 @@ * * @access private * @param integer Length of the password - * @param string Character which could be use in the password ex : 'A,B,C,D,E,F,G' or numeric or alphanumeric + * @param string Character which could be use in the + * unpronounceable password ex : 'A,B,C,D,E,F,G' + * or numeric or alphanumeric. * @return string Returns the password */ function _createUnpronounceable($length, $chars) { @@ -474,7 +480,7 @@ default: /** - * Some characters couldn't be used + * Some characters shouldn't be used */ $chars = trim($chars); $chars = str_replace('+' , '' , $chars); @@ -496,7 +502,6 @@ /** * Generate password */ - do { $chr = chr(mt_rand(0, 255)); if (preg_match('/'.$regex.'/US', $chr)) {

« previous php.pear.cvs (#8199) next »