Ejemplo n.º 1
0
	virtual EModRet OnIRCConnecting(CIRCSock *pIRCSock) {
		if (HasPemFile()) {
			pIRCSock->SetPemLocation(PemFile());
		}

		return CONTINUE;
	}
Ejemplo n.º 2
0
	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());
			}
		}
	}
Ejemplo n.º 3
0
Archivo: cert.cpp Proyecto: GLolol/znc
 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()));
         }
     }
 }
Ejemplo n.º 4
0
	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;
	}