diff --git a/Documents/Diagramme/Analyse/Class/emre.ben b/Documents/Diagramme/Analyse/Class/ModelDuDomain.ben similarity index 100% rename from Documents/Diagramme/Analyse/Class/emre.ben rename to Documents/Diagramme/Analyse/Class/ModelDuDomain.ben diff --git a/Documents/Diagramme/Analyse/Class/dsnk.txt b/Documents/Diagramme/Analyse/Class/dsnk.txt new file mode 100644 index 00000000..e69de29b diff --git a/Documents/Diagramme/Annalyse/Besoins/UseCase.txt b/Documents/Diagramme/Annalyse/Besoins/UseCase.txt new file mode 100644 index 00000000..e69de29b diff --git a/Documents/Diagramme/Annalyse/Class/ModeleDuDomaine.txt b/Documents/Diagramme/Annalyse/Class/ModeleDuDomaine.txt new file mode 100644 index 00000000..4079fa90 --- /dev/null +++ b/Documents/Diagramme/Annalyse/Class/ModeleDuDomaine.txt @@ -0,0 +1,122 @@ +@startuml +skinparam { + BackgroundColor LightYellow + ArrowColor Black + Shadowing false + BorderColor Black +} + +package "Modèle de Données" { + +entity "Athlète" as athlete { + + ID_Athlète : int + -- + Nom : string + Prénom : string + Email : string + Sexe : string + Taille : Float + Poids : Float + Mot_de_passe : string + DateNaissance: date +} + +entity "Coach" as coach { + + ID_Coach : int + -- + ID_Athlète : int (FK) + // Attributs spécifiques au Coach si nécessaire +} + +entity "SourceDonnée" as source { + + ID_Source : int + -- + Type : string (enum) + Modèle : string + Précision : enum + Date_d'achat : date + Date_dernière_utilisation : date +} + +entity "Activité" as activity { + + ID_Activité : int + -- + Type : string + Date : date + Heure_de_début : time + Heure_de_fin : time + Effort_Ressenti: int + Variabilité : float + Variance : float + Ecart-type : float + Moyenne : float + Maximum : int + Minimum : int + Temperature_moyenne: float +} + +entity "FréquenceCardiaque" as fc { + + ID_FC : int + -- + Altitude : float + Temps : time + Température: float + BPM : int + longitude: float + latitude: float +} + +entity "Statistique" as stats { + + ID_Statistique : int + -- + Distance_totale : float + Poids: float + Temps_total : time + FC_moyenne : int + FC_max : int + Calories_brûlées : float + Records_personnels : string +} + +entity "Entraînement" as training { + + ID_Entrainement : int + -- + Date : date + Description : text + Feedback : text +} + +entity "Notification" as notification { + + ID_Notification : int + -- + Message : text + Date : date + Statut : enum + Type : string + Urgence : enum +} + +entity "Événement" as event { + + ID_Événement : int + -- + Nom : string + Description : text + Date : date + Lieu : string +} + +athlete <|-- coach : Spécialisation +athlete --o{ source : Utilise +athlete --o{ activity : Effectue +source --o{ activity : Fournit +activity --o{ fc : Contient +athlete }o--o{ athlete : Est ami avec +athlete --o{ stats : A des +coach --o{ training : Attribue +athlete --o{ training : Reçoit +athlete --o{ notification : Reçoit +athlete --o{ event : Participe à +coach --o{ event : Organise +} + +@enduml diff --git a/Sources/src/app/shared/router/Router.php b/Sources/src/app/shared/router/Router.php index 6b8a85fb..82dfe50f 100644 --- a/Sources/src/app/shared/router/Router.php +++ b/Sources/src/app/shared/router/Router.php @@ -84,4 +84,6 @@ class Router{ } } + public function navigate(string $route, string $controller, array $match){return true}; + } diff --git a/Sources/src/data/stub/service/AuthService.php b/Sources/src/data/stub/service/AuthService.php index 4041bd6e..d87a8053 100644 --- a/Sources/src/data/stub/service/AuthService.php +++ b/Sources/src/data/stub/service/AuthService.php @@ -2,6 +2,7 @@ use Exception\NotImplementedException; use Model\IUserRepository; use Service\IAuthService; +use Utils\Validation; class AuthService implements IAuthService { private $userRepository; @@ -32,4 +33,21 @@ class AuthService implements IAuthService { { throw new NotImplementedException("logout method not implemented"); } + + public function isAuthenticated(): bool { + + if (!isset($_SESSION['token'])){ + return false; + } + if(!isset($_SESSION['role'])){ + // get the user associate + // use middleware + throw new NotImplementedException("should be able to get the user"); + } + $login=Validation::clean_string($_SESSION['login']); + $token = Validation::clean_string($_SESSION['token']); + // should check with a helper class static method how to !this.jwtHelper.isTokenExpired(token); + throw new NotImplementedException("should end this method"); + + } } \ No newline at end of file