Added FindModPath()

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@318 726aef4b-f618-498e-8847-2d620e286838
This commit is contained in:
prozacx
2005-05-16 05:38:47 +00:00
parent 668de5ac8c
commit af02c09235
2 changed files with 22 additions and 0 deletions
+21
View File
@@ -473,6 +473,27 @@ const CString& CUser::GetRealName() const { return m_sRealName; }
const CString& CUser::GetVHost() const { return m_sVHost; }
const CString& CUser::GetPass() const { return m_sPass; }
CString CUser::FindModPath(const CString& sModule) const {
CString sModPath = GetCurPath() + "/modules/" + sModule + ".so";
if (!CFile::Exists(sModPath)) {
DEBUG_ONLY(cout << "[" << sModPath << "] Not found..." << endl);
sModPath = GetModPath() + "/" + sModule + ".so";
if (!CFile::Exists(sModPath)) {
DEBUG_ONLY(cout << "[" << sModPath << "] Not found..." << endl);
sModPath = _MODDIR_ + CString("/") + sModule + ".so";
if (!CFile::Exists(sModPath)) {
DEBUG_ONLY(cout << "[" << sModPath << "] Not found... giving up!" << endl);
return "";
}
}
}
return sModPath;
}
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(); }