Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
100.00% |
4 / 4 |
|
100.00% |
2 / 2 |
CRAP | |
100.00% |
1 / 1 |
| Authentication | |
100.00% |
4 / 4 |
|
100.00% |
2 / 2 |
3 | |
100.00% |
1 / 1 |
| getPasswordHashType | |
100.00% |
3 / 3 |
|
100.00% |
1 / 1 |
2 | |||
| hashPassword | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| 1 | <?php |
| 2 | |
| 3 | namespace UserFrosting; |
| 4 | |
| 5 | class Authentication { |
| 6 | |
| 7 | public static function getPasswordHashType($password){ |
| 8 | // If the password in the db is 65 characters long, we have an sha1-hashed password. |
| 9 | if (strlen($password) == 65) { |
| 10 | return "sha1"; |
| 11 | } else { |
| 12 | return "modern"; |
| 13 | } |
| 14 | |
| 15 | } |
| 16 | |
| 17 | public static function hashPassword($password){ |
| 18 | return password_hash($password, PASSWORD_BCRYPT); |
| 19 | } |
| 20 | |
| 21 | } |
| 22 | |
| 23 | ?> |