2023-01-11 14:41:09 +01:00
|
|
|
<?php
|
|
|
|
require_once("BancaDati/BancaDati.php");
|
|
|
|
use BancaDati\BancaDati;
|
|
|
|
class User {
|
|
|
|
public string $username;
|
|
|
|
public string $email;
|
|
|
|
public string $token;
|
|
|
|
private string $password;
|
|
|
|
private BancaDati $db;
|
|
|
|
|
2023-01-12 14:44:52 +01:00
|
|
|
public function __construct() {
|
2023-01-11 14:41:09 +01:00
|
|
|
$db = new BancaDati();
|
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function exists() {
|
|
|
|
return true;
|
|
|
|
}
|
2023-01-12 14:44:52 +01:00
|
|
|
public function loginWithUsername(string $username, string $password) : string {
|
|
|
|
$userObject = $this->db->select("utente", ["username" => $username]);
|
|
|
|
var_dump($userObject);
|
|
|
|
if(!$userObject){
|
|
|
|
return false;
|
|
|
|
}
|
2023-01-11 14:41:09 +01:00
|
|
|
return "token";
|
|
|
|
}
|
2023-01-12 14:44:52 +01:00
|
|
|
public function loginWithToken(string $token){
|
|
|
|
|
|
|
|
}
|
2023-01-11 14:41:09 +01:00
|
|
|
}
|