some optimization
Prepare Build and Testing executable binary / Prepare-Build-Testing-With-Make (push) Has been cancelled
Prepare Build and Testing executable binary / Prepare-Build-Testing-With-CMake (push) Has been cancelled
Prepare Build and Testing executable binary / Prepare-Build-Testing-With-Meson (push) Has been cancelled
Prepare Build and Testing executable binary / Prepare-Build-Testing-With-Make (push) Has been cancelled
Prepare Build and Testing executable binary / Prepare-Build-Testing-With-CMake (push) Has been cancelled
Prepare Build and Testing executable binary / Prepare-Build-Testing-With-Meson (push) Has been cancelled
This commit is contained in:
@@ -59,7 +59,7 @@ void change_password(const httplib::Request& request, httplib::Response& respons
|
||||
return;
|
||||
}
|
||||
|
||||
std::ifstream usersfile("users.json");
|
||||
std::ifstream usersfile(USERS_FILE);
|
||||
nlohmann::json all_users = nlohmann::json::parse(usersfile);
|
||||
usersfile.close();
|
||||
|
||||
@@ -114,7 +114,7 @@ void change_password(const httplib::Request& request, httplib::Response& respons
|
||||
syslog(LOG_ERR, "can't find this user in change password request");
|
||||
return;
|
||||
}
|
||||
std::ofstream usersfilew("users.json");
|
||||
std::ofstream usersfilew(USERS_FILE);
|
||||
usersfilew << all_users.dump(4);
|
||||
usersfilew.close();
|
||||
response.set_content(R"({"status":"ok"})", JSON_TYPE);
|
||||
|
||||
@@ -47,7 +47,7 @@ void change_user(const httplib::Request& request, httplib::Response& response)
|
||||
return;
|
||||
}
|
||||
|
||||
std::ifstream usersfile("users.json");
|
||||
std::ifstream usersfile(USERS_FILE);
|
||||
nlohmann::json all_users = nlohmann::json::parse(usersfile);
|
||||
usersfile.close();
|
||||
|
||||
@@ -105,7 +105,7 @@ void change_user(const httplib::Request& request, httplib::Response& response)
|
||||
syslog(LOG_ERR, "can't find this user in change user request");
|
||||
return;
|
||||
}
|
||||
std::ofstream usersfilew("users.json");
|
||||
std::ofstream usersfilew(USERS_FILE);
|
||||
usersfilew << all_users.dump(4);
|
||||
usersfilew.close();
|
||||
response.set_content(R"({"status":"ok"})", JSON_TYPE);
|
||||
|
||||
@@ -39,7 +39,7 @@ void delete_user(const httplib::Request& request, httplib::Response& response)
|
||||
return;
|
||||
}
|
||||
|
||||
std::ifstream usersfile("users.json");
|
||||
std::ifstream usersfile(USERS_FILE);
|
||||
nlohmann::json all_users = nlohmann::json::parse(usersfile);
|
||||
usersfile.close();
|
||||
|
||||
@@ -80,7 +80,7 @@ void delete_user(const httplib::Request& request, httplib::Response& response)
|
||||
syslog(LOG_ERR, "can't find this user in delete user request");
|
||||
return;
|
||||
}
|
||||
std::ofstream usersfilew("users.json");
|
||||
std::ofstream usersfilew(USERS_FILE);
|
||||
usersfilew << all_users.dump(4);
|
||||
usersfilew.close();
|
||||
response.set_content(R"({"status":"ok"})", JSON_TYPE);
|
||||
|
||||
@@ -33,7 +33,7 @@ void get_all_users(const httplib::Request& request, httplib::Response& response)
|
||||
syslog(LOG_ERR, "access reject in get all user request");
|
||||
return;
|
||||
}
|
||||
std::ifstream usersfile("users.json");
|
||||
std::ifstream usersfile(USERS_FILE);
|
||||
nlohmann::json all_users = nlohmann::json::parse(usersfile);
|
||||
usersfile.close();
|
||||
nlohmann::json response_user_data = nullptr;
|
||||
|
||||
Reference in New Issue
Block a user