diff --git a/src/ClientCommand.cpp b/src/ClientCommand.cpp index d04ce62b83..cda06b2755 100644 --- a/src/ClientCommand.cpp +++ b/src/ClientCommand.cpp @@ -1625,8 +1625,7 @@ static void AddCommandHelp(CTable& Table, const CString& sCmd, const CString& sA { if (sFilter.empty() || sCmd.StartsWith(sFilter) || sCmd.AsLower().WildCmp(sFilter.AsLower())) { Table.AddRow(); - Table.SetCell("Command", sCmd); - Table.SetCell("Arguments", sArgs); + Table.SetCell("Command", sCmd + " " + sArgs); Table.SetCell("Description", sDesc); } } @@ -1634,7 +1633,6 @@ static void AddCommandHelp(CTable& Table, const CString& sCmd, const CString& sA void CClient::HelpUser(const CString& sFilter) { CTable Table; Table.AddColumn("Command"); - Table.AddColumn("Arguments"); Table.AddColumn("Description"); if (sFilter.empty()) { diff --git a/src/HTTPSock.cpp b/src/HTTPSock.cpp index 3936c3cac9..933b14e3fa 100644 --- a/src/HTTPSock.cpp +++ b/src/HTTPSock.cpp @@ -136,7 +136,7 @@ void CHTTPSock::ReadLine(const CString& sData) { sLine.Token(2).Base64Decode(sUnhashed); m_sUser = sUnhashed.Token(0, false, ":"); m_sPass = sUnhashed.Token(1, true, ":"); - m_bLoggedIn = OnLogin(m_sUser, m_sPass, true); + // Postpone authorization attempt until end of headers, because cookies should be read before that, otherwise session id will be overwritten in GetSession() } else if (sName.Equals("Content-Length:")) { m_uPostLen = sLine.Token(1).ToULong(); if (m_uPostLen > MAX_POST_SIZE) @@ -184,6 +184,14 @@ void CHTTPSock::ReadLine(const CString& sData) { } else if (sLine.empty()) { m_bGotHeader = true; + if (!m_sUser.empty()) { + m_bLoggedIn = OnLogin(m_sUser, m_sPass, true); + if (!m_bLoggedIn) { + // Error message already was sent + return; + } + } + if (m_bPost) { m_sPostData = GetInternalReadBuffer(); CheckPost(); diff --git a/src/WebModules.cpp b/src/WebModules.cpp index 42b46f9344..c1ce60edd5 100644 --- a/src/WebModules.cpp +++ b/src/WebModules.cpp @@ -473,7 +473,6 @@ CWebSock::EPageReqResult CWebSock::PrintTemplate(const CString& sPageName, CStri m_Template["PageName"] = sPageName; if (pModule) { - CUser* pUser = pModule->GetUser(); m_Template["ModName"] = pModule->GetModName(); if (m_Template.find("Title") == m_Template.end()) {