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
This commit is contained in:
cflakes
2010-04-12 15:31:42 +00:00
parent e77adef048
commit 7748713afd

View File

@@ -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();