|
|
|
@ -23,9 +23,8 @@ int login(int clientID[], int clientPassword[], int isAdmin[], int tlog)
|
|
|
|
|
printf("Erreur, l'identifiant n'existe pas, entrez votre identifiant: ");
|
|
|
|
|
scanf("%d%*c", &id);
|
|
|
|
|
if (id == 0)
|
|
|
|
|
{
|
|
|
|
|
return -1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Nombre de tentatives restantes
|
|
|
|
|
tentative--;
|
|
|
|
|
if (tentative == 0)
|
|
|
|
@ -59,8 +58,8 @@ int login(int clientID[], int clientPassword[], int isAdmin[], int tlog)
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
printf("Erreur, le mot de passe est incorrect.\n");
|
|
|
|
|
return -1;
|
|
|
|
|
errorHandling(-9);
|
|
|
|
|
return -9;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -90,16 +89,19 @@ int signup(int clientID[], int clientPassword[], float cagnotte[], int suspended
|
|
|
|
|
scanf("%d%*c", &password);
|
|
|
|
|
while (password < 0)
|
|
|
|
|
{
|
|
|
|
|
errorHandling(-6);
|
|
|
|
|
printf("Erreur, le mot de passe doit être positif, entrez votre mot de passe: ");
|
|
|
|
|
scanf("%d%*c", &password);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
clientPassword[*tlog] = encrypt(password);
|
|
|
|
|
//! Ne pas oublier de décaler vers la droite
|
|
|
|
|
|
|
|
|
|
clientPassword[index] = encrypt(password);
|
|
|
|
|
|
|
|
|
|
clientID[*tlog] = id;
|
|
|
|
|
cagnotte[*tlog] = 0;
|
|
|
|
|
suspended[*tlog] = 0;
|
|
|
|
|
isAdmin[*tlog] = 0;
|
|
|
|
|
*tlog ++;
|
|
|
|
|
clientID[index] = id;
|
|
|
|
|
cagnotte[index] = 0;
|
|
|
|
|
suspended[index] = 0;
|
|
|
|
|
isAdmin[index] = 0;
|
|
|
|
|
*tlog++;
|
|
|
|
|
return 0;
|
|
|
|
|
}
|