From: <cf...@us...> - 2010-02-07 18:21:54
|
Revision: 1747 http://znc.svn.sourceforge.net/znc/?rev=1747&view=rev Author: cflakes Date: 2010-02-07 18:21:48 +0000 (Sun, 07 Feb 2010) Log Message: ----------- AppendTimestamp, PreprendTimestamp, DCCVHost and DenySetVHost (also affects DCCVHost) are now also changable via the admin module. Basic patch by psychon! Modified Paths: -------------- trunk/modules/admin.cpp Modified: trunk/modules/admin.cpp =================================================================== --- trunk/modules/admin.cpp 2010-02-07 18:02:32 UTC (rev 1746) +++ trunk/modules/admin.cpp 2010-02-07 18:21:48 UTC (rev 1747) @@ -71,6 +71,7 @@ {"BounceDCCs", boolean}, {"UseClientIP", boolean}, {"DenyLoadMod", boolean}, + {"DenySetVHost", boolean}, {"DefaultChanModes", string}, {"QuitMsg", string}, {"BufferCount", integer}, @@ -78,7 +79,10 @@ {"Password", string}, {"JoinTries", integer}, {"MaxJoins", integer}, - {"Admin", boolean} + {"Admin", boolean}, + {"AppendTimestamp", boolean}, + {"PrependTimestamp", boolean}, + {"DCCVHost", boolean} }; for (unsigned int i = 0; i != ARRAY_SIZE(vars); ++i) { VarTable.AddRow(); @@ -93,10 +97,11 @@ CVarTable.AddColumn("Type"); static const char* cvars[][2] = { {"DefModes", string}, + {"Key", string}, {"Buffer", integer}, {"InConfig", boolean}, {"KeepBuffer", boolean}, - {"Detached", boolean}, + {"Detached", boolean} }; for (unsigned int i = 0; i != ARRAY_SIZE(cvars); ++i) { CVarTable.AddRow(); @@ -157,6 +162,8 @@ PutModule("UseClientIP = " + CString(user->UseClientIP())); else if (var == "denyloadmod") PutModule("DenyLoadMod = " + CString(user->DenyLoadMod())); + else if (var == "denysetvhost") + PutModule("DenySetVHost = " + CString(user->DenySetVHost())); else if (var == "defaultchanmodes") PutModule("DefaultChanModes = " + user->GetDefaultChanModes()); else if (var == "quitmsg") @@ -169,6 +176,12 @@ PutModule("MaxJoins = " + CString(user->MaxJoins())); else if (var == "jointries") PutModule("JoinTries = " + CString(user->JoinTries())); + else if (var == "appendtimestamp") + PutModule("AppendTimestamp = " + CString(user->GetTimestampAppend())); + else if (var == "preprendtimestamp") + PutModule("PreprendTimestamp = " + CString(user->GetTimestampPrepend())); + else if (var == "dccvhost") + PutModule("DCCVHost = " + CString(user->GetDCCVHost())); else if (var == "admin") PutModule("Admin = " + CString(user->IsAdmin())); else @@ -237,6 +250,15 @@ PutModule("Access denied!"); } } + else if (var == "denysetvhost") { + if(m_pUser->IsAdmin()) { + bool b = value.ToBool(); + user->SetDenySetVHost(b); + PutModule("DenySetVHost = " + CString(b)); + } else { + PutModule("Access denied!"); + } + } else if (var == "defaultchanmodes") { user->SetDefaultChanModes(value); PutModule("DefaultChanModes = " + value); @@ -280,6 +302,24 @@ PutModule("Access denied!"); } } + else if (var == "prependtimestamp") { + bool b = value.ToBool(); + user->SetTimestampPrepend(b); + PutModule("PrependTimestamp = " + CString(b)); + } + else if (var == "appendtimestamp") { + bool b = value.ToBool(); + user->SetTimestampAppend(b); + PutModule("AppendTimestamp = " + CString(b)); + } + else if (var == "dccvhost") { + if(!user->DenySetVHost() || m_pUser->IsAdmin()) { + user->SetDCCVHost(value); + PutModule("DCCVHost = " + value); + } else { + PutModule("Access denied!"); + } + } else PutModule("Error: Unknown variable"); } @@ -321,6 +361,8 @@ PutModule("KeepBuffer = " + pChan->KeepBuffer()); else if (var == "detached") PutModule("Detached = " + pChan->IsDetached()); + else if (var == "key") + PutModule("Key = " + pChan->GetKey()); else PutModule("Error: Unknown variable"); } @@ -370,6 +412,9 @@ pChan->AttachUser(); } PutModule("Detached = " + CString(b)); + } else if (var == "key") { + pChan->SetKey(value); + PutModule("Key = " + value); } else PutModule("Error: Unknown variable"); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |