-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBase.cpp
More file actions
55 lines (47 loc) · 1.12 KB
/
Base.cpp
File metadata and controls
55 lines (47 loc) · 1.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#include "Base.h"
void Base::registration(Base& u, string name) //Ââîä ñ êëàâèàòóðû ëîãèíà è ïàðîëÿ
{
inFile.open(name);
if (!inFile.is_open())
{
cout << "Problem with opening file " << name << "!";
cin.get();
cin.get();
exit(EXIT_FAILURE);
}
LogReg(u);
PassReg(u);
TimeDelay();
cout << std::endl;
cout << "Your account has been created, " << u.login << "!\n" << endl;
}
int Base::autentication(const Base& usr) //ïðîâåðêà äàííûõ ðåãèñòðàöèè
{
string login, password;
cout << "Enter your login: ";
cin >> login;
cout << "Enter your password: ";
cin >> password;
if (login != login or password != password)
{
for (int i = 3; i > 0; i--)
{
cout << "Wrong user data! You have " << i << " tries left. Try again!\n";
cout << "Login: ";
cin >> login;
cout << "Password: ";
cin >> password;
if (login == login and password == password)
{
cout << "Welcome back, " << login << "!";
return 0; //return 0??????
}
}
cout << "Access denied!";
}
else if (login == login and password == password)
{
cout << "Welcome back, " << login << "!";
return 1;
}
}