Changed locations of some paths

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@383 726aef4b-f618-498e-8847-2d620e286838
This commit is contained in:
prozacx
2005-06-12 09:04:05 +00:00
parent a019a9b439
commit 150d39e534
4 changed files with 22 additions and 16 deletions
+2 -2
View File
@@ -29,6 +29,8 @@ CUser::CUser(const CString& sUserName, CZNC* pZNC) {
m_bKeepBuffer = false;
m_pZNC->GetManager().AddCron(new CKeepNickTimer(this));
m_pZNC->GetManager().AddCron(new CJoinTimer(this));
m_sUserPath = m_pZNC->GetUserPath() + "/" + sUserName;
m_sDLPath = GetUserPath() + "/downloads";
}
CUser::~CUser() {
@@ -520,10 +522,8 @@ bool CUser::ConnectPaused() {
}
const CString& CUser::GetCurPath() const { return m_pZNC->GetCurPath(); }
const CString& CUser::GetDLPath() const { return m_pZNC->GetDLPath(); }
const CString& CUser::GetModPath() const { return m_pZNC->GetModPath(); }
const CString& CUser::GetHomePath() const { return m_pZNC->GetHomePath(); }
const CString& CUser::GetDataPath() const { return m_pZNC->GetDataPath(); }
CString CUser::GetPemLocation() const { return m_pZNC->GetPemLocation(); }
bool CUser::UseClientIP() const { return m_bUseClientIP; }
+8 -2
View File
@@ -9,6 +9,7 @@
#include <vector>
#include <set>
#include "Nick.h"
#include "FileUtils.h"
using std::vector;
using std::set;
@@ -99,10 +100,10 @@ public:
CString FindModPath(const CString& sModule) const;
const CString& GetCurPath() const;
const CString& GetDLPath() const;
const CString& GetModPath() const;
const CString& GetHomePath() const;
const CString& GetDataPath() const;
const CString& GetUserPath() const { if (!CFile::Exists(m_sUserPath)) { CUtils::MakeDir(m_sUserPath); } return m_sUserPath; }
const CString& GetDLPath() const { if (!CFile::Exists(m_sDLPath)) { CUtils::MakeDir(m_sDLPath); } return m_sDLPath; }
CString GetPemLocation() const;
bool UseClientIP() const;
@@ -139,6 +140,11 @@ protected:
CString m_sQuitMsg;
CString m_sVersionReply;
// Paths
CString m_sUserPath;
CString m_sDLPath;
// !Paths
bool m_bPassHashed;
bool m_bUseClientIP;
bool m_bKeepNick;
+7 -7
View File
@@ -245,22 +245,22 @@ void CZNC::InitDirs(const CString& sArgvPath) {
m_sZNCPath = m_sHomePath + "/.znc";
// Other dirs that we use
m_sDLPath = m_sZNCPath + "/downloads";
m_sConfPath = m_sZNCPath + "/configs";
m_sModPath = m_sZNCPath + "/modules";
m_sDataPath = m_sZNCPath + "/data";
m_sUserPath = m_sZNCPath + "/users";
}
CString CZNC::GetConfigPath(const CString& sConfigFile) {
CString CZNC::ExpandConfigPath(const CString& sConfigFile) {
CString sRetPath;
if (sConfigFile.empty()) {
sRetPath = GetZNCPath() + "/znc.conf";
sRetPath = GetConfPath() + "/znc.conf";
} else {
if (sConfigFile.Left(2) == "./" || sConfigFile.Left(3) == "../") {
sRetPath = GetCurPath() + "/" + sConfigFile;
} else if (sConfigFile.Left(1) != "/") {
sRetPath = GetZNCPath() + "/" + sConfigFile;
sRetPath = GetConfPath() + "/" + sConfigFile;
} else {
sRetPath = sConfigFile;
}
@@ -460,7 +460,7 @@ bool CZNC::WriteNewConfig(const CString& sConfig) {
} while (CUtils::GetBoolInput("Would you like to setup another user?", false));
// !User
CString sConfigFile = GetConfigPath(sConfig);
CString sConfigFile = ExpandConfigPath(sConfig);
CUtils::PrintAction("Writing config [" + sConfigFile + "]");
CFile File(sConfigFile);
@@ -490,7 +490,7 @@ bool CZNC::WriteNewConfig(const CString& sConfig) {
bool CZNC::ParseConfig(const CString& sConfig) {
CString sStatusPrefix;
CString sConfigFile = GetConfigPath(sConfig);
CString sConfigFile = ExpandConfigPath(sConfig);
CUtils::PrintAction("Opening Config [" + sConfigFile + "]");
+5 -5
View File
@@ -26,7 +26,7 @@ public:
bool IsHostAllowed(const CString& sHostMask);
void InitDirs(const CString& sArgvPath);
bool OnBoot();
CString GetConfigPath(const CString& sConfigFile);
CString ExpandConfigPath(const CString& sConfigFile);
bool WriteNewConfig(const CString& sConfig);
static CString GetTag(bool bIncludeVersion = true);
CString FindModPath(const CString& sModule) const;
@@ -36,11 +36,11 @@ public:
CGlobalModules& GetModules() { return *m_pModules; }
unsigned short GetListenPort() const { return m_uListenPort; }
const CString& GetCurPath() const { if (!CFile::Exists(m_sCurPath)) { CUtils::MakeDir(m_sCurPath); } return m_sCurPath; }
const CString& GetDLPath() const { if (!CFile::Exists(m_sDLPath)) { CUtils::MakeDir(m_sDLPath); } return m_sDLPath; }
const CString& GetModPath() const { if (!CFile::Exists(m_sModPath)) { CUtils::MakeDir(m_sModPath); } return m_sModPath; }
const CString& GetHomePath() const { if (!CFile::Exists(m_sHomePath)) { CUtils::MakeDir(m_sHomePath); } return m_sHomePath; }
const CString& GetZNCPath() const { if (!CFile::Exists(m_sZNCPath)) { CUtils::MakeDir(m_sZNCPath); } return m_sZNCPath; }
const CString& GetDataPath() const { if (!CFile::Exists(m_sDataPath)) { CUtils::MakeDir(m_sDataPath); } return m_sDataPath; }
const CString& GetConfPath() const { if (!CFile::Exists(m_sConfPath)) { CUtils::MakeDir(m_sConfPath); } return m_sConfPath; }
const CString& GetUserPath() const { if (!CFile::Exists(m_sUserPath)) { CUtils::MakeDir(m_sUserPath); } return m_sUserPath; }
CString GetPemLocation() const { return GetZNCPath() + "/znc.pem"; }
bool IsSSL() const {
@@ -66,11 +66,11 @@ protected:
TSocketManager<Csock> m_Manager;
CString m_sCurPath;
CString m_sDLPath;
CString m_sModPath;
CString m_sHomePath;
CString m_sZNCPath;
CString m_sDataPath;
CString m_sConfPath;
CString m_sUserPath;
CString m_sISpoofFile;
CString m_sOrigISpoof;