Changeset 10055
- Timestamp:
- 11/30/08 14:18:18 (1 month ago)
- Files:
-
- trunk/jaws/html/libraries/pear/Text/Password.php (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/jaws/html/libraries/pear/Text/Password.php
r1706 r10055 19 19 * @copyright 2004-2005 Martin Jansen, Olivier Vanhoucke 20 20 * @license http://www.php.net/license/3_0.txt PHP License 3.0 21 * @version CVS: $Id: Password.php,v 1.1 6 2005/08/21 19:47:53mj Exp $21 * @version CVS: $Id: Password.php,v 1.18 2008/11/30 13:38:56 mj Exp $ 22 22 * @link http://pear.php.net/package/Text_Password 23 23 */ … … 26 26 * Number of possible characters in the password 27 27 */ 28 $ _Text_Password_NumberOfPossibleCharacters= 0;28 $GLOBALS['_Text_Password_NumberOfPossibleCharacters'] = 0; 29 29 30 30 /** … … 49 49 * @param string Type of password (pronounceable, unpronounceable) 50 50 * @param string Character which could be use in the 51 * unpronounceable password ex : 'A ,B,C,D,E,F,G'51 * unpronounceable password ex : 'ABCDEFG' 52 52 * or numeric, alphabetical or alphanumeric. 53 53 * @return string Returns the generated password. … … 436 436 { 437 437 438 global $_Text_Password_NumberOfPossibleCharacters;439 438 $retVal = ''; 440 439 … … 458 457 $c_count = 29; 459 458 460 $ _Text_Password_NumberOfPossibleCharacters= $v_count + $c_count;459 $GLOBALS['_Text_Password_NumberOfPossibleCharacters'] = $v_count + $c_count; 461 460 462 461 for ($i = 0; $i < $length; $i++) { … … 481 480 function _createUnpronounceable($length, $chars) 482 481 { 483 global $_Text_Password_NumberOfPossibleCharacters;484 485 482 $password = ''; 486 483 … … 492 489 case 'alphanumeric': 493 490 $chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'; 494 $ _Text_Password_NumberOfPossibleCharacters= 62;491 $GLOBALS['_Text_Password_NumberOfPossibleCharacters'] = 62; 495 492 break; 496 493 497 494 case 'alphabetical': 498 495 $chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'; 499 $ _Text_Password_NumberOfPossibleCharacters= 52;496 $GLOBALS['_Text_Password_NumberOfPossibleCharacters'] = 52; 500 497 break; 501 498 502 499 case 'numeric': 503 500 $chars = '0123456789'; 504 $ _Text_Password_NumberOfPossibleCharacters= 10;501 $GLOBALS['_Text_Password_NumberOfPossibleCharacters'] = 10; 505 502 break; 506 503 507 504 case '': 508 505 $chars = '_#@%&ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'; 509 $ _Text_Password_NumberOfPossibleCharacters= 67;506 $GLOBALS['_Text_Password_NumberOfPossibleCharacters'] = 67; 510 507 break; 511 508 … … 517 514 $chars = str_replace(array('+', '|', '$', '^', '/', '\\', ','), '', $chars); 518 515 519 $ _Text_Password_NumberOfPossibleCharacters= strlen($chars);516 $GLOBALS['_Text_Password_NumberOfPossibleCharacters'] = strlen($chars); 520 517 } 521 518 … … 524 521 */ 525 522 for ($i = 0; $i < $length; $i++) { 526 $num = mt_rand(0, $ _Text_Password_NumberOfPossibleCharacters- 1);523 $num = mt_rand(0, $GLOBALS['_Text_Password_NumberOfPossibleCharacters'] - 1); 527 524 $password .= $chars{$num}; 528 525 }
