示例#1
0
int main() {
	Priv sec = new Priv();
	sec.login();

	// Things like "users" and other important data need to be written and printed to files everytime this program closes.
	// Ernie: I suspect this will make use of the built-in file class and one or more data structures (vectors, etc.).

	return 0;
}
示例#2
0
int main() {

	string instructions = "Please choose one of the following:";
	
	vector<string> MenuOptions = 
	{
		"List All Employees",
		"View Employee",
		"Add Employee",
		"Delete Employee",
		"Add New User",
		"Set Cipher",
		"Set Encryption Key",
		"Performance Reports"
		// "Change User Priviledges"
		// "AddFolder",
		// "EditFolder",
		// "DeleteFolder",
	};

	int maxAdminVal = MenuOptions.size();
	int maxPrivValues[3] = { 3, 4, maxAdminVal };

	while(true) {
		// Initialization
		Database database = *(new Database());
		Priv priv = *(new Priv());
		priv.login();

		int visibility = maxPrivValues[priv.getAuth()];
		vector<string> TempMenu = MenuOptions;
		TempMenu.resize(visibility);
		vector<string> CustomMenu = TempMenu;
		CustomMenu.push_back("Exit");
		printGenericMenu(instructions, CustomMenu);
		// Asking for user input. +1 so it exits on max +1, which is Exit
		int menuOptions = RecursivelyValidate(visibility+1);

		// Based on menuOptions go to each submenu. Or Exit
		if (menuOptions < visibility)
		{
			switch (menuOptions)
			{
			case 0:
				database.listEmployees();
				break;
			case 1:
				database.viewEmployee(getEmployeeName());
				break;
			case 2:
				database.addEmployee(getEmployeeName());
				break;
			case 3:
				database.deleteEmployee(getEmployeeName());
				break;
			case 4:
				priv.setNewUser();
				break;
			case 5:
				priv.setCipher();
				break;
			case 6:
				priv.setKey();
				break;
			case 7:
				database.performanceReport(getEmployeeName());
				break;
			default:
				break;
			}
		}
		else
			break;
	}
	

	return 0;
}