summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Wieninger <cwieninger (at) gmx (dot) de>2007-06-05 18:30:10 +0000
committerChristian Wieninger <cwieninger (at) gmx (dot) de>2007-06-05 18:30:10 +0000
commitfec15b76036ebc651c581a344f4815cd2512f239 (patch)
tree15b077a42671ebb99c0fd5fc2104398b8558dbca
parentcff764959893258f9ddc4cef917ca8514fe3a60b (diff)
downloadvdr-plugin-live-fec15b76036ebc651c581a344f4815cd2512f239.tar.gz
vdr-plugin-live-fec15b76036ebc651c581a344f4815cd2512f239.tar.bz2
- check and save login/password only if changed
- message "Setup saved." after saving
-rw-r--r--i18n.cpp22
-rw-r--r--pages/setup.ecpp25
2 files changed, 38 insertions, 9 deletions
diff --git a/i18n.cpp b/i18n.cpp
index 93b991e..fd05ae0 100644
--- a/i18n.cpp
+++ b/i18n.cpp
@@ -4187,6 +4187,28 @@ const tI18nPhrase Phrases[] = {
"", // Dansk
"", // Czech
},
+ { "Setup saved.", // English
+ "Einstellungen gespeichert.", // 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 88ea00d..d7708df 100644
--- a/pages/setup.ecpp
+++ b/pages/setup.ecpp
@@ -16,6 +16,7 @@ using namespace std;
string startscreen;
string theme;
string localnetmask;
+ int authchanged = 0;
</%args>
<%session scope="global">
bool logged_in(false);
@@ -30,7 +31,7 @@ if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html");
std::string message;
if ( request.getMethod() == "POST") {
- if (useauth && (login.empty() || pass.empty()))
+ if (authchanged && useauth && (login.empty() || pass.empty()))
message = tr("Please set login and password!");
else
{
@@ -47,6 +48,7 @@ if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html");
LiveSetup().SetStartScreen(startscreen);
LiveSetup().SetTheme(theme);
LiveSetup().SaveSetup();
+ message = tr("Setup saved.");
}
}
pageTitle = tr("Setup");
@@ -72,13 +74,19 @@ if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html");
<& pageelems.ajax_js &>
<script type="text/javascript"><!--
function initform()
- {
+ {
changeduseauth(document.getElementById("useauth"));
+ if (document.getElementById("message").value != "")
+ alert(document.getElementById("message").value);
}
function changeduseauth(selection)
{
document.getElementById("authsection").style.display = (selection.checked ? "block" : "none");
}
+ function setauthchanged(selection)
+ {
+ document.getElementById("authchanged").value = 1;
+ }
//--></script>
</head>
<body onload="<& pageelems.infobox_start_update &>; initform()">
@@ -86,7 +94,9 @@ if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html");
<& menu active=("setup") &>
<div class="inhalt">
<form method="POST" name="setup" action="setup.ecpp">
- <table class="edit" cellpadding="0" cellspacing="0">
+ <input type="hidden" name="authchanged" value="<$ authchanged $>" id="authchanged"/>
+ <input type="hidden" name="message" value="<$ message $>" id="message"/>
+ <table class="edit" cellpadding="0" cellspacing="0">
<tr>
<td class="head" colspan="4"><div class="boxheader"><div><div><$ tr("Setup") $></div></div></div></td>
</tr>
@@ -105,11 +115,11 @@ if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html");
<table border="0" cellpadding="0" cellspacing="0" class="dependent">
<tr>
<td><$ tr("Admin login") $>:</td>
- <td><input type="text" name="login" value="<$ login $>" id="login" /></td>
+ <td><input type="text" name="login" value="<$ login $>" id="login" onchange="setauthchanged(this)" /></td>
</tr>
<tr>
<td><$ tr("Admin password") $>:</td>
- <td><input type="password" name="pass" value="<$ pass $>" id="pass" /></td>
+ <td><input type="password" name="pass" value="<$ pass $>" id="pass" onchange="setauthchanged(this)" /></td>
</tr>
<tr>
<td><$ tr("Local net (no login required)") $>:</td>
@@ -168,15 +178,12 @@ if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html");
<tr>
<td class="border" style="border-left: 1px solid black"></td>
<td class="buttonpanel" colspan="2">
- <button class="green" type="submit" name="save" onclick="return checksearch();"><$ tr("Save") $></button>
+ <button class="green" type="submit" name="save" ><$ tr("Save") $></button>
</td>
<td class="border" style="border-right: 1px solid black"></td>
</tr>
</table>
</form>
- <div style="color: red; margin: 0 auto;">
- <$ message $>
- </div>
</div>
</body>
</html>