void Credentials_Analyzer::Check_Admin(string admin_pass, Admin &a,Surfer&s)
{
	string pass=a.getPassword();
	if (s.getVisitTag() == false)
	{
		if (admin_pass == pass)
		{
			cout << "\aAccess granted, Welcome Admin!" << endl;
			bool tag = true;
			a.setEminencetag(tag);
		}
		else
		{
			cout << "\aAccess denied!You are not recognized as Admin!" << endl;
			bool tag = false;
			a.setEminencetag(tag);
		}
	}
}
Example #2
0
Admin *Library::adminLogin(const string &username, const string &password) {
	Admin *admin = AdminDAO::searchByName(username);
	if (admin && admin->getPassword() == password) return admin;
	return 0;
}