You are on page 1of 1

void RegUser::updatePassword(string filePath) //working

{
cout << endl;
string userInput, newPass;
cout << "Enter current password to confirm -> "; cin >> userInput;

if (userInput == User::password) {
string blabla;
string qwe;
cout << "Current password is correct." << endl;
cout << endl;
cout << "Enter new password -> "; cin >> newPass;
cout << "Enter new blabla -> "; cin >> blabla;
cout << "Enter new qwe -> "; cin >> qwe;
//update password
string context = ";" + username + ";";
updateDetails(context, password, newPass, filePath);
string context1 = ";" + newPass + ";";
updateDetails(context1, icPass, blabla, filePath);
string context2 = ";" + blabla + ";";
updateDetails(context2, contactNo, qwe, filePath);
cout << "New Password has been set!" << endl;
system("pause");
}
else {
cout << "ERROR: Wrong password. Returning to Menu" << endl;
cout << endl;
}
}

You might also like