Source for file auth.php

Documentation is available at auth.php

  1. <?php
  2. /**
  3. * Test of authentication object logic -- username validation
  4. *
  5. @author    Stuart Prescott
  6. @copyright  Copyright Stuart Prescott
  7. @license    http://opensource.org/licenses/gpl-license.php GNU Public License
  8. @version    $Id$
  9. @package    Bumblebee
  10. @subpackage Tests
  11. */
  12.  
  13. ini_set('error_reporting'E_ALL);
  14.  
  15. $validusers array('stuartp''stup1''stuart_p''stu-p''s1234''123s',
  16.                'stu@p''stup@nano.net''stu.p''stu+p'
  17.                );
  18. $invalidusers array('stu/p''stu\'p''stu"p''stu!p''stu%p''stu#p''stu=p'
  19.                'stu\\p''-stup''@stup'''' '' stup''stup ''stu p'
  20.               );
  21.  
  22. $regexp '/^[a-z0-9][a-z0-9@\-_.+]+$/';
  23.  
  24. foreach ($validusers as $name{              
  25.   printf("%-20s: %s\n"$name,
  26.                 (preg_match($regexp$name'OK, VALID' 'ERROR, INVALID'));
  27. }
  28.  
  29. foreach ($invalidusers as $name{              
  30.   printf("%-20s: %s\n"$name,
  31.                 (preg_match($regexp$name'ERROR, VALID' 'OK, INVALID'));
  32. }
  33.  
  34. ?>

Documentation generated on Tue, 06 Mar 2007 10:00:37 +0000 by phpDocumentor 1.3.0