hajtest | ||||
![]() |
||||
|
||||
![]() |
Coverage | ||||||||||||
Classes | Functions / Methods | Lines | ||||||||||
Total |
|
0.00% | 0 / 1 |
|
0.00% | 0 / 2 |
|
0.00% | 0 / 8 | |||
Users |
|
0.00% | 0 / 1 |
|
0.00% | 0 / 2 |
|
0.00% | 0 / 8 | |||
public static function authenticate($username, $password) |
|
0.00% | 0 / 1 |
|
0.00% | 0 / 6 | ||||||
public static function findOne($id) |
|
0.00% | 0 / 1 |
|
0.00% | 0 / 1 |
1 : <?php 2 : 3 : /** 4 : * Users 5 : * 6 : * This class has been auto-generated by the Doctrine ORM Framework 7 : * 8 : * @package ##PACKAGE## 9 : * @subpackage ##SUBPACKAGE## 10 : * @author ##NAME## <##EMAIL##> 11 : * @version SVN: $Id: Builder.php 7490 2010-03-29 19:53:27Z jwage $ 12 : */ 13 0 : class Users extends BaseUsers { 14 : const NOT_FOUND = 1; 15 : const WRONG_PW = 2; 16 : /** 17 : * 18 : * @param string $username 19 : * @param string $password 20 : * @throws Exception 21 : * @return User 22 : */ 23 : public static function authenticate($username, $password) { 24 0 : $user = Doctrine_Core::getTable('Users')->findOneBy('email', $username); 25 0 : if ($user) { 26 0 : if ($user->md5_pass == $password) 27 0 : return $user; 28 : 29 0 : throw new Exception(self::WRONG_PW); 30 : } 31 : 32 0 : throw new Exception(self::NOT_FOUND); 33 : } 34 : public static function findOne($id) { 35 0 : return Doctrine::getTable('Users')->findOneBy('id', $id); 36 : } 37 : |
![]() |
Generated by PHPUnit 3.4.15 and Xdebug 2.1.0rc1 using PHP 5.3.1 at Mon Jan 17 15:42:18 PST 2011. |