switch
continuous-integration/drone/push Build encountered an error Details

WORK-DDA
David D'ALMEIDA 1 year ago
parent d429a53b2d
commit c9082d0113

@ -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

@ -84,4 +84,6 @@ class Router{
} }
} }
public function navigate(string $route, string $controller, array $match){return true};
} }

@ -2,6 +2,7 @@
use Exception\NotImplementedException; use Exception\NotImplementedException;
use Model\IUserRepository; use Model\IUserRepository;
use Service\IAuthService; use Service\IAuthService;
use Utils\Validation;
class AuthService implements IAuthService { class AuthService implements IAuthService {
private $userRepository; private $userRepository;
@ -32,4 +33,21 @@ class AuthService implements IAuthService {
{ {
throw new NotImplementedException("logout method not implemented"); 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");
}
} }
Loading…
Cancel
Save