Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- function getUsersList() {
- $users = ['vasya' => '$2y$10$2N3wzuBc1MbBDgTF2OuslOAUrOWQPOkBoeh2dkxppawyfseyohtnw', 'petya' => '$2y$10 $ ApoS02iv.OuZIFcl / aD1duTHaReLxaChjcxG4aG6YL7Hxxxe8fvtw', 'misha' => '$2y$10$95JfbQirXu7Izz.UnWqKyOpuem4ACQTOZaSBMuZcatRzz43qpgnne'];
- return $users;
- }
- function existsUser($login, $users){
- if (array_key_exists($login, $users)) {
- return true;
- } else {
- return false;
- }
- }
- function сheckPassword($login, $password, $users ){
- $hash = $users['vasya'];
- if (existsUser($login, $users)) {
- return true;
- } else {
- return false;
- } if (password_verify($password, $hash)) {
- return true;
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement