129 lines
2.6 KiB
C++
Executable file
129 lines
2.6 KiB
C++
Executable file
#include <fstream>
|
|
#include <iostream>
|
|
#include <vector>
|
|
using namespace std;
|
|
|
|
|
|
class User {
|
|
string name;
|
|
string password;
|
|
string phone_number;
|
|
string fax_number;
|
|
string postal_address;
|
|
vector<string> groups;
|
|
vector<string> messages;
|
|
|
|
bool is_admin;
|
|
bool is_logged_in;
|
|
|
|
public:
|
|
User();
|
|
User(string n, string pass, string phone, string fax, string postal, bool admin);
|
|
string getName();
|
|
string getPassword();
|
|
string getPhoneNumber();
|
|
string getFaxNumber();
|
|
string getPostalAddress();
|
|
vector<string> getGroups();
|
|
vector<string> getMessages();
|
|
bool confirmAdmin();
|
|
bool checkLogin();
|
|
void setName(string new_name);
|
|
void setPassword(string new_name);
|
|
void setPhone(string new_phone);
|
|
void setFax(string new_fax);
|
|
void setPostal(string new_postal);
|
|
vector<string> getInfo();
|
|
};
|
|
|
|
class Message {
|
|
string sender;
|
|
string receiver;
|
|
string timestamp;
|
|
string text;
|
|
|
|
public:
|
|
Message();
|
|
Message(string time, string t, string s, string r);
|
|
string getSender();
|
|
string getReceiver();
|
|
string getTimestamp();
|
|
string getText();
|
|
void changeText(string input);
|
|
vector<string> getInfo();
|
|
};
|
|
|
|
class Article {
|
|
string author;
|
|
string text;
|
|
string timestamp;
|
|
string length;
|
|
|
|
public:
|
|
Article();
|
|
Article(string a, string text, string time);
|
|
string getAuthor();
|
|
string getText();
|
|
string getTimestamp();
|
|
string getLength();
|
|
vector<string> getInfo();
|
|
};
|
|
|
|
class Board {
|
|
string name;
|
|
string description;
|
|
bool lockedForGroup;
|
|
string group;
|
|
vector<Article> articles;
|
|
|
|
public:
|
|
Board();
|
|
Board(string n, string d);
|
|
Board(string n, string d, bool l, string g);
|
|
string getName();
|
|
string getDescription();
|
|
bool checkIfLocked();
|
|
string getGroup();
|
|
vector<string> getInfo();
|
|
vector<Article> getArticles();
|
|
void addArticle(Article article);
|
|
};
|
|
|
|
class Group {
|
|
string name;
|
|
string description;
|
|
vector<Board> boards;
|
|
|
|
public:
|
|
Group();
|
|
Group(string n, string d);
|
|
string getName();
|
|
string getDescription();
|
|
vector<Board> getBoards();
|
|
void addBoard(Board input);
|
|
vector<string> getInfo();
|
|
};
|
|
|
|
|
|
|
|
|
|
/*
|
|
void mainMenu()
|
|
{
|
|
cout<<"\n\n***************"<<endl;
|
|
cout<<"** Main Menu **"<<endl;
|
|
cout<<"***************\n"<<endl;
|
|
cout<<"\n5. Account Settings"<<endl;
|
|
cout<<"4. Articles"<<endl;
|
|
cout<<"3. Boards"<<endl;
|
|
cout<<"2. View Messages"<<endl;
|
|
cout<<"1. Groups\n"<<endl;
|
|
if (currentUser.confirmAdmin() == true)
|
|
{
|
|
cout<<"9. View pending account requests\n"<<endl;
|
|
cout<<"10. View current users\n"<<endl;
|
|
}
|
|
cout<<"8. Logout\n"<<endl;
|
|
cout<<"Enter choice: ";
|
|
}
|
|
*/
|