mirror of
https://github.com/Expand-sys/CCash
synced 2026-03-22 20:47:10 +11:00
✨ AddUser is togglable now
This commit is contained in:
parent
5026285d1b
commit
32e91a188a
1 changed files with 27 additions and 16 deletions
|
|
@ -205,7 +205,7 @@ void api::AdminVerifyAccount(req_args)
|
||||||
}
|
}
|
||||||
void api::ApiProperties(req_args)
|
void api::ApiProperties(req_args)
|
||||||
{
|
{
|
||||||
std::string info = "{\"version\":" + std::to_string(API_VERSION) + ",\"max_log\":" + std::to_string(MAX_LOG_SIZE);
|
std::string info = "{\"version\":" + std::to_string(API_VERSION) + ",\"max_log\":" + std::to_string(MAX_LOG_SIZE) + ",\"add_user_open\":" + std::to_string(ADD_USER_OPEN);
|
||||||
if constexpr (RETURN_ON_DEL)
|
if constexpr (RETURN_ON_DEL)
|
||||||
{
|
{
|
||||||
info += ",\"return_on_del\":\"" + std::string(return_account) + "\"}";
|
info += ",\"return_on_del\":\"" + std::string(return_account) + "\"}";
|
||||||
|
|
@ -257,6 +257,9 @@ void api::PruneUsers(req_args)
|
||||||
|
|
||||||
void api::AddUser(req_args)
|
void api::AddUser(req_args)
|
||||||
{
|
{
|
||||||
|
if constexpr (ADD_USER_OPEN)
|
||||||
|
{
|
||||||
|
|
||||||
SIMD_JSON_GEN;
|
SIMD_JSON_GEN;
|
||||||
BankResponse res;
|
BankResponse res;
|
||||||
if (doc.error())
|
if (doc.error())
|
||||||
|
|
@ -279,6 +282,14 @@ void api::AddUser(req_args)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
RESPONSE_PARSE(std::move(res));
|
RESPONSE_PARSE(std::move(res));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
auto resp = HttpResponse::newCustomHttpResponse(BankResponse{k404NotFound, "\"AddUser is Disabled\""});
|
||||||
|
CORS;
|
||||||
|
CACHE_FOREVER;
|
||||||
|
callback(resp);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
void api::AdminAddUser(req_args)
|
void api::AdminAddUser(req_args)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue