diff options
author | Christian Wieninger <cwieninger (at) gmx (dot) de> | 2007-05-23 17:33:08 +0000 |
---|---|---|
committer | Christian Wieninger <cwieninger (at) gmx (dot) de> | 2007-05-23 17:33:08 +0000 |
commit | d0ec6ac5a5e8858d423923778fdd5667297f63c2 (patch) | |
tree | af131913b1cb7b657384ed1ab14d674e634c3b29 /setup.cpp | |
parent | 2a543304c089a0e8f942fe23fe3db59017b84a20 (diff) | |
download | vdr-plugin-live-d0ec6ac5a5e8858d423923778fdd5667297f63c2.tar.gz vdr-plugin-live-d0ec6ac5a5e8858d423923778fdd5667297f63c2.tar.bz2 |
- show auth part only when enabled
- common method Setup::SaveSetup to store setup values from osd and web frontend
Diffstat (limited to 'setup.cpp')
-rw-r--r-- | setup.cpp | 26 |
1 files changed, 16 insertions, 10 deletions
@@ -28,6 +28,7 @@ Setup::Setup(): m_adminLogin("admin") { m_adminPasswordMD5 = "4:" + MD5Hash("live"); + liveplugin = cPluginManager::GetPlugin("live"); } bool Setup::ParseCommandLine( int argc, char* argv[] ) @@ -130,6 +131,19 @@ std::string Setup::SetAdminPassword(std::string password) return m_adminPasswordMD5; } +bool Setup::SaveSetup() +{ + if (!liveplugin) return false; + liveplugin->SetupStore("LastChannel", m_lastChannel); + liveplugin->SetupStore("UseAuth", m_useAuth); + if (m_useAuth) + { + liveplugin->SetupStore("AdminLogin", m_adminLogin.c_str()); + liveplugin->SetupStore("AdminPasswordMD5", m_adminPasswordMD5.c_str()); + } + return true; +} + Setup& LiveSetup() { static Setup instance; @@ -168,19 +182,11 @@ void cMenuSetupLive::Set(void) void cMenuSetupLive::Store(void) { vdrlive::LiveSetup().SetLastChannel(m_lastChannel); - SetupStore("LastChannel", m_lastChannel); - vdrlive::LiveSetup().SetUseAuth(m_useAuth); - SetupStore("UseAuth", m_useAuth); - vdrlive::LiveSetup().SetAdminLogin(m_adminLogin); - SetupStore("AdminLogin", m_adminLogin); - if (m_oldpasswordMD5 != m_newpasswordMD5) // only save the password if needed - { - std::string passwordMD5 = vdrlive::LiveSetup().SetAdminPassword(m_adminPassword); - SetupStore("AdminPasswordMD5", passwordMD5.c_str()); - } + vdrlive::LiveSetup().SetAdminPassword(m_adminPassword); + LiveSetup().SaveSetup(); } bool cMenuSetupLive::InEditMode(const char* ItemText, const char* ItemName, const char* ItemValue) |