mirror of
https://github.com/znc/znc.git
synced 2026-03-28 17:42:41 +01:00
admin: Add TimestampFormat and StatusPrefix
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@2225 726aef4b-f618-498e-8847-2d620e286838
This commit is contained in:
@@ -87,7 +87,9 @@ class CAdminMod : public CModule {
|
||||
{"Admin", boolean},
|
||||
{"AppendTimestamp", boolean},
|
||||
{"PrependTimestamp", boolean},
|
||||
{"DCCBindHost", boolean}
|
||||
{"TimestampFormat", string},
|
||||
{"DCCBindHost", boolean},
|
||||
{"StatusPrefix", string}
|
||||
};
|
||||
for (unsigned int i = 0; i != ARRAY_SIZE(vars); ++i) {
|
||||
VarTable.AddRow();
|
||||
@@ -188,12 +190,16 @@ class CAdminMod : public CModule {
|
||||
PutModule("TimezoneOffset = " + CString(pUser->GetTimezoneOffset()));
|
||||
else if (sVar == "appendtimestamp")
|
||||
PutModule("AppendTimestamp = " + CString(pUser->GetTimestampAppend()));
|
||||
else if (sVar == "preprendtimestamp")
|
||||
PutModule("PreprendTimestamp = " + CString(pUser->GetTimestampPrepend()));
|
||||
else if (sVar == "prependtimestamp")
|
||||
PutModule("PrependTimestamp = " + CString(pUser->GetTimestampPrepend()));
|
||||
else if (sVar == "timestampformat")
|
||||
PutModule("TimestampFormat = " + pUser->GetTimestampFormat());
|
||||
else if (sVar == "dccbindhost")
|
||||
PutModule("DCCBindHost = " + CString(pUser->GetDCCBindHost()));
|
||||
else if (sVar == "admin")
|
||||
PutModule("Admin = " + CString(pUser->IsAdmin()));
|
||||
else if (sVar == "statusprefix")
|
||||
PutModule("StatuxPrefix = " + pUser->GetStatusPrefix());
|
||||
else
|
||||
PutModule("Error: Unknown variable");
|
||||
}
|
||||
@@ -332,6 +338,10 @@ class CAdminMod : public CModule {
|
||||
pUser->SetTimestampAppend(b);
|
||||
PutModule("AppendTimestamp = " + CString(b));
|
||||
}
|
||||
else if (sVar == "timestampformat") {
|
||||
pUser->SetTimestampFormat(sValue);
|
||||
PutModule("TimestampFormat = " + sValue);
|
||||
}
|
||||
else if (sVar == "dccbindhost") {
|
||||
if(!pUser->DenySetBindHost() || m_pUser->IsAdmin()) {
|
||||
pUser->SetDCCBindHost(sValue);
|
||||
@@ -340,6 +350,14 @@ class CAdminMod : public CModule {
|
||||
PutModule("Access denied!");
|
||||
}
|
||||
}
|
||||
else if (sVar == "statusprefix") {
|
||||
if (sVar.find_first_of(" \t\n") == CString::npos) {
|
||||
pUser->SetStatusPrefix(sValue);
|
||||
PutModule("StatusPrefix = " + sValue);
|
||||
} else {
|
||||
PutModule("That would be a bad idea!");
|
||||
}
|
||||
}
|
||||
else
|
||||
PutModule("Error: Unknown variable");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user