summaryrefslogtreecommitdiff
path: root/modules/webcpanel
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2016-10-09 12:00:15 -0400
committerAdam <Adam@anope.org>2016-10-09 12:00:15 -0400
commit5fd2d0ee3e136e01926f21edc759a4ab9fd48806 (patch)
tree6666be3d14db12fe66a3576e889423f64e5229cc /modules/webcpanel
parentcffbf4e8fd93ae28f1c6d6fde221e72d70015942 (diff)
Split vhosts into its own structure
Diffstat (limited to 'modules/webcpanel')
-rw-r--r--modules/webcpanel/pages/hostserv/request.cpp9
-rw-r--r--modules/webcpanel/pages/nickserv/info.cpp11
2 files changed, 12 insertions, 8 deletions
diff --git a/modules/webcpanel/pages/hostserv/request.cpp b/modules/webcpanel/pages/hostserv/request.cpp
index 0230ba8fa..dc782361c 100644
--- a/modules/webcpanel/pages/hostserv/request.cpp
+++ b/modules/webcpanel/pages/hostserv/request.cpp
@@ -33,12 +33,13 @@ bool WebCPanel::HostServ::Request::OnRequest(HTTPProvider *server, const Anope::
WebPanel::RunCommand(na->GetAccount()->GetDisplay(), na->GetAccount(), "HostServ", "hostserv/request", params, replacements, "CMDR");
}
- if (na->HasVhost())
+ ::HostServ::VHost *vhost = na->GetVHost();
+ if (vhost != nullptr)
{
- if (na->GetVhostIdent().empty() == false)
- replacements["VHOST"] = na->GetVhostIdent() + "@" + na->GetVhostHost();
+ if (vhost->GetIdent().empty() == false)
+ replacements["VHOST"] = vhost->GetIdent() + "@" + vhost->GetHost();
else
- replacements["VHOST"] = na->GetVhostHost();
+ replacements["VHOST"] = vhost->GetHost();
}
if (ServiceReference<Command>("hostserv/request"))
replacements["CAN_REQUEST"] = "YES";
diff --git a/modules/webcpanel/pages/nickserv/info.cpp b/modules/webcpanel/pages/nickserv/info.cpp
index f3c353044..7b0f5d64f 100644
--- a/modules/webcpanel/pages/nickserv/info.cpp
+++ b/modules/webcpanel/pages/nickserv/info.cpp
@@ -100,13 +100,16 @@ bool WebCPanel::NickServ::Info::OnRequest(HTTPProvider *server, const Anope::str
if (na->GetAccount()->GetEmail().empty() == false)
replacements["EMAIL"] = HTTPUtils::Escape(na->GetAccount()->GetEmail());
replacements["TIME_REGISTERED"] = Anope::strftime(na->GetTimeRegistered(), na->GetAccount());
- if (na->HasVhost())
+
+ ::HostServ::VHost *vhost = na->GetVHost();
+ if (vhost != nullptr)
{
- if (na->GetVhostIdent().empty() == false)
- replacements["VHOST"] = na->GetVhostIdent() + "@" + na->GetVhostHost();
+ if (vhost->GetIdent().empty() == false)
+ replacements["VHOST"] = vhost->GetIdent() + "@" + vhost->GetHost();
else
- replacements["VHOST"] = na->GetVhostHost();
+ replacements["VHOST"] = vhost->GetHost();
}
+
Anope::string *greet = na->GetAccount()->GetExt<Anope::string>("greet");
if (greet)
replacements["GREET"] = HTTPUtils::Escape(*greet);