1 | <?php |
||
5 | class Security |
||
6 | { |
||
7 | /** |
||
8 | * (UT 3.1) Password type: plain text. |
||
9 | */ |
||
10 | const PASSWORD_TYPE_TEXT = 0; |
||
11 | |||
12 | /** |
||
13 | * (UT 3.1) Password type: digest. |
||
14 | */ |
||
15 | const PASSWORD_TYPE_DIGEST = 1; |
||
16 | |||
17 | /** |
||
18 | * (UT 3.1) Password. |
||
19 | * |
||
20 | * @var string |
||
21 | */ |
||
22 | protected $password; |
||
23 | |||
24 | /** |
||
25 | * (UT 3.1) Password type: text or digest. |
||
26 | * |
||
27 | * @var int |
||
28 | */ |
||
29 | protected $passwordType = self::PASSWORD_TYPE_DIGEST; |
||
30 | |||
31 | /** |
||
32 | * (UT 3.1) Username. |
||
33 | * |
||
34 | * @var string |
||
35 | */ |
||
36 | protected $username; |
||
37 | |||
38 | /** |
||
39 | * @return string |
||
40 | */ |
||
41 | public function getPassword() |
||
45 | |||
46 | /** |
||
47 | * @param string $password |
||
48 | * @param int $passwordType |
||
49 | */ |
||
50 | public function setPassword($password, $passwordType = self::PASSWORD_TYPE_DIGEST) |
||
55 | |||
56 | public function isPasswordDigest() |
||
60 | |||
61 | public function isPasswordPlain() |
||
65 | |||
66 | /** |
||
67 | * @return string |
||
68 | */ |
||
69 | public function getUsername() |
||
73 | |||
74 | /** |
||
75 | * @param string $username |
||
76 | */ |
||
77 | public function setUsername($username) |
||
81 | } |
||
82 |