diff options
| author | Adam <Adam@anope.org> | 2014-01-02 11:02:14 -0500 |
|---|---|---|
| committer | Adam <Adam@anope.org> | 2014-01-02 11:03:33 -0500 |
| commit | 004c4cbe5f4c37cf455cb6d0caa434fbbb3406ea (patch) | |
| tree | 0e6675dfe28a829f5786b0b2f993566c61662de7 /modules/extra/webcpanel/pages | |
| parent | 072202c181943901c727782e64881adadf13d7dd (diff) | |
Move modules out of extras that dont have external dependencies
Diffstat (limited to 'modules/extra/webcpanel/pages')
36 files changed, 0 insertions, 1740 deletions
diff --git a/modules/extra/webcpanel/pages/chanserv/access.cpp b/modules/extra/webcpanel/pages/chanserv/access.cpp deleted file mode 100644 index d87613ed7..000000000 --- a/modules/extra/webcpanel/pages/chanserv/access.cpp +++ /dev/null @@ -1,162 +0,0 @@ -/* - * (C) 2003-2014 Anope Team - * Contact us at team@anope.org - * - * Please read COPYING and README for further details. - */ - -#include "../../webcpanel.h" -#include "utils.h" - -WebCPanel::ChanServ::Access::Access(const Anope::string &cat, const Anope::string &u) : WebPanelProtectedPage(cat, u) -{ -} - -bool WebCPanel::ChanServ::Access::OnRequest(HTTPProvider *server, const Anope::string &page_name, HTTPClient *client, HTTPMessage &message, HTTPReply &reply, NickAlias *na, TemplateFileServer::Replacements &replacements) -{ - TemplateFileServer Page("chanserv/access.html"); - const Anope::string &chname = message.get_data["channel"]; - - BuildChanList(na, replacements); - - if (chname.empty()) - { - Page.Serve(server, page_name, client, message, reply, replacements); - return true; - } - - ChannelInfo *ci = ChannelInfo::Find(chname); - - if (!ci) - { - replacements["MESSAGES"] = "Channel not registered."; - Page.Serve(server, page_name, client, message, reply, replacements); - return true; - } - - AccessGroup u_access = ci->AccessFor(na->nc); - bool has_priv = na->nc->IsServicesOper() && na->nc->o->ot->HasPriv("chanserv/access/modify"); - - if (!u_access.HasPriv("ACCESS_LIST") && !has_priv) - { - replacements["MESSAGES"] = "Access denied."; - Page.Serve(server, page_name, client, message, reply, replacements); - return true; - } - - replacements["ACCESS_LIST"] = "YES"; - - const ChanAccess *highest = u_access.Highest(); - - if (u_access.HasPriv("ACCESS_CHANGE") || has_priv) - { - if (message.get_data["del"].empty() == false && message.get_data["mask"].empty() == false) - { - std::vector<Anope::string> params; - params.push_back(ci->name); - params.push_back("DEL"); - params.push_back(message.get_data["mask"]); - - WebPanel::RunCommand(na->nc->display, na->nc, "ChanServ", "chanserv/access", params, replacements); - } - else if (message.post_data["mask"].empty() == false && message.post_data["access"].empty() == false && message.post_data["provider"].empty() == false) - { - // Generic access add code here, works with any provider (so we can't call a command exactly) - AccessProvider *a = NULL; - for (std::list<AccessProvider *>::const_iterator it = AccessProvider::GetProviders().begin(); it != AccessProvider::GetProviders().end(); ++it) - if ((*it)->name == message.post_data["provider"]) - a = *it; - - if (a) - { - bool denied = false; - - for (unsigned i = 0, end = ci->GetAccessCount(); i < end; ++i) - { - ChanAccess *acc = ci->GetAccess(i); - - if (acc->mask == message.post_data["mask"]) - { - if ((!highest || *acc >= *highest) && !u_access.founder && !has_priv) - { - replacements["MESSAGES"] = "Access denied"; - denied = true; - } - else - delete acc; - break; - } - } - - - unsigned access_max = Config->GetModule("chanserv")->Get<unsigned>("accessmax", "1024"); - if (access_max && ci->GetAccessCount() >= access_max) - replacements["MESSAGES"] = "Sorry, you can only have " + stringify(access_max) + " access entries on a channel."; - else if (!denied) - { - ChanAccess *new_acc = a->Create(); - new_acc->ci = ci; - new_acc->mask = message.post_data["mask"]; - new_acc->creator = na->nc->display; - try - { - new_acc->AccessUnserialize(message.post_data["access"]); - } - catch (...) - { - replacements["MESSAGES"] = "Invalid access expression for the given type"; - delete new_acc; - new_acc = NULL; - } - if (new_acc) - { - new_acc->last_seen = 0; - new_acc->created = Anope::CurTime; - - if ((!highest || *highest <= *new_acc) && !u_access.founder && !has_priv) - delete new_acc; - else if (new_acc->AccessSerialize().empty()) - { - replacements["MESSAGES"] = "Invalid access expression for the given type"; - delete new_acc; - } - else - { - ci->AddAccess(new_acc); - replacements["MESSAGES"] = "Access for " + new_acc->mask + " set to " + new_acc->AccessSerialize(); - } - } - } - } - } - } - - replacements["ESCAPED_CHANNEL"] = HTTPUtils::URLEncode(chname); - replacements["ACCESS_CHANGE"] = u_access.HasPriv("ACCESS_CHANGE") ? "YES" : "NO"; - - for (unsigned i = 0; i < ci->GetAccessCount(); ++i) - { - ChanAccess *access = ci->GetAccess(i); - - replacements["MASKS"] = HTTPUtils::Escape(access->mask); - replacements["ACCESSES"] = HTTPUtils::Escape(access->AccessSerialize()); - replacements["CREATORS"] = HTTPUtils::Escape(access->creator); - } - - for (std::list<AccessProvider *>::const_iterator it = AccessProvider::GetProviders().begin(); it != AccessProvider::GetProviders().end(); ++it) - { - const AccessProvider *a = *it; - replacements["PROVIDERS"] = a->name; - } - - Page.Serve(server, page_name, client, message, reply, replacements); - return true; -} - -std::set<Anope::string> WebCPanel::ChanServ::Access::GetData() -{ - std::set<Anope::string> v; - v.insert("channel"); - return v; -} - diff --git a/modules/extra/webcpanel/pages/chanserv/access.h b/modules/extra/webcpanel/pages/chanserv/access.h deleted file mode 100644 index 7f81f2d39..000000000 --- a/modules/extra/webcpanel/pages/chanserv/access.h +++ /dev/null @@ -1,27 +0,0 @@ -/* - * (C) 2003-2014 Anope Team - * Contact us at team@anope.org - * - * Please read COPYING and README for further details. - */ - -namespace WebCPanel -{ - -namespace ChanServ -{ - -class Access : public WebPanelProtectedPage -{ - public: - Access(const Anope::string &cat, const Anope::string &u); - - bool OnRequest(HTTPProvider *, const Anope::string &, HTTPClient *, HTTPMessage &, HTTPReply &, NickAlias *, TemplateFileServer::Replacements &) anope_override; - - std::set<Anope::string> GetData() anope_override; -}; - -} - -} - diff --git a/modules/extra/webcpanel/pages/chanserv/akick.cpp b/modules/extra/webcpanel/pages/chanserv/akick.cpp deleted file mode 100644 index bff38910c..000000000 --- a/modules/extra/webcpanel/pages/chanserv/akick.cpp +++ /dev/null @@ -1,94 +0,0 @@ -/* - * (C) 2003-2014 Anope Team - * Contact us at team@anope.org - * - * Please read COPYING and README for further details. - */ - -#include "../../webcpanel.h" -#include "utils.h" - -WebCPanel::ChanServ::Akick::Akick(const Anope::string &cat, const Anope::string &u) : WebPanelProtectedPage(cat, u) -{ -} - -bool WebCPanel::ChanServ::Akick::OnRequest(HTTPProvider *server, const Anope::string &page_name, HTTPClient *client, HTTPMessage &message, HTTPReply &reply, NickAlias *na, TemplateFileServer::Replacements &replacements) -{ - const Anope::string &chname = message.get_data["channel"]; - TemplateFileServer Page("chanserv/akick.html"); - - BuildChanList(na, replacements); - - if (chname.empty()) - { - Page.Serve(server, page_name, client, message, reply, replacements); - return true; - } - - ChannelInfo *ci = ChannelInfo::Find(chname); - - if (!ci) - { - replacements["MESSAGES"] = "Channel not registered"; - Page.Serve(server, page_name, client, message, reply, replacements); - return true; - } - - AccessGroup u_access = ci->AccessFor(na->nc); - bool has_priv = na->nc->IsServicesOper() && na->nc->o->ot->HasPriv("chanserv/access/modify"); - - if (!u_access.HasPriv("AKICK") && !has_priv) - { - replacements["MESSAGES"] = "Permission denied."; - Page.Serve(server, page_name, client, message, reply, replacements); - return true; - } - - replacements["AKICK"] = "YES"; - - if (message.get_data["del"].empty() == false && message.get_data["mask"].empty() == false) - { - std::vector<Anope::string> params; - params.push_back(ci->name); - params.push_back("DEL"); - params.push_back(message.get_data["mask"]); - - WebPanel::RunCommand(na->nc->display, na->nc, "ChanServ", "chanserv/akick", params, replacements); - } - else if (message.post_data["mask"].empty() == false) - { - std::vector<Anope::string> params; - params.push_back(ci->name); - params.push_back("ADD"); - params.push_back(message.post_data["mask"]); - if (message.post_data["reason"].empty() == false) - params.push_back(message.post_data["reason"]); - - WebPanel::RunCommand(na->nc->display, na->nc, "ChanServ", "chanserv/akick", params, replacements); - } - - replacements["ESCAPED_CHANNEL"] = HTTPUtils::URLEncode(chname); - - for (unsigned i = 0; i < ci->GetAkickCount(); ++i) - { - AutoKick *akick = ci->GetAkick(i); - - if (akick->nc) - replacements["MASKS"] = HTTPUtils::Escape(akick->nc->display); - else - replacements["MASKS"] = HTTPUtils::Escape(akick->mask); - replacements["CREATORS"] = HTTPUtils::Escape(akick->creator); - replacements["REASONS"] = HTTPUtils::Escape(akick->reason); - } - - Page.Serve(server, page_name, client, message, reply, replacements); - return true; -} - -std::set<Anope::string> WebCPanel::ChanServ::Akick::GetData() -{ - std::set<Anope::string> v; - v.insert("channel"); - return v; -} - diff --git a/modules/extra/webcpanel/pages/chanserv/akick.h b/modules/extra/webcpanel/pages/chanserv/akick.h deleted file mode 100644 index bd5b18132..000000000 --- a/modules/extra/webcpanel/pages/chanserv/akick.h +++ /dev/null @@ -1,27 +0,0 @@ -/* - * (C) 2003-2014 Anope Team - * Contact us at team@anope.org - * - * Please read COPYING and README for further details. - */ - -namespace WebCPanel -{ - -namespace ChanServ -{ - -class Akick : public WebPanelProtectedPage -{ - public: - Akick(const Anope::string &cat, const Anope::string &u); - - bool OnRequest(HTTPProvider *, const Anope::string &, HTTPClient *, HTTPMessage &, HTTPReply &, NickAlias *, TemplateFileServer::Replacements &) anope_override; - - std::set<Anope::string> GetData() anope_override; -}; - -} - -} - diff --git a/modules/extra/webcpanel/pages/chanserv/drop.cpp b/modules/extra/webcpanel/pages/chanserv/drop.cpp deleted file mode 100644 index 5fa37b5a2..000000000 --- a/modules/extra/webcpanel/pages/chanserv/drop.cpp +++ /dev/null @@ -1,58 +0,0 @@ -/* - * (C) 2003-2014 Anope Team - * Contact us at team@anope.org - * - * Please read COPYING and README for further details. - */ - -#include "../../webcpanel.h" -#include "utils.h" - -WebCPanel::ChanServ::Drop::Drop(const Anope::string &cat, const Anope::string &u) : WebPanelProtectedPage (cat, u) -{ -} - - -bool WebCPanel::ChanServ::Drop::OnRequest(HTTPProvider *server, const Anope::string &page_name, HTTPClient *client, HTTPMessage &message, HTTPReply &reply, NickAlias *na, TemplateFileServer::Replacements &replacements) -{ - - if (message.post_data.count("channel") > 0 && message.post_data.count("confChan") > 0) - { - if (message.post_data["channel"] == message.post_data["confChan"]) - { - std::vector<Anope::string> params; - const Anope::string &channel = HTTPUtils::URLDecode(message.post_data["channel"]); - params.push_back(channel); - params.push_back(channel); - - WebPanel::RunCommand(na->nc->display, na->nc, "ChanServ", "chanserv/drop", params, replacements); - } - else - replacements["MESSAGES"] = "Invalid Confirmation"; - } - - std::deque<ChannelInfo *> queue; - na->nc->GetChannelReferences(queue); - for (unsigned i = 0; i < queue.size(); ++i) - { - ChannelInfo *ci = queue[i]; - if ((ci->HasExt("SECUREFOUNDER") ? ci->AccessFor(na->nc).founder : ci->AccessFor(na->nc).HasPriv("FOUNDER")) || (na->nc->IsServicesOper() && na->nc->o->ot->HasCommand("chanserv/drop"))) - { - replacements["CHANNEL_NAMES"] = ci->name; - replacements["ESCAPED_CHANNEL_NAMES"] = HTTPUtils::URLEncode(ci->name); - } - } - - if (message.get_data.count("channel") > 0) - { - const Anope::string &chname = message.get_data["channel"]; - - replacements["CHANNEL_DROP"] = chname; - replacements["ESCAPED_CHANNEL"] = HTTPUtils::URLEncode(chname); - } - - TemplateFileServer page("chanserv/drop.html"); - page.Serve(server, page_name, client, message, reply, replacements); - return true; - -} diff --git a/modules/extra/webcpanel/pages/chanserv/drop.h b/modules/extra/webcpanel/pages/chanserv/drop.h deleted file mode 100644 index d418ade8f..000000000 --- a/modules/extra/webcpanel/pages/chanserv/drop.h +++ /dev/null @@ -1,25 +0,0 @@ -/* - * (C) 2003-2014 Anope Team - * Contact us at team@anope.org - * - * Please read COPYING and README for further details. - */ - -namespace WebCPanel -{ - - namespace ChanServ - { - - class Drop : public WebPanelProtectedPage - { - public: - Drop(const Anope::string &cat, const Anope::string &u); - - bool OnRequest(HTTPProvider *, const Anope::string &, HTTPClient *, HTTPMessage &, HTTPReply &, NickAlias *, TemplateFileServer::Replacements &) anope_override; - - }; - - } - -} diff --git a/modules/extra/webcpanel/pages/chanserv/info.cpp b/modules/extra/webcpanel/pages/chanserv/info.cpp deleted file mode 100644 index c16c3eaec..000000000 --- a/modules/extra/webcpanel/pages/chanserv/info.cpp +++ /dev/null @@ -1,28 +0,0 @@ -/* - * (C) 2003-2014 Anope Team - * Contact us at team@anope.org - * - * Please read COPYING and README for further details. - */ - -#include "../../webcpanel.h" -#include "utils.h" - -WebCPanel::ChanServ::Info::Info(const Anope::string &cat, const Anope::string &u) : WebPanelProtectedPage(cat, u) -{ -} - -bool WebCPanel::ChanServ::Info::OnRequest(HTTPProvider *server, const Anope::string &page_name, HTTPClient *client, HTTPMessage &message, HTTPReply &reply, NickAlias *na, TemplateFileServer::Replacements &replacements) -{ - const Anope::string &chname = message.get_data["channel"]; - - if (!chname.empty()) - replacements["ESCAPED_CHANNEL"] = HTTPUtils::URLEncode(chname); - - BuildChanList(na, replacements); - - TemplateFileServer page("chanserv/main.html"); - page.Serve(server, page_name, client, message, reply, replacements); - return true; -} - diff --git a/modules/extra/webcpanel/pages/chanserv/info.h b/modules/extra/webcpanel/pages/chanserv/info.h deleted file mode 100644 index 4302264d6..000000000 --- a/modules/extra/webcpanel/pages/chanserv/info.h +++ /dev/null @@ -1,25 +0,0 @@ -/* - * (C) 2003-2014 Anope Team - * Contact us at team@anope.org - * - * Please read COPYING and README for further details. - */ - -namespace WebCPanel -{ - -namespace ChanServ -{ - -class Info : public WebPanelProtectedPage -{ - public: - Info(const Anope::string &cat, const Anope::string &u); - - bool OnRequest(HTTPProvider *, const Anope::string &, HTTPClient *, HTTPMessage &, HTTPReply &, NickAlias *, TemplateFileServer::Replacements &) anope_override; -}; - -} - -} - diff --git a/modules/extra/webcpanel/pages/chanserv/modes.cpp b/modules/extra/webcpanel/pages/chanserv/modes.cpp deleted file mode 100644 index e3e93dd03..000000000 --- a/modules/extra/webcpanel/pages/chanserv/modes.cpp +++ /dev/null @@ -1,108 +0,0 @@ -/* - * (C) 2003-2014 Anope Team - * Contact us at team@anope.org - * - * Please read COPYING and README for further details. - */ - -#include "../../webcpanel.h" -#include "utils.h" - -WebCPanel::ChanServ::Modes::Modes(const Anope::string &cat, const Anope::string &u) : WebPanelProtectedPage(cat, u) -{ -} - -bool WebCPanel::ChanServ::Modes::OnRequest(HTTPProvider *server, const Anope::string &page_name, HTTPClient *client, HTTPMessage &message, HTTPReply &reply, NickAlias *na, TemplateFileServer::Replacements &replacements) -{ - const Anope::string &chname = message.get_data["channel"]; - const Anope::string &mode = message.get_data["m"]; - TemplateFileServer Page("chanserv/modes.html"); - - BuildChanList(na, replacements); - - if (chname.empty()) - { - Page.Serve(server, page_name, client, message, reply, replacements); - return true; - } - - ChannelInfo *ci = ChannelInfo::Find(chname); - - if (!ci) - { - Page.Serve(server, page_name, client, message, reply, replacements); - return true; - } - - Channel *c = Channel::Find(chname); - - if (!c) - { - replacements["MESSAGES"] = Anope::printf(CHAN_X_NOT_IN_USE, chname.c_str()); - Page.Serve(server, page_name, client, message, reply, replacements); - return true; - } - - AccessGroup u_access = ci->AccessFor(na->nc); - bool has_priv = na->nc->IsServicesOper() && na->nc->o->ot->HasPriv("chanserv/administration"); - - if (!u_access.HasPriv("MODE") && !has_priv) - { - replacements["MESSAGES"] = "Access denied."; - Page.Serve(server, page_name, client, message, reply, replacements); - return true; - } - - replacements["MODE"] = "YES"; - - /* build a list with the names of all listmodes */ - for (std::vector<ChannelMode *>::const_iterator it = ModeManager::GetChannelModes().begin(); it != ModeManager::GetChannelModes().end(); ++it) - { - /* "NAMEBASE" is a special mode from InspIRCds m_namedmodes, we dont want this here*/ - if ((*it) && (*it)->type == MODE_LIST && (*it)->name != "NAMEBASE") - replacements["LISTMODES"] = (*it)->mchar; - } - - ChannelMode *cm = ModeManager::FindChannelModeByName(mode); - if (cm) - { - if (message.get_data["del"].empty() == false && message.get_data["mask"].empty() == false) - { - std::vector<Anope::string> params; - params.push_back(ci->name); - params.push_back("SET"); - params.push_back("-" + Anope::string(cm->mchar)); - params.push_back(message.get_data["mask"]); - WebPanel::RunCommand(na->nc->display, na->nc, "ChanServ", "chanserv/mode", params, replacements); - } - else if (message.post_data["mask"].empty() == false) - { - std::vector<Anope::string> params; - params.push_back(ci->name); - params.push_back("SET"); - params.push_back("+" + Anope::string(cm->mchar)); - params.push_back(message.post_data["mask"]); - WebPanel::RunCommand(na->nc->display, na->nc, "ChanServ", "chanserv/mode", params, replacements); - } - - for (Channel::ModeList::const_iterator it = c->GetModes().begin(); it != c->GetModes().end(); ++it) - { - if (it->first == mode) - replacements["MASKS"] = HTTPUtils::Escape(it->second); - } - } - - replacements["ESCAPED_CHANNEL"] = HTTPUtils::URLEncode(chname); - replacements["ESCAPED_MODE"] = HTTPUtils::URLEncode(mode); - - Page.Serve(server, page_name, client, message, reply, replacements); - return true; -} - -std::set<Anope::string> WebCPanel::ChanServ::Modes::GetData() -{ - std::set<Anope::string> v; - v.insert("channel"); - return v; -} - diff --git a/modules/extra/webcpanel/pages/chanserv/modes.h b/modules/extra/webcpanel/pages/chanserv/modes.h deleted file mode 100644 index 36f5a1d27..000000000 --- a/modules/extra/webcpanel/pages/chanserv/modes.h +++ /dev/null @@ -1,27 +0,0 @@ -/* - * (C) 2003-2014 Anope Team - * Contact us at team@anope.org - * - * Please read COPYING and README for further details. - */ - -namespace WebCPanel -{ - -namespace ChanServ -{ - -class Modes : public WebPanelProtectedPage -{ - public: - Modes(const Anope::string &cat, const Anope::string &u); - - bool OnRequest(HTTPProvider *, const Anope::string &, HTTPClient *, HTTPMessage &, HTTPReply &, NickAlias *, TemplateFileServer::Replacements &) anope_override; - - std::set<Anope::string> GetData() anope_override; -}; - -} - -} - diff --git a/modules/extra/webcpanel/pages/chanserv/set.cpp b/modules/extra/webcpanel/pages/chanserv/set.cpp deleted file mode 100644 index f763ba13b..000000000 --- a/modules/extra/webcpanel/pages/chanserv/set.cpp +++ /dev/null @@ -1,155 +0,0 @@ -/* - * (C) 2003-2014 Anope Team - * Contact us at team@anope.org - * - * Please read COPYING and README for further details. - */ - -#include "../../webcpanel.h" -#include "utils.h" - -WebCPanel::ChanServ::Set::Set(const Anope::string &cat, const Anope::string &u) : WebPanelProtectedPage(cat, u) -{ -} - -bool WebCPanel::ChanServ::Set::OnRequest(HTTPProvider *server, const Anope::string &page_name, HTTPClient *client, HTTPMessage &message, HTTPReply &reply, NickAlias *na, TemplateFileServer::Replacements &replacements) -{ - const Anope::string &chname = message.get_data["channel"]; - bool can_set = false; - TemplateFileServer page("chanserv/set.html"); - - BuildChanList(na, replacements); - - if (chname.empty()) - { - page.Serve(server, page_name, client, message, reply, replacements); - return true; - } - - ChannelInfo *ci = ChannelInfo::Find(chname); - - if (!ci) - { - page.Serve(server, page_name, client, message, reply, replacements); - return true; - } - - replacements["OKAY"]; - - if (ci->AccessFor(na->nc).HasPriv("SET")) - { - replacements["CAN_SET"]; - can_set = true; - } - - if (can_set && message.post_data.empty() == false) - { - if (ci->HasExt("KEEPTOPIC") != message.post_data.count("keeptopic")) - { - if (!ci->HasExt("KEEPTOPIC")) - ci->Extend<bool>("KEEPTOPIC"); - else - ci->Shrink<bool>("KEEPTOPIC"); - replacements["MESSAGES"] = "Secure updated"; - } - if (ci->HasExt("PEACE") != message.post_data.count("peace")) - { - if (!ci->HasExt("PEACE")) - ci->Extend<bool>("PEACE"); - else - ci->Shrink<bool>("PEACE"); - replacements["MESSAGES"] = "Peace updated"; - } - if (ci->HasExt("CS_PRIVATE") != message.post_data.count("private")) - { - if (!ci->HasExt("CS_PRIVATE")) - ci->Extend<bool>("CS_PRIVATE"); - else - ci->Shrink<bool>("CS_PRIVATE"); - replacements["MESSAGES"] = "Private updated"; - } - if (ci->HasExt("RESTRICTED") != message.post_data.count("restricted")) - { - if (!ci->HasExt("RESTRICTED")) - ci->Extend<bool>("RESTRICTED"); - else - ci->Shrink<bool>("RESTRICTED"); - replacements["MESSAGES"] = "Restricted updated"; - } - if (ci->HasExt("CS_SECURE") != message.post_data.count("secure")) - { - if (!ci->HasExt("CS_SECURE")) - ci->Extend<bool>("CS_SECURE"); - else - ci->Shrink<bool>("CS_SECURE"); - replacements["MESSAGES"] = "Secure updated"; - } - if (ci->HasExt("SECUREOPS") != message.post_data.count("secureops")) - { - if (!ci->HasExt("SECUREOPS")) - ci->Extend<bool>("SECUREOPS"); - else - ci->Shrink<bool>("SECUREOPS"); - replacements["MESSAGES"] = "Secureops updated"; - } - if (ci->HasExt("TOPICLOCK") != message.post_data.count("topiclock")) - { - if (!ci->HasExt("TOPICLOCK")) - ci->Extend<bool>("TOPICLOCK"); - else - ci->Shrink<bool>("TOPICLOCK"); - replacements["MESSAGES"] = "Topiclock updated"; - } - } - - replacements["CHANNEL"] = HTTPUtils::Escape(ci->name); - replacements["CHANNEL_ESCAPED"] = HTTPUtils::URLEncode(ci->name); - if (ci->GetFounder()) - replacements["FOUNDER"] = ci->GetFounder()->display; - if (ci->GetSuccessor()) - replacements["SUCCESSOR"] = ci->GetSuccessor()->display; - replacements["TIME_REGISTERED"] = Anope::strftime(ci->time_registered, na->nc); - replacements["LAST_USED"] = Anope::strftime(ci->last_used, na->nc); - replacements["ESCAPED_CHANNEL"] = HTTPUtils::URLEncode(chname); - - if (!ci->last_topic.empty()) - { - replacements["LAST_TOPIC"] = HTTPUtils::Escape(ci->last_topic); - replacements["LAST_TOPIC_SETTER"] = HTTPUtils::Escape(ci->last_topic_setter); - } - - if (can_set) - { - if (ci->HasExt("KEEPTOPIC")) - replacements["KEEPTOPIC"]; - - if (ci->HasExt("PEACE")) - replacements["PEACE"]; - - if (ci->HasExt("CS_PRIVATE")) - replacements["PRIVATE"]; - - if (ci->HasExt("RESTRICTED")) |
