From 13abce482d29ed0a6ea0fca0322f665ad0af9a6c Mon Sep 17 00:00:00 2001 From: "antoine.perederii" Date: Fri, 16 Dec 2022 09:02:03 +0100 Subject: [PATCH] ajout du .h et de la global --- Partie_3/partie_3.c | 2 +- Partie_3/partie_3.h | 3 --- Partie_3/testpartie_3.c | 2 +- SAE.h | 5 +++++ global/global.c | 42 +++++++++++++++++++++++++++++++++++++++++ global/menus.c | 2 +- 6 files changed, 50 insertions(+), 6 deletions(-) delete mode 100755 Partie_3/partie_3.h create mode 100644 SAE.h diff --git a/Partie_3/partie_3.c b/Partie_3/partie_3.c index b561373..3fbac58 100755 --- a/Partie_3/partie_3.c +++ b/Partie_3/partie_3.c @@ -1,4 +1,4 @@ -#include "partie_3.h" +#include "../SAE.h" int modifNoteMinAdmis() { diff --git a/Partie_3/partie_3.h b/Partie_3/partie_3.h deleted file mode 100755 index 04f1b7a..0000000 --- a/Partie_3/partie_3.h +++ /dev/null @@ -1,3 +0,0 @@ -#include -#include - diff --git a/Partie_3/testpartie_3.c b/Partie_3/testpartie_3.c index 1d5acd3..8304ca6 100755 --- a/Partie_3/testpartie_3.c +++ b/Partie_3/testpartie_3.c @@ -1,4 +1,4 @@ -#include "partie_3.h" +#include "../SAE.h" int main(void) { diff --git a/SAE.h b/SAE.h new file mode 100644 index 0000000..3bda30a --- /dev/null +++ b/SAE.h @@ -0,0 +1,5 @@ +#include +#include +#include +#include + diff --git a/global/global.c b/global/global.c index e69de29..f0a2595 100644 --- a/global/global.c +++ b/global/global.c @@ -0,0 +1,42 @@ +#include "../SAE.h" + +void global(void) +{ + +} + +int ConnexionUtilisateur(void) +{ + char nomUtilisateur[9], motDePasse[11], typeUtilisateur[9]; + printf("Veuillez entrer votre nom d'utilisateur : "); + scanf("%s", &nomUtilisateur); + while(strlen(nomUtilisateur) != 8) + { + printf("Nom d'utilisateur incorrect. Veuillez recommencer : "); + scanf("%s", &nomUtilisateur); + } + printf("Veuillez entrer votre mot de passe : "); + system("stty -echo"); + scanf("%s", &motDePasse); + system("stty echo"); + while(strlen(motDePasse) != 10) + { + printf("Mot de passe incorrect. Veuillez recommencer : "); + system("stty -echo"); + scanf("%s", &motDePasse); + system("stty echo"); + } + printf("Connexion réussie en tant qu%s!\n", typeUtilisateur); + if(typeUtilisateur == "Admin") + { + return 1; + } + else if(typeUtilisateur == "RespAdm") + { + return 2; + } + else if(typeUtilisateur == "RespDept") + { + return 3; + } +} \ No newline at end of file diff --git a/global/menus.c b/global/menus.c index 8d49547..52985da 100644 --- a/global/menus.c +++ b/global/menus.c @@ -1,4 +1,4 @@ -#include "../Partie_3/partie_3.h" +#include "../SAE.h" int MenuRespAdminDept(void) {