diff options
author | Adam <Adam@anope.org> | 2014-11-24 14:27:23 -0500 |
---|---|---|
committer | Adam <Adam@anope.org> | 2014-11-24 14:27:23 -0500 |
commit | 42238034490fb5479d787bd1695750387d508200 (patch) | |
tree | c93c62e0e1c936e656ae5b9ee1b62380ce2a194c /modules/extra/m_ldap_authentication.cpp | |
parent | d492923610d9c9146b2a2b63de38deab2cfd4ca7 (diff) |
Rewrite serializable to have field level granularity
Represent serializable objects in a digraph, and as a result made most
object relationships implicitly defined, and use the graph to trace
references between objects to determine relationships. Edges may
also be marked as having a dependency of the object they point to,
which allows for automatic cleanup and deletion of most objects when
no longer needed.
Additionally, this allows not having to require in-memory copies of
everything when using external databases. db_sql has been rewritten
for this and now always requires a database to function. db_sql with
MySQL now requires InnoDB to make use of transactions and foreign
key constraints.
Diffstat (limited to 'modules/extra/m_ldap_authentication.cpp')
-rw-r--r-- | modules/extra/m_ldap_authentication.cpp | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/modules/extra/m_ldap_authentication.cpp b/modules/extra/m_ldap_authentication.cpp index 1b8b36fb4..dbd0344de 100644 --- a/modules/extra/m_ldap_authentication.cpp +++ b/modules/extra/m_ldap_authentication.cpp @@ -104,16 +104,16 @@ class IdentifyInterface : public LDAPInterface if (na == NULL) { na = new NickServ::Nick(ii->req->GetAccount(), new NickServ::Account(ii->req->GetAccount())); - na->last_realname = ii->user ? ii->user->realname : ii->req->GetAccount(); + na->SetLastRealname(ii->user ? ii->user->realname : ii->req->GetAccount()); NickServ::Event::OnNickRegister(&NickServ::Event::NickRegister::OnNickRegister, ii->user, na, ii->req->GetPassword());; - BotInfo *NickServ = Config->GetClient("NickServ"); + ServiceBot *NickServ = Config->GetClient("NickServ"); if (ii->user && NickServ) - ii->user->SendMessage(NickServ, _("Your account \002%s\002 has been successfully created."), na->nick.c_str()); + ii->user->SendMessage(NickServ, _("Your account \002%s\002 has been successfully created."), na->GetNick().c_str()); } // encrypt and store the password in the nickcore - Anope::Encrypt(ii->req->GetPassword(), na->nc->pass); + Anope::Encrypt(ii->req->GetPassword(), na->GetAccount()->pass); - na->nc->Extend<Anope::string>("m_ldap_authentication_dn", ii->dn); + na->GetAccount()->Extend<Anope::string>("m_ldap_authentication_dn", ii->dn); ii->req->Success(me); } break; @@ -164,13 +164,13 @@ class OnIdentifyInterface : public LDAPInterface const LDAPAttributes &attr = r.get(0); Anope::string email = attr.get(email_attribute); - if (!email.equals_ci(u->Account()->email)) + if (!email.equals_ci(u->Account()->GetEmail())) { - u->Account()->email = email; - BotInfo *NickServ = Config->GetClient("NickServ"); + u->Account()->GetEmail() = email; + ServiceBot *NickServ = Config->GetClient("NickServ"); if (NickServ) u->SendMessage(NickServ, _("Your email has been updated to \002%s\002"), email.c_str()); - Log(this->owner) << "Updated email address for " << u->nick << " (" << u->Account()->display << ") to " << email; + Log(this->owner) << "Updated email address for " << u->nick << " (" << u->Account()->GetDisplay() << ") to " << email; } } catch (const LDAPException &ex) @@ -332,18 +332,18 @@ class NSIdentifyLDAP : public Module attributes[0].values.push_back(object_class); attributes[1].name = username_attribute; - attributes[1].values.push_back(na->nick); + attributes[1].values.push_back(na->GetNick()); - if (!na->nc->email.empty()) + if (!na->GetAccount()->GetEmail().empty()) { attributes[2].name = email_attribute; - attributes[2].values.push_back(na->nc->email); + attributes[2].values.push_back(na->GetAccount()->GetEmail()); } attributes[3].name = this->password_attribute; attributes[3].values.push_back(pass); - Anope::string new_dn = username_attribute + "=" + na->nick + "," + basedn; + Anope::string new_dn = username_attribute + "=" + na->GetNick() + "," + basedn; this->ldap->Add(&this->orinterface, new_dn, attributes); } catch (const LDAPException &ex) |