mirror of
https://github.com/znc/znc.git
synced 2026-03-28 17:42:41 +01:00
Added MOTD support
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@571 726aef4b-f618-498e-8847-2d620e286838
This commit is contained in:
@@ -402,13 +402,18 @@ bool CWebAdminSock::SettingsPage(CString& sPageRet) {
|
||||
if (!GetParam("submitted").ToUInt()) {
|
||||
sPageRet = Header("Settings");
|
||||
|
||||
CString sVHosts;
|
||||
CString sVHosts, sMotd;
|
||||
|
||||
const VCString& vsVHosts = CZNC::Get().GetVHosts();
|
||||
for (unsigned int a = 0; a < vsVHosts.size(); a++) {
|
||||
sVHosts += vsVHosts[a] + "\r\n";
|
||||
}
|
||||
|
||||
const VCString& vsMotd = CZNC::Get().GetMotd();
|
||||
for (unsigned int b = 0; b < vsMotd.size(); b++) {
|
||||
sMotd += vsMotd[b] + "\r\n";
|
||||
}
|
||||
|
||||
sPageRet += "<br><form action='/settings' method='POST'>\r\n"
|
||||
"<input type='hidden' name='submitted' value='1'>\r\n"
|
||||
"<div style='white-space: nowrap; margin-top: -8px; margin-right: 8px; margin-left: 8px; padding: 1px 5px 1px 5px; float: left; border: 1px solid #000; font-size: 16px; font-weight: bold; background: #ff9;'>Global Settings</div><div style='padding: 25px 5px 5px 15px; border: 2px solid #000; background: #cc9;'><div style='clear: both;'>\r\n"
|
||||
@@ -421,6 +426,9 @@ bool CWebAdminSock::SettingsPage(CString& sPageRet) {
|
||||
"<div><small><b>ISpoofFormat:</b></small><br>\r\n"
|
||||
"<input type='text' name='ispoofformat' value='" + CZNC::Get().GetISpoofFormat().Escape_n(CString::EHTML) + "' size='32' maxlength='128'></div>\r\n"
|
||||
|
||||
"<br><div><small><b>MOTD:</b></small><br>\r\n"
|
||||
"<textarea name='motd' cols='80' rows='5'>" + sMotd.Escape_n(CString::EHTML) + "</textarea></div>\r\n"
|
||||
|
||||
"<br><div><small><b>VHosts:</b></small><br>\r\n"
|
||||
"<textarea name='vhosts' cols='40' rows='5'>" + sVHosts.Escape_n(CString::EHTML) + "</textarea></div>\r\n"
|
||||
|
||||
@@ -443,7 +451,6 @@ bool CWebAdminSock::SettingsPage(CString& sPageRet) {
|
||||
}
|
||||
|
||||
sPageRet += "</table><br></div></div><br><br>\r\n"
|
||||
"<br></div></div><br><br>\r\n"
|
||||
"<input type='submit' value='Submit'>\r\n"
|
||||
"</form>\r\n";
|
||||
|
||||
@@ -457,10 +464,17 @@ bool CWebAdminSock::SettingsPage(CString& sPageRet) {
|
||||
sArg = GetParam("ispoofformat"); CZNC::Get().SetISpoofFormat(sArg);
|
||||
//sArg = GetParam(""); if (!sArg.empty()) { CZNC::Get().Set(sArg); }
|
||||
|
||||
VCString vsArgs = GetParam("vhosts").Split("\n");
|
||||
CZNC::Get().ClearVHosts();
|
||||
VCString vsArgs = GetParam("motd").Split("\n");
|
||||
CZNC::Get().ClearMotd();
|
||||
|
||||
unsigned int a = 0;
|
||||
for (a = 0; a < vsArgs.size(); a++) {
|
||||
CZNC::Get().AddMotd(vsArgs[a].TrimRight_n());
|
||||
}
|
||||
|
||||
vsArgs = GetParam("vhosts").Split("\n");
|
||||
CZNC::Get().ClearVHosts();
|
||||
|
||||
for (a = 0; a < vsArgs.size(); a++) {
|
||||
CZNC::Get().AddVHost(vsArgs[a].Trim_n());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user