mirror of
https://github.com/wesnoth/wesnoth
synced 2025-05-13 21:59:52 +00:00
campaignd: Record the hashed passphrase for new uploads
Otherwise no passphrase is recorded into the server config and it becomes impossible to reupload the add-on without admin assistance.
This commit is contained in:
parent
2278219348
commit
e399258b44
@ -721,6 +721,8 @@ void server::handle_upload(const server::request& req)
|
||||
return;
|
||||
}
|
||||
|
||||
const bool existing_upload = campaign != NULL;
|
||||
|
||||
std::string message = "Add-on accepted.";
|
||||
|
||||
if(campaign == NULL) {
|
||||
@ -741,6 +743,10 @@ void server::handle_upload(const server::request& req)
|
||||
(*campaign)["type"] = upload["type"];
|
||||
(*campaign)["email"] = upload["email"];
|
||||
|
||||
if(!existing_upload) {
|
||||
set_passphrase(*campaign, upload["passphrase"]);
|
||||
}
|
||||
|
||||
if((*campaign)["downloads"].empty()) {
|
||||
(*campaign)["downloads"] = 0;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user