summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--i18n.cpp22
-rw-r--r--pages/setup.ecpp34
2 files changed, 44 insertions, 12 deletions
diff --git a/i18n.cpp b/i18n.cpp
index 0ec0a88..aa94135 100644
--- a/i18n.cpp
+++ b/i18n.cpp
@@ -4143,6 +4143,28 @@ const tI18nPhrase Phrases[] = {
"", // Dansk
"", // Czech
},
+ { "Please set login and password!", // English
+ "Bitte Login und Passwort angeben!", // Deutsch
+ "", // Slovenski
+ "", // Italiano
+ "", // Nederlands
+ "", // Português
+ "", // Français
+ "", // Norsk
+ "", // Finnish
+ "", // Polski
+ "", // Español
+ "", // Greek
+ "", // Svenska
+ "", // Românã
+ "", // Magyar
+ "", // Català
+ "", // Russian
+ "", // Hrvatski
+ "", // Eesti
+ "", // Dansk
+ "", // Czech
+ },
/*
{ "", // English
"", // Deutsch
diff --git a/pages/setup.ecpp b/pages/setup.ecpp
index 43c0de8..88ea00d 100644
--- a/pages/setup.ecpp
+++ b/pages/setup.ecpp
@@ -27,20 +27,27 @@ if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html");
<%cpp>
#define SELECTIF(x) reply.out() << ( (x) ? "selected=\"selected\"" : "" );
+ std::string message;
+
if ( request.getMethod() == "POST") {
- LiveSetup().SetLastChannel(lastchannel != "" ? lexical_cast< int >(lastchannel):0);
- LiveSetup().SetUseAuth(useauth);
- if (useauth) {
- LiveSetup().SetAdminLogin(login);
- if (pass != "")
- LiveSetup().SetAdminPassword(pass);
- LiveSetup().SetLocalNetMask(localnetmask);
- LiveSetup().CheckLocalNet(request.getPeerIp());
+ if (useauth && (login.empty() || pass.empty()))
+ message = tr("Please set login and password!");
+ else
+ {
+ LiveSetup().SetLastChannel(lastchannel != "" ? lexical_cast< int >(lastchannel):0);
+ LiveSetup().SetUseAuth(useauth);
+ if (useauth) {
+ LiveSetup().SetAdminLogin(login);
+ if (pass != "")
+ LiveSetup().SetAdminPassword(pass);
+ LiveSetup().SetLocalNetMask(localnetmask);
+ LiveSetup().CheckLocalNet(request.getPeerIp());
+ }
+ LiveSetup().SetTimes(times);
+ LiveSetup().SetStartScreen(startscreen);
+ LiveSetup().SetTheme(theme);
+ LiveSetup().SaveSetup();
}
- LiveSetup().SetTimes(times);
- LiveSetup().SetStartScreen(startscreen);
- LiveSetup().SetTheme(theme);
- LiveSetup().SaveSetup();
}
pageTitle = tr("Setup");
int ilastchannel = LiveSetup().GetLastChannel();
@@ -167,6 +174,9 @@ if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html");
</tr>
</table>
</form>
+ <div style="color: red; margin: 0 auto;">
+ <$ message $>
+ </div>
</div>
</body>
</html>