|
Revision 2, 0.9 kB
(checked in by fabien, 6 years ago)
|
initial import
|
- Property svn:mime-type set to
text/x-php
- Property svn:eol-style set to
native
- Property svn:keywords set to
Id
|
| Line | |
|---|
| 1 |
<?php |
|---|
| 2 |
|
|---|
| 3 |
|
|---|
| 4 |
require_once 'model/om/BaseSnippetUserPeer.php'; |
|---|
| 5 |
|
|---|
| 6 |
|
|---|
| 7 |
include_once 'model/SnippetUser.php'; |
|---|
| 8 |
|
|---|
| 9 |
|
|---|
| 10 |
|
|---|
| 11 |
|
|---|
| 12 |
|
|---|
| 13 |
|
|---|
| 14 |
|
|---|
| 15 |
|
|---|
| 16 |
|
|---|
| 17 |
|
|---|
| 18 |
|
|---|
| 19 |
|
|---|
| 20 |
|
|---|
| 21 |
class SnippetUserPeer extends BaseSnippetUserPeer |
|---|
| 22 |
{ |
|---|
| 23 |
public static function retrieveByLogin($login) |
|---|
| 24 |
{ |
|---|
| 25 |
$c = new Criteria(); |
|---|
| 26 |
$c->add(self::LOGIN, $login); |
|---|
| 27 |
|
|---|
| 28 |
return self::doSelectOne($c); |
|---|
| 29 |
} |
|---|
| 30 |
|
|---|
| 31 |
public static function getAuthenticatedUser($login, $password) |
|---|
| 32 |
{ |
|---|
| 33 |
$user = self::retrieveByLogin($login); |
|---|
| 34 |
|
|---|
| 35 |
|
|---|
| 36 |
// password is OK? |
|---|
| 37 |
if ($user && $password == $user->getPassword()) |
|---|
| 38 |
{ |
|---|
| 39 |
return $user; |
|---|
| 40 |
} |
|---|
| 41 |
|
|---|
| 42 |
return null; |
|---|
| 43 |
} |
|---|
| 44 |
} |
|---|
| 45 |
|
|---|