#include #include #include "user.h" #include "auth.h" // --- Tableau d'utilisateurs --- User users[] = { {"admin", "1234", ADMIN}, {"prof1", "abcd", PROF}, {"student1", "pass", STUDENT}, {"student2", "123", STUDENT}, {"student3", "abc", STUDENT} }; int nbUsers = 5; // --- Tableau d'étudiants et notes --- struct Student { std::string nom; int notes[3]; }; Student etudiants[] = { {"student1", {15, 12, 18}}, {"student2", {14, 10, 16}}, {"student3", {13, 11, 17}} }; int nbEtudiants = 3; // --- Fonctions de vues selon rôle --- void viewAdmin() { std::cout << "\n--- VUE ADMIN ---\n"; std::cout << "Liste des étudiants et notes :\n"; for(int i=0; i> id; if(id>=0 && id> noteIndex; std::cout << "Nouvelle note : "; std::cin >> newNote; etudiants[id].notes[noteIndex] = newNote; std::cout << "Note modifiée avec succès !\n"; } } void viewStudent(const User& user) { std::cout << "\n--- VUE STUDENT ---\n"; for(int i=0; i> nom >> n1 >> n2 >> n3 && i> nom >> n1 >> n2 >> n3){ for(int i=0;i> login; std::cout << "Mot de passe : "; std::cin >> password; int index = authentifier(login, password); if(index != -1) { std::cout << "Connexion réussie !" << std::endl; switch(users[index].role) { case ADMIN: viewAdmin(); exportAdmin(); importAdmin(); break; case PROF: viewProf(); exportNotes(users[index]); importProf(); break; case STUDENT: viewStudent(users[index]); exportNotes(users[index]); break; } } else { std::cout << "Identifiants incorrects." << std::endl; } return 0; }