Soshot/app/Controllers/Login.php

20 lines
409 B
PHP
Raw Normal View History

2023-06-21 11:42:36 +02:00
<?php
namespace App\Controllers;
class Login {
static function isLogin() {
if (isset($_SESSION['login']) && $_SESSION['login'] === 1) {
return true;
}
return false;
}
static function login($password, $hash) {
if (password_verify($password, $hash)) {
$_SESSION['login'] = 1;
return true;
}
return false;
}
}