mirror of
https://github.com/znc/znc.git
synced 2026-08-06 17:03:14 +02:00
Added global vhosts and getters/setters for ISpoof*
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@453 726aef4b-f618-498e-8847-2d620e286838
This commit is contained in:
@@ -324,6 +324,10 @@ bool CZNC::WriteConfig() {
|
||||
if (!m_sPidFile.empty()) { File.Write("PidFile = " + m_sPidFile + "\r\n"); }
|
||||
if (!m_sStatusPrefix.empty()) { File.Write("StatusPrefix = " + m_sStatusPrefix + "\r\n"); }
|
||||
|
||||
for (unsigned int v = 0; v < m_vsVHosts.size(); v++) {
|
||||
File.Write("VHost = " + m_vsVHosts[v] + "\r\n");
|
||||
}
|
||||
|
||||
#ifdef _MODULES
|
||||
CGlobalModules& Mods = GetModules();
|
||||
|
||||
@@ -975,6 +979,9 @@ bool CZNC::ParseConfig(const CString& sConfig) {
|
||||
} else if (sName.CaseCmp("ISpoofFile") == 0) {
|
||||
m_sISpoofFile = sValue;
|
||||
continue;
|
||||
} else if (sName.CaseCmp("VHost") == 0) {
|
||||
AddVHost(sValue);
|
||||
continue;
|
||||
} else if (sName.CaseCmp("PidFile") == 0) {
|
||||
if (!sValue.empty() && sValue[0] != '/') {
|
||||
m_sPidFile = GetZNCPath() + "/" + sValue;
|
||||
@@ -1008,6 +1015,22 @@ bool CZNC::ParseConfig(const CString& sConfig) {
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CZNC::AddVHost(const CString& sHost) {
|
||||
for (unsigned int a = 0; a < m_vsVHosts.size(); a++) {
|
||||
if (m_vsVHosts[a].CaseCmp(sHost) == 0) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
m_vsVHosts.push_back(sHost);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CZNC::RemVHost(const CString& sHost) {
|
||||
// @todo
|
||||
return true;
|
||||
}
|
||||
|
||||
CString CZNC::FindModPath(const CString& sModule) const {
|
||||
CString sModPath = GetCurPath() + "/modules/" + sModule;
|
||||
sModPath += (sModule.find(".") == CString::npos) ? ".so" : "";
|
||||
|
||||
Reference in New Issue
Block a user