mirror of
https://github.com/znc/znc.git
synced 2026-03-28 17:42:41 +01:00
Fix #624: Can´t rename network via webinterface
This commit is contained in:
@@ -221,6 +221,22 @@ bool CModule::SaveRegistry() const {
|
||||
return (m_mssRegistry.WriteToDisk(GetSavePath() + "/.registry", 0600) == MCString::MCS_SUCCESS);
|
||||
}
|
||||
|
||||
bool CModule::MoveRegistry(const CString& sPath) {
|
||||
if (m_sSavePath != sPath) {
|
||||
CFile fOldNVFile = CFile(m_sSavePath + "/.registry");
|
||||
if (!fOldNVFile.Exists()) {
|
||||
return false;
|
||||
}
|
||||
if (!CFile::Exists(sPath) && !CDir::MakeDir(sPath)) {
|
||||
return false;
|
||||
}
|
||||
fOldNVFile.Copy(sPath + "/.registry");
|
||||
m_sSavePath = sPath;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool CModule::SetNV(const CString & sName, const CString & sValue, bool bWriteToDisk) {
|
||||
m_mssRegistry[sName] = sValue;
|
||||
if (bWriteToDisk) {
|
||||
|
||||
Reference in New Issue
Block a user