1
0
mirror of https://github.com/anope/anope.git synced 2026-07-10 18:23:13 +02:00

Merge pull request #161 from Zoddo/charybdis/vhost_svslogin

Send vident/vhost in SVSLOGIN with SASL
This commit is contained in:
Adam
2016-04-14 19:17:39 -05:00
7 changed files with 9 additions and 8 deletions
+1 -1
View File
@@ -229,7 +229,7 @@ class CoreExport IRCDProto : public Service
virtual void SendSASLMechanisms(std::vector<Anope::string> &) { }
virtual void SendSASLMessage(const SASL::Message &) { }
virtual void SendSVSLogin(const Anope::string &uid, const Anope::string &acc) { }
virtual void SendSVSLogin(const Anope::string &uid, const Anope::string &acc, const Anope::string &vident, const Anope::string &vhost) { }
virtual bool IsNickValid(const Anope::string &);
virtual bool IsChannelValid(const Anope::string &);
+2 -1
View File
@@ -226,13 +226,14 @@ class SASLService : public SASL::Service, public Timer
// If the user is already introduced then we log them in now.
// Otherwise, we send an SVSLOGIN to log them in later.
User *user = User::Find(session->uid);
const NickAlias *na = NickAlias::Find(nc->display);
if (user)
{
user->Login(nc);
}
else
{
IRCD->SendSVSLogin(session->uid, nc->display);
IRCD->SendSVSLogin(session->uid, nc->display, na->GetVhostIdent(), na->GetVhostHost());
}
this->SendMessage(session, "D", "S");
}
+2 -2
View File
@@ -159,10 +159,10 @@ class CharybdisProto : public IRCDProto
UplinkSocket::Message(Me) << "ENCAP " << (s ? s->GetName() : message.target.substr(0, 3)) << " SASL " << message.source << " " << message.target << " " << message.type << " " << message.data << (message.ext.empty() ? "" : (" " + message.ext));
}
void SendSVSLogin(const Anope::string &uid, const Anope::string &acc) anope_override
void SendSVSLogin(const Anope::string &uid, const Anope::string &acc, const Anope::string &vident, const Anope::string &vhost) anope_override
{
Server *s = Server::Find(uid.substr(0, 3));
UplinkSocket::Message(Me) << "ENCAP " << (s ? s->GetName() : uid.substr(0, 3)) << " SVSLOGIN " << uid << " * * * " << acc;
UplinkSocket::Message(Me) << "ENCAP " << (s ? s->GetName() : uid.substr(0, 3)) << " SVSLOGIN " << uid << " * " << (!vident.empty() ? vident : '*') << " " << (!vhost.empty() ? vhost : '*') << " " << acc;
}
};
+1 -1
View File
@@ -406,7 +406,7 @@ class InspIRCd12Proto : public IRCDProto
UplinkSocket::Message(Me) << "ENCAP " << message.target.substr(0, 3) << " SASL " << message.source << " " << message.target << " " << message.type << " " << message.data << (message.ext.empty() ? "" : (" " + message.ext));
}
void SendSVSLogin(const Anope::string &uid, const Anope::string &acc) anope_override
void SendSVSLogin(const Anope::string &uid, const Anope::string &acc, const Anope::string &vident, const Anope::string &vhost) anope_override
{
UplinkSocket::Message(Me) << "METADATA " << uid << " accountname :" << acc;
+1 -1
View File
@@ -81,7 +81,7 @@ class InspIRCd20Proto : public IRCDProto
void SendLogout(User *u) anope_override { insp12->SendLogout(u); }
void SendChannel(Channel *c) anope_override { insp12->SendChannel(c); }
void SendSASLMessage(const SASL::Message &message) anope_override { insp12->SendSASLMessage(message); }
void SendSVSLogin(const Anope::string &uid, const Anope::string &acc) anope_override { insp12->SendSVSLogin(uid, acc); }
void SendSVSLogin(const Anope::string &uid, const Anope::string &acc, const Anope::string &vident, const Anope::string &vhost) anope_override { insp12->SendSVSLogin(uid, acc, vident, vhost); }
bool IsExtbanValid(const Anope::string &mask) anope_override { return insp12->IsExtbanValid(mask); }
bool IsIdentValid(const Anope::string &ident) anope_override { return insp12->IsIdentValid(ident); }
};
+1 -1
View File
@@ -386,7 +386,7 @@ class UnrealIRCdProto : public IRCDProto
UplinkSocket::Message(BotInfo::Find(message.source)) << "SASL " << message.target.substr(0, p) << " " << message.target << " " << message.type << " " << message.data << (message.ext.empty() ? "" : " " + message.ext);
}
void SendSVSLogin(const Anope::string &uid, const Anope::string &acc) anope_override
void SendSVSLogin(const Anope::string &uid, const Anope::string &acc, const Anope::string &vident, const Anope::string &vhost) anope_override
{
size_t p = uid.find('!');
if (p == Anope::string::npos)
+1 -1
View File
@@ -374,7 +374,7 @@ class UnrealIRCdProto : public IRCDProto
UplinkSocket::Message(BotInfo::Find(message.source)) << "SASL " << message.target.substr(0, p) << " " << message.target << " " << message.type << " " << message.data << (message.ext.empty() ? "" : " " + message.ext);
}
void SendSVSLogin(const Anope::string &uid, const Anope::string &acc) anope_override
void SendSVSLogin(const Anope::string &uid, const Anope::string &acc, const Anope::string &vident, const Anope::string &vhost) anope_override
{
size_t p = uid.find('!');
if (p == Anope::string::npos)