added USE_SQLITE3 option
Prepare Build and Testing executable binary / Prepare-Build-Testing-With-Make (push) Successful in 12s
Prepare Build and Testing executable binary / Prepare-Build-Testing-With-CMake (push) Failing after 8s
Prepare Build and Testing executable binary / Prepare-Build-Testing-With-Meson (push) Successful in 12s
Prepare Build and Testing executable binary / Prepare-Build-Testing-With-Make (push) Successful in 12s
Prepare Build and Testing executable binary / Prepare-Build-Testing-With-CMake (push) Failing after 8s
Prepare Build and Testing executable binary / Prepare-Build-Testing-With-Meson (push) Successful in 12s
This commit is contained in:
1 parent
634245e3ad
commit
73a73976fe
18 files changed
+115
-32
No files matched your search
@@ -3,6 +3,7 @@
|
||||
#include "user.h"
|
||||
|
||||
User *db_get_user_by_username(const char *username) {
|
||||
#ifdef USE_SQLITE3
|
||||
User *user = nullptr;
|
||||
pthread_mutex_lock(&db_mutex);
|
||||
if (!db) {
|
||||
@@ -28,8 +29,8 @@ User *db_get_user_by_username(const char *username) {
|
||||
const unsigned char *db_password = sqlite3_column_text(stmt, 3);
|
||||
const unsigned char *db_group = sqlite3_column_text(stmt, 4);
|
||||
int db_is_superuser = sqlite3_column_int(stmt, 5);
|
||||
user = new_user(id, (char *)db_username, (char *)db_password,
|
||||
(char *)db_email, (char *)db_group, db_is_superuser);
|
||||
user = new_user(id, (char *) db_username, (char *) db_password,
|
||||
(char *) db_email, (char *) db_group, db_is_superuser);
|
||||
}
|
||||
|
||||
if (rc != SQLITE_DONE) {
|
||||
@@ -41,4 +42,8 @@ User *db_get_user_by_username(const char *username) {
|
||||
|
||||
pthread_mutex_unlock(&db_mutex);
|
||||
return user;
|
||||
#else
|
||||
User *asdf = new_user(0, "asdf", "asdf", "asdf", "asdf", false);
|
||||
return asdf;
|
||||
#endif
|
||||
}
|
||||
Reference in new issue
Block a user