mirror of
https://github.com/znc/znc.git
synced 2026-05-02 11:32:29 +02:00
Parse network and client from authzid. Tests will be in future commit
This commit is contained in:
@@ -387,8 +387,14 @@ class CClientSASLAuth : public CClientAuth {
|
||||
void RefusedLogin(const CString& sReason) override;
|
||||
};
|
||||
|
||||
void CClient::StartSASLPasswordCheck(const CString& sUser, const CString& sPassword) {
|
||||
m_spAuth = std::make_shared<CClientSASLAuth>(this, sUser, sPassword);
|
||||
void CClient::StartSASLPasswordCheck(const CString& sUser,
|
||||
const CString& sPassword, const CString& sAuthorizationId) {
|
||||
ParseUser(sAuthorizationId);
|
||||
if (sUser != m_sUser && sUser != sAuthorizationId) {
|
||||
RefuseSASLLogin("No support for custom AuthzId");
|
||||
}
|
||||
|
||||
m_spAuth = std::make_shared<CClientSASLAuth>(this, m_sUser, sPassword);
|
||||
|
||||
CZNC::Get().AuthUser(m_spAuth);
|
||||
}
|
||||
@@ -973,7 +979,7 @@ void CClient::ParsePass(const CString& sAuthLine) {
|
||||
}
|
||||
}
|
||||
|
||||
void CClient::ParseUser(const CString& sAuthLine) {
|
||||
CString CClient::ParseUser(const CString& sAuthLine) {
|
||||
// user[@identifier][/network]
|
||||
|
||||
const size_t uSlash = sAuthLine.rfind("/");
|
||||
@@ -984,6 +990,8 @@ void CClient::ParseUser(const CString& sAuthLine) {
|
||||
} else {
|
||||
ParseIdentifier(sAuthLine);
|
||||
}
|
||||
|
||||
return m_sUser;
|
||||
}
|
||||
|
||||
void CClient::ParseIdentifier(const CString& sAuthLine) {
|
||||
|
||||
Reference in New Issue
Block a user