Repository navigation
Expand file tree
/
Copy pathUser.h
More file actions
executable file
·59 lines (52 loc) · 1.54 KB
/
Copy pathUser.h
File metadata and controls
executable file
·59 lines (52 loc) · 1.54 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#pragma once
#include <string.h>
#include <string>
#include <vector>
#include <ctime>
#include "BaseSQLiteModel.h"
class User:
public BaseSQLiteModel
{
private:
//db fiedls
std::string first_name;
std::string second_name;
std::string middle_name;
std::string phone;
std::string date_joined;
std::string password;
public:
// constructors
User();
static User* global_auth_uther;
// inheritance
static User* create(std::string first_name, std::string second_name, std::string middle_name, std::string phone, std::string password);
// destructors
~User();
// getters
std::string get_first_name();
std::string get_second_name();
std::string get_middle_name();
std::string get_phone();
std::string get_full_name();
std::string get_date_joined();
// setters
void set_first_name(std::string value);
void set_second_name(std::string value);
void set_middle_name(std::string value);
void set_date_joined(std::string value);
void set_date_joined(time_t value);
void set_phone(std::string value);
// set password as hash
void set_password(std::string password);
static std::string make_password(std::string origin_password);
// managers
static const std::string username_field;
void load_from_stmt(sqlite3_stmt* stmt);
static std::string get_table_name();
static User* get_by_id(int id);
static User* choice(std::vector<std::string> fields);
void prepare_params();
static bool check_phone(std::string phone);
static User* authenticate(std::string username, std::string password);
};