db: core/user table has only 'notify' column now (previous was cms_notify, thread_notify)
added: notifications for tickets (not finished yet) git-svn-id: svn://ttmath.org/publicrep/winix/trunk@688 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
15
db/db.cpp
15
db/db.cpp
@@ -68,13 +68,12 @@ Error Db::AddUser(User & user, const std::wstring & password)
|
||||
try
|
||||
{
|
||||
query.Clear();
|
||||
query << R("insert into core.user (login, password, super_user, email, cms_notify, thread_notify) values (")
|
||||
query << R("insert into core.user (login, password, super_user, email, notify) values (")
|
||||
<< user.name
|
||||
<< password
|
||||
<< static_cast<int>(user.super_user)
|
||||
<< user.email
|
||||
<< user.cms_notify
|
||||
<< user.thread_notify
|
||||
<< user.notify
|
||||
<< R(");");
|
||||
|
||||
r = AssertQuery(query);
|
||||
@@ -1295,7 +1294,7 @@ void Db::GetUsers(UGContainer<User> & user_tab)
|
||||
try
|
||||
{
|
||||
query.Clear();
|
||||
query << R("select id, login, super_user, group_id, email, cms_notify, thread_notify"
|
||||
query << R("select id, login, super_user, group_id, email, notify"
|
||||
" from core.user left outer join core.group_mem on"
|
||||
" core.user.id = core.group_mem.user_id order by id asc;");
|
||||
|
||||
@@ -1308,9 +1307,8 @@ void Db::GetUsers(UGContainer<User> & user_tab)
|
||||
int cname = AssertColumn(r, "login");
|
||||
int csuper_user = AssertColumn(r, "super_user");
|
||||
int cgroup_id = AssertColumn(r, "group_id");
|
||||
int cemail = AssertColumn(r, "email");
|
||||
int ccms_notify = AssertColumn(r, "cms_notify");
|
||||
int cthread_notify = AssertColumn(r, "thread_notify");
|
||||
int cemail = AssertColumn(r, "email");
|
||||
int cnotify = AssertColumn(r, "notify");
|
||||
|
||||
User u;
|
||||
long last_id = -1;
|
||||
@@ -1325,8 +1323,7 @@ void Db::GetUsers(UGContainer<User> & user_tab)
|
||||
u.name = AssertValueWide(r, i, cname);
|
||||
u.super_user = static_cast<bool>(AssertValueInt(r, i, csuper_user));
|
||||
u.email = AssertValueWide(r, i, cemail);
|
||||
u.cms_notify = AssertValueInt(r, i, ccms_notify);
|
||||
u.thread_notify = AssertValueInt(r, i, cthread_notify);
|
||||
u.notify = AssertValueInt(r, i, cnotify);
|
||||
|
||||
log << log1 << "Db: get user: id:" << u.id << ", name:" << u.name << ", super_user:" << u.super_user << logend;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user