Webadmin: Don't reset all channel settings submitting a user page

In r1058 the behaviour of CUser::Clone() was changed. It now also handles the
channel settings. This change breaks webadmin, because it doesn't properly
set up the channels it feeds to CUser::Clone()

This commit 'fixes' this by adding an extra parameter to CUser::Clone() which
makes it revert to the old behaviour. Webadmin uses this parameter.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1074 726aef4b-f618-498e-8847-2d620e286838
This commit is contained in:
psychon
2008-05-26 15:02:09 +00:00
parent 5c39502342
commit 13ddd325f9
3 changed files with 5 additions and 4 deletions
+3 -2
View File
@@ -251,7 +251,7 @@ void CUser::UserDisconnected(CClient* pClient) {
}
}
bool CUser::Clone(const CUser& User, CString& sErrorRet) {
bool CUser::Clone(const CUser& User, CString& sErrorRet, bool bCloneChans) {
unsigned int a = 0;
sErrorRet.clear();
@@ -392,7 +392,8 @@ bool CUser::Clone(const CUser& User, CString& sErrorRet) {
if (!pNewChan) {
pChan->SetInConfig(false);
} else {
pChan->Clone(*pNewChan);
if (bCloneChans)
pChan->Clone(*pNewChan);
}
}
+1 -1
View File
@@ -106,7 +106,7 @@ public:
bool GetFile(const CString& sRemoteNick, const CString& sRemoteIP, unsigned short uRemotePort, const CString& sFileName, unsigned long uFileSize, const CString& sModuleName = "");
bool ResumeFile(const CString& sRemoteNick, unsigned short uPort, unsigned long uFileSize);
CString GetCurNick() const;
bool Clone(const CUser& User, CString& sErrorRet);
bool Clone(const CUser& User, CString& sErrorRet, bool bCloneChans = true);
void BounceAllClients();
void AddBytesRead(unsigned long long u) { m_uBytesRead += u; }
+1 -1
View File
@@ -993,7 +993,7 @@ bool CWebAdminSock::UserPage(CString& sPageRet, CUser* pUser) {
}
} else {
// Edit User Submission
if (!pUser->Clone(*pNewUser, sErr)) {
if (!pUser->Clone(*pNewUser, sErr, false)) {
delete pNewUser;
GetErrorPage(sPageRet, "Invalid Submission [" + sErr + "]");
return true;