Init
This commit is contained in:
28
userAuth.h
Normal file
28
userAuth.h
Normal file
@@ -0,0 +1,28 @@
|
||||
#ifndef COURSE_DESIGN_USERAUTH_H_
|
||||
#define COURSE_DESIGN_USERAUTH_H_
|
||||
|
||||
#include "sqlite3.h"
|
||||
#include "tools.h"
|
||||
|
||||
using namespace std;
|
||||
|
||||
struct UserStruct {
|
||||
int id;
|
||||
string username;
|
||||
string userpassword;
|
||||
string created_time;
|
||||
};
|
||||
|
||||
void init_user_data(sqlite3 *db);
|
||||
|
||||
void register_user(sqlite3 *db, const string &username,
|
||||
const string &userpassword);
|
||||
bool login_user(sqlite3 *db, const std::string &username,
|
||||
const std::string &password);
|
||||
bool update_user(sqlite3 *db, int id, const string &new_username,
|
||||
const string &new_password);
|
||||
vector<UserStruct> get_user_inputs(sqlite3 *db);
|
||||
|
||||
bool delete_user(sqlite3 *db, int id);
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user