48 |
std::cout << QUIT << std::endl << std::endl; |
std::cout << QUIT << std::endl << std::endl; |
49 |
} |
} |
50 |
|
|
51 |
|
static int action_crypt(class c_list_user *list_user) |
52 |
|
{ |
53 |
|
std::string path, passphrase, user_name; |
54 |
|
|
55 |
|
passphrase = list_user->get_list_user() |
56 |
|
[list_user->get_id_user()]->get_password()->get_passphrase_clear() ; |
57 |
|
// + empreinte de la voix |
58 |
|
std::cout << FILECRYPT; |
59 |
|
path = get_stdin(""); |
60 |
|
user_name = list_user->get_list_user() |
61 |
|
[list_user->get_id_user()]->get_name_user(); |
62 |
|
std::cout << std::endl; |
63 |
|
return crypt(path, user_name, passphrase); |
64 |
|
} |
65 |
|
|
66 |
|
static int action_decrypt(class c_list_user *list_user) |
67 |
|
{ |
68 |
|
std::string path, passphrase; |
69 |
|
|
70 |
|
std::cout << FILEDECRYPT; |
71 |
|
path = get_stdin(""); |
72 |
|
std::cout << std::endl; |
73 |
|
passphrase = list_user->get_list_user() |
74 |
|
[list_user->get_id_user()]->get_password()->get_passphrase_clear() ; |
75 |
|
// + empreinte de la voix |
76 |
|
return decrypt(path, passphrase); |
77 |
|
} |
78 |
|
|
79 |
int c_list_user::action_quit() |
int c_list_user::action_quit() |
80 |
{ |
{ |
81 |
std::string answer; |
std::string answer; |
82 |
|
|
83 |
std::cout << QUITCONFIRM << " " << YESNO; |
std::cout << QUITCONFIRM << " " << YESNO; |
84 |
answer = get_stdin(); |
answer = get_stdin(YES); |
85 |
std::cout << std::endl; |
std::cout << std::endl; |
86 |
if (answer == YES) |
if (answer == YES) |
87 |
{ |
{ |
101 |
{ |
{ |
102 |
print_action(this); |
print_action(this); |
103 |
std::cout << WHICHACTION; |
std::cout << WHICHACTION; |
104 |
answer = get_stdin(); |
answer = get_stdin(""); |
105 |
std::cout << std::endl; |
std::cout << std::endl; |
106 |
if (answer == "1") |
if (answer == "1") |
107 |
{ |
if (action_crypt(this) != 0) |
108 |
crypt(); |
return 1; |
|
} |
|
109 |
if (answer == "2") |
if (answer == "2") |
110 |
{ |
if (action_decrypt(this) != 0) |
111 |
decrypt(); |
return 1; |
|
} |
|
112 |
if (answer == "3") |
if (answer == "3") |
113 |
{ |
del_user(_id_user); |
|
del_user(_id_user); |
|
|
} |
|
114 |
if (answer == "4") |
if (answer == "4") |
115 |
{ |
if (action_quit() == 0) |
116 |
if (action_quit() == 0) |
return 0; |
|
break ; |
|
|
} |
|
117 |
} |
} |
118 |
return 0; |
return 0; |
119 |
} |
} |