예제 #1
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());
			}
		}
	}
예제 #2
0
파일: cert.cpp 프로젝트: 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()));
         }
     }
 }
예제 #3
0
	virtual EModRet OnIRCConnecting(CIRCSock *pIRCSock) {
		if (HasPemFile()) {
			pIRCSock->SetPemLocation(PemFile());
		}

		return CONTINUE;
	}
예제 #4
0
	void Delete(const CString &line) {
		if (CFile::Delete(PemFile())) {
			PutModule("Pem file deleted");
		} else {
			PutModule("The pem file doesn't exist or there was a error deleting the pem file.");
		}
	}
예제 #5
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;
	}
예제 #6
0
	bool HasPemFile() const {
		return (CFile::Exists(PemFile()));
	}