From 8d190f8548e75606964ce66002a096b994315396 2016-02-19 22:23:54 From: Jan Kaluza Date: 2016-02-19 22:23:54 Subject: [PATCH] Web interface: Do not allow empty password when it is needed --- diff --git a/spectrum_manager/src/APIServer.cpp b/spectrum_manager/src/APIServer.cpp index 3ad86fb14abea541143b17fe582e3c7531d50112..0a25b696019c0f7f66ad1cc0652e4038430a2425 100644 --- a/spectrum_manager/src/APIServer.cpp +++ b/spectrum_manager/src/APIServer.cpp @@ -259,16 +259,17 @@ void APIServer::serve_instances_register(Server *server, Server::session *sessio // For some networks like IRC, there is no registration. // We detect such networks according to registration_fields and use // "unknown" uin for them. - if (uin.empty()) { + if (uin.empty() || password.empty()) { std::string response = server->send_command(instance, "registration_fields"); std::vector fields; boost::split(fields, response, boost::is_any_of("\n")); if (fields.size() == 1) { uin = "unknown"; + password = "unknown"; } } - if (jid.empty() || uin.empty()) { + if (jid.empty() || uin.empty() || password.empty()) { send_ack(conn, true, "Insufficient data."); } else {