From 7748713afdff8d24b4e2f85dbbce467112c0b760 Mon Sep 17 00:00:00 2001 From: cflakes Date: Mon, 12 Apr 2010 15:31:42 +0000 Subject: [PATCH] Added ability to change the TimezoneOffset setting from the admin module. Patch by BrianC, thanks! git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1906 726aef4b-f618-498e-8847-2d620e286838 --- modules/admin.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/modules/admin.cpp b/modules/admin.cpp index d7f745c2..cb09a213 100644 --- a/modules/admin.cpp +++ b/modules/admin.cpp @@ -64,6 +64,7 @@ class CAdminMod : public CModule { static const char* string = "String"; static const char* boolean = "Boolean (true/false)"; static const char* integer = "Integer"; + static const char* doublenum = "Double"; static const char* vars[][2] = { {"Nick", string}, {"Altnick", string}, @@ -82,6 +83,7 @@ class CAdminMod : public CModule { {"Password", string}, {"JoinTries", integer}, {"MaxJoins", integer}, + {"TimezoneOffset", doublenum}, {"Admin", boolean}, {"AppendTimestamp", boolean}, {"PrependTimestamp", boolean}, @@ -182,6 +184,8 @@ class CAdminMod : public CModule { PutModule("MaxJoins = " + CString(pUser->MaxJoins())); else if (sVar == "jointries") PutModule("JoinTries = " + CString(pUser->JoinTries())); + else if (sVar == "timezoneoffset") + PutModule("TimezoneOffset = " + CString(pUser->GetTimezoneOffset())); else if (sVar == "appendtimestamp") PutModule("AppendTimestamp = " + CString(pUser->GetTimestampAppend())); else if (sVar == "preprendtimestamp") @@ -299,6 +303,11 @@ class CAdminMod : public CModule { pUser->SetJoinTries(i); PutModule("JoinTries = " + CString(pUser->JoinTries())); } + else if (sVar == "timezoneoffset") { + double d = sValue.ToDouble(); + pUser->SetTimezoneOffset(d); + PutModule("TimezoneOffset = " + CString(pUser->GetTimezoneOffset())); + } else if (sVar == "admin") { if(m_pUser->IsAdmin() && pUser != m_pUser) { bool b = sValue.ToBool();