Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int main(){
- string input = "";
- string password;
- string userClearance;
- string directory;
- remenu:
- getline(cin, input);
- if(input.compare("FileSystem -i") == 0){
- cout << "Username: ";
- cin >> input;
- userRegistration(input);
- goto remenu;
- }
- else if(input.compare("FileSystem") == 0){
- fileInitializer();
- reLogin:
- cout << "Username: ";
- cin >> input;
- cout << "Password:";
- char ch = _getch();
- while(ch != 13){//character 13 is enter
- password.push_back(ch);
- ch = _getch();
- }
- cout << endl;
- if(userAuthentication(input, password, directory, userClearance)){
- displayMenu(stoi(userClearance));
- }
- else{
- cout << "Invalid username or password" << endl;
- reCaptcha:
- //captcha generation
- string captcha = generateCaptcha(9);
- cout << captcha;
- // Ask user to enter a CAPTCHA
- string usr_captcha;
- cout << "\nEnter above CAPTCHA: ";
- cin >> usr_captcha;
- // Notify user about matching status
- if (checkCaptcha(captcha, usr_captcha)){
- cout << "\nCAPTCHA Matched" << endl;
- goto reLogin;
- }
- else{
- cout << "\nCAPTCHA Not Matched" << endl;
- goto reCaptcha;
- }
- }
- cin.clear();
- cin.ignore(1000, '\n');
- goto remenu;
- }
- else{
- cout << "Unknown command entered, please try again" << endl;
- goto remenu;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement