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:
Ignacio R. Morelle 2015-08-22 02:27:41 -03:00
parent 2278219348
commit e399258b44

View file

@ -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;
}