<%pre> #include "tools.h" #include "setup.h" using namespace std; using namespace vdrlive; <%args> std::string login; std::string password; std::string action; <%session scope="global"> bool logged_in(false); <{ std::string message; if (action == "login") { if ((login == LiveSetup().GetAdminLogin()) && (MD5Hash(password) == LiveSetup().GetMD5HashAdminPassword())) { logged_in = true; } else { message = tr("Wrong username or password"); } } else if (action == "logout") { logged_in = false; } LiveSetup().CheckLocalNet(request.getPeerIp()); if (logged_in || !LiveSetup().UseAuth()) return reply.redirect(LiveSetup().GetStartScreenLink()); }> <& pageelems.doc_type &> VDR-Live - <$ tr("Login") $> <& pageelems.stylesheets &> <& pageelems.ajax_js &>
<$ tr("VDR Live Login") $>
" alt="VDR Live">
<$ message $>