virtual EModRet OnIRCConnecting(CIRCSock *pIRCSock) { if (HasPemFile()) { pIRCSock->SetPemLocation(PemFile()); } return CONTINUE; }
void Info(const CString &line) { if (HasPemFile()) { PutModule("You have a certificate in: " + PemFile()); } else { PutModule("You do not have a certificate. Please use the web interface to add a certificate"); if (m_pUser->IsAdmin()) { PutModule("Alternatively you can either place one at " + PemFile()); } } }
void Info(const CString& line) { if (HasPemFile()) { PutModule(t_f("You have a certificate in {1}")(PemFile())); } else { PutModule(t_s( "You do not have a certificate. Please use the web interface " "to add a certificate")); if (GetUser()->IsAdmin()) { PutModule(t_f("Alternatively you can either place one at {1}")( PemFile())); } } }
virtual bool OnWebRequest(CWebSock& WebSock, const CString& sPageName, CTemplate& Tmpl) { if (sPageName == "index") { Tmpl["Cert"] = CString(HasPemFile()); return true; } else if (sPageName == "update") { CFile fPemFile(PemFile()); if (fPemFile.Open(O_WRONLY | O_TRUNC | O_CREAT)) { fPemFile.Write(WebSock.GetParam("cert", true, "")); fPemFile.Close(); } WebSock.Redirect("/mods/cert/"); return true; } else if (sPageName == "delete") { CFile::Delete(PemFile()); WebSock.Redirect("/mods/cert/"); return true; } return false; }