DB & DB Api specs:
TUsers:
id bigint NN autoincrement PK
username varchar(64) NN
password varchar(32) NN
email varchar(64) NN
role smallint NN FK->TRoles(id)
firstname varchar(64) NN
lastname varchar(64) NN
country long NN FK->TCountries(id)
birthday datetime NN
creation datetime NN // the date the account has been created on
TCountries:
id long NN autoincrement PK
name varchar(128) NN
TBan:
id bigint NN autoincrement PK
type set(1,2,3,4) NN // 1=BanHost, 2=BanUser, 3=BanEmail, 4=BanIp
entity varchar(128) NN // banned entity (value depends on the type)
bandate datetime NN // the date the ban has been set on
expire datetime NN // if equals 00/00/0000 unlimited ban
setter bigint NN FK->TUsers(id) // who set the ban
TRoles:
id smallint NN PK
name varchar(32) NN
Api:
TUsers:
int db_insert_user (Client*)
int db_delete_user (long id)
int db_update_user (Client*)
Client* db_auth_user (char* user, char*pwd)
TCountries:
int db_select_country_id (char*)
int db_select_country_name (short)
int db_insert_country (char*)
int db_delete_country (long id)
int db_delete_country_byname(char*)
TBan:
int db_insert_ban (SBan*) //create SBan structure
int db_delete_ban (short id)
int db_update_ban (SBan*)
TRoles:
int db_insert_role (char*)
int db_delete_role (long id)
int db_delete_role_byname (char*)
Partager