mirror of
https://github.com/znc/znc.git
synced 2026-07-05 01:11:53 +02: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:
+21
-3
@@ -87,7 +87,9 @@ class CAdminMod : public CModule {
|
|||||||
{"Admin", boolean},
|
{"Admin", boolean},
|
||||||
{"AppendTimestamp", boolean},
|
{"AppendTimestamp", boolean},
|
||||||
{"PrependTimestamp", boolean},
|
{"PrependTimestamp", boolean},
|
||||||
{"DCCBindHost", boolean}
|
{"TimestampFormat", string},
|
||||||
|
{"DCCBindHost", boolean},
|
||||||
|
{"StatusPrefix", string}
|
||||||
};
|
};
|
||||||
for (unsigned int i = 0; i != ARRAY_SIZE(vars); ++i) {
|
for (unsigned int i = 0; i != ARRAY_SIZE(vars); ++i) {
|
||||||
VarTable.AddRow();
|
VarTable.AddRow();
|
||||||
@@ -188,12 +190,16 @@ class CAdminMod : public CModule {
|
|||||||
PutModule("TimezoneOffset = " + CString(pUser->GetTimezoneOffset()));
|
PutModule("TimezoneOffset = " + CString(pUser->GetTimezoneOffset()));
|
||||||
else if (sVar == "appendtimestamp")
|
else if (sVar == "appendtimestamp")
|
||||||
PutModule("AppendTimestamp = " + CString(pUser->GetTimestampAppend()));
|
PutModule("AppendTimestamp = " + CString(pUser->GetTimestampAppend()));
|
||||||
else if (sVar == "preprendtimestamp")
|
else if (sVar == "prependtimestamp")
|
||||||
PutModule("PreprendTimestamp = " + CString(pUser->GetTimestampPrepend()));
|
PutModule("PrependTimestamp = " + CString(pUser->GetTimestampPrepend()));
|
||||||
|
else if (sVar == "timestampformat")
|
||||||
|
PutModule("TimestampFormat = " + pUser->GetTimestampFormat());
|
||||||
else if (sVar == "dccbindhost")
|
else if (sVar == "dccbindhost")
|
||||||
PutModule("DCCBindHost = " + CString(pUser->GetDCCBindHost()));
|
PutModule("DCCBindHost = " + CString(pUser->GetDCCBindHost()));
|
||||||
else if (sVar == "admin")
|
else if (sVar == "admin")
|
||||||
PutModule("Admin = " + CString(pUser->IsAdmin()));
|
PutModule("Admin = " + CString(pUser->IsAdmin()));
|
||||||
|
else if (sVar == "statusprefix")
|
||||||
|
PutModule("StatuxPrefix = " + pUser->GetStatusPrefix());
|
||||||
else
|
else
|
||||||
PutModule("Error: Unknown variable");
|
PutModule("Error: Unknown variable");
|
||||||
}
|
}
|
||||||
@@ -332,6 +338,10 @@ class CAdminMod : public CModule {
|
|||||||
pUser->SetTimestampAppend(b);
|
pUser->SetTimestampAppend(b);
|
||||||
PutModule("AppendTimestamp = " + CString(b));
|
PutModule("AppendTimestamp = " + CString(b));
|
||||||
}
|
}
|
||||||
|
else if (sVar == "timestampformat") {
|
||||||
|
pUser->SetTimestampFormat(sValue);
|
||||||
|
PutModule("TimestampFormat = " + sValue);
|
||||||
|
}
|
||||||
else if (sVar == "dccbindhost") {
|
else if (sVar == "dccbindhost") {
|
||||||
if(!pUser->DenySetBindHost() || m_pUser->IsAdmin()) {
|
if(!pUser->DenySetBindHost() || m_pUser->IsAdmin()) {
|
||||||
pUser->SetDCCBindHost(sValue);
|
pUser->SetDCCBindHost(sValue);
|
||||||
@@ -340,6 +350,14 @@ class CAdminMod : public CModule {
|
|||||||
PutModule("Access denied!");
|
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
|
else
|
||||||
PutModule("Error: Unknown variable");
|
PutModule("Error: Unknown variable");
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user