Permalink
Browse files

Show link to http://znc.in from web

  • Loading branch information...
1 parent 7beb717 commit fb2b5193bccb997caa3e9c191ca4e652c9162646 @DarthGandalf DarthGandalf committed Mar 21, 2012
View
@@ -55,7 +55,7 @@ class CZNC {
bool RehashConfig(CString& sError);
void BackupConfigOnce(const CString& sSuffix);
static CString GetVersion();
- static CString GetTag(bool bIncludeVersion = true);
+ static CString GetTag(bool bIncludeVersion = true, bool bHTML = false);
static CString GetCompileOptionsString();
CString GetUptime() const;
void ClearBindHosts();
View
@@ -432,12 +432,22 @@ bool CHTTPSock::PrintErrorPage(unsigned int uStatusId, const CString& sStatusMsg
}
CString sPage =
- "<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML 2.0//EN\">\r\n"
- "<html><head>\r\n<title>" + CString(uStatusId) + " " + sStatusMsg.Escape_n(CString::EHTML) + "</title>\r\n"
- "</head><body>\r\n<h1>" + sStatusMsg.Escape_n(CString::EHTML) + "</h1>\r\n"
- "<p>" + sMessage.Escape_n(CString::EHTML) + "</p>\r\n"
- "<hr />\r\n<address>" + CZNC::GetTag(false).Escape_n(CString::EHTML) + " at " + GetLocalIP().Escape_n(CString::EHTML) + " Port " + CString(GetLocalPort()) + "</address>\r\n"
- "</body></html>\r\n";
+ "<!DOCTYPE HTML>\r\n"
+ "<html>\r\n"
+ "<head>\r\n"
+ "<meta charset=\"utf-8\"/>\r\n"
+ "<title>" + CString(uStatusId) + " " + sStatusMsg.Escape_n(CString::EHTML) + "</title>\r\n"
+ "</head>\r\n"
+ "<body>\r\n"
+ "<h1>" + sStatusMsg.Escape_n(CString::EHTML) + "</h1>\r\n"
+ "<p>" + sMessage.Escape_n(CString::EHTML) + "</p>\r\n"
+ "<hr/>\r\n"
+ "<address>" +
+ CZNC::GetTag(false, /* bHTML = */ true) +
+ " at " + GetLocalIP().Escape_n(CString::EHTML) + " Port " + CString(GetLocalPort()) +
+ "</address>\r\n"
+ "</body>\r\n"
+ "</html>\r\n";
PrintHeader(sPage.length(), "text/html", uStatusId, sStatusMsg);
Write(sPage);
View
@@ -304,7 +304,7 @@ void CWebSock::SetPaths(CModule* pModule, bool bIsTemplate) {
void CWebSock::SetVars() {
m_Template["SessionUser"] = GetUser();
m_Template["SessionIP"] = GetRemoteIP();
- m_Template["Tag"] = CZNC::GetTag(GetSession()->GetUser() != NULL);
+ m_Template["Tag"] = CZNC::GetTag(GetSession()->GetUser() != NULL, true);
m_Template["SkinName"] = GetSkinName();
m_Template["_CSRF_Check"] = GetCSRFCheck();
View
@@ -79,17 +79,19 @@ CString CZNC::GetVersion() {
return szBuf;
}
-CString CZNC::GetTag(bool bIncludeVersion) {
+CString CZNC::GetTag(bool bIncludeVersion, bool bHTML) {
+ CString sAddress = bHTML ? "<a href=\"http://znc.in\">http://znc.in</a>" : "http://znc.in";
+
if (!bIncludeVersion) {
- return "ZNC - http://znc.in";
+ return "ZNC - " + sAddress;
}
char szBuf[128];
- snprintf(szBuf, sizeof(szBuf), "ZNC %1.3f"VERSION_EXTRA" - http://znc.in", VERSION);
+ snprintf(szBuf, sizeof(szBuf), "ZNC %1.3f"VERSION_EXTRA" - ", VERSION);
// If snprintf overflows (which I doubt), we want to be on the safe side
szBuf[sizeof(szBuf) - 1] = '\0';
- return szBuf;
+ return szBuf + sAddress;
}
CString CZNC::GetCompileOptionsString() {
@@ -1 +1 @@
- <div id="tag"><p><? VAR Tag ?></p></div>
+ <div id="tag"><p><? VAR Tag ESC=ASCII ?></p></div>
@@ -1 +1 @@
- <div id="banner"><p><? VAR Tag ?></p></div>
+ <div id="banner"><p><? VAR Tag ESC=ASCII ?></p></div>
@@ -1 +1 @@
- <div id="banner"><p><? VAR Tag ?></p></div>
+ <div id="banner"><p><? VAR Tag ESC=ASCII ?></p></div>

0 comments on commit fb2b519

Please sign in to comment.