You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

42 lines
1015 B

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