Soshot/app/Controllers/Login.php

20 lines
No EOL
409 B
PHP

<?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;
}
}