diff --git a/auth.cpp b/auth.cpp new file mode 100644 index 0000000..797274e --- /dev/null +++ b/auth.cpp @@ -0,0 +1,13 @@ +#include "auth.h" + +extern User users[]; +extern int nbUsers; + +int authentifier(std::string login, std::string password) { + for(int i = 0; i < nbUsers; i++) { + if(users[i].login == login && users[i].password == password) { + return i; + } + } + return -1; +} \ No newline at end of file