1 | <?php |
||
34 | class Password implements VerifyInterface |
||
35 | { |
||
36 | /** |
||
37 | * Password |
||
38 | * |
||
39 | * @var string |
||
40 | * |
||
41 | * @access protected |
||
42 | */ |
||
43 | protected $password; |
||
44 | |||
45 | /** |
||
46 | * Field |
||
47 | * |
||
48 | * @var mixed |
||
49 | * |
||
50 | * @access protected |
||
51 | */ |
||
52 | protected $field = 'vperyod/simplelock:password'; |
||
53 | |||
54 | /** |
||
55 | * Create a password verifier |
||
56 | * |
||
57 | * @param string $password required password |
||
58 | * @param string $field name of body field |
||
59 | * |
||
60 | * @access public |
||
61 | */ |
||
62 | 2 | public function __construct($password, $field = 'vperyod/simplelock:password') |
|
67 | |||
68 | /** |
||
69 | * Is request valid for unlocking the session? |
||
70 | * |
||
71 | * @param Request $request PSR7 Request |
||
72 | * |
||
73 | * @return bool |
||
74 | * |
||
75 | * @access public |
||
76 | */ |
||
77 | 2 | public function isValid(Request $request) |
|
82 | |||
83 | /** |
||
84 | * Is request an unlock attempt? |
||
85 | * |
||
86 | * @param Request $request DESCRIPTION |
||
87 | * |
||
88 | * @return bool |
||
89 | * |
||
90 | * @access public |
||
91 | */ |
||
92 | 2 | public function isAttempt(Request $request) |
|
98 | |||
99 | /** |
||
100 | * Verify password |
||
101 | * |
||
102 | * @param array $body parsed body |
||
103 | * |
||
104 | * @return bool |
||
105 | * |
||
106 | * @access protected |
||
107 | */ |
||
108 | 2 | protected function verifyPassword(array $body) |
|
113 | } |
||
114 |