#include <users.h>
Inherits Base, Extensible, and CommandReply.
Inherited by BotInfo, and NickServRelease.

Public Types | |
| typedef std::list < ChanUserContainer * > | ChanUserList |
Public Member Functions | |
| User (const Anope::string &snick, const Anope::string &sident, const Anope::string &shost, const Anope::string &svhost, const Anope::string &sip, Server *sserver, const Anope::string &srealname, time_t ssignon, const Anope::string &smodes, const Anope::string &suid="") | |
| void | ChangeNick (const Anope::string &newnick, time_t ts=Anope::CurTime) |
| void | SetDisplayedHost (const Anope::string &host) |
| const Anope::string & | GetDisplayedHost () const |
| void | SetCloakedHost (const Anope::string &newhost) |
| const Anope::string & | GetCloakedHost () const |
| const Anope::string & | GetUID () const |
| void | SetVIdent (const Anope::string &ident) |
| const Anope::string & | GetVIdent () const |
| void | SetIdent (const Anope::string &ident) |
| const Anope::string & | GetIdent () const |
| Anope::string | GetMask () const |
| Anope::string | GetDisplayedMask () const |
| void | SetRealname (const Anope::string &realname) |
| void | SendMessage (const BotInfo *source, const char *fmt,...) |
| void | SendMessage (const BotInfo *source, const Anope::string &msg) anope_override |
| void | Collide (NickAlias *na) |
| void | Identify (NickAlias *na) |
| void | Login (NickCore *core) |
| void | Logout () |
| virtual NickCore * | Account () const |
| bool | IsIdentified (bool check_nick=false) const |
| bool | IsRecognized (bool check_nick=true) const |
| bool | IsServicesOper () |
| bool | HasCommand (const Anope::string &cmdstr) |
| bool | HasPriv (const Anope::string &privstr) |
| void | UpdateHost () |
| bool | HasMode (const Anope::string &name) const |
| void | SetModeInternal (UserMode *um, const Anope::string ¶m="") |
| void | RemoveModeInternal (UserMode *um) |
| void | SetMode (const BotInfo *bi, UserMode *um, const Anope::string ¶m="") |
| void | SetMode (const BotInfo *bi, const Anope::string &name, const Anope::string ¶m="") |
| void | RemoveMode (const BotInfo *bi, UserMode *um) |
| void | RemoveMode (const BotInfo *bi, const Anope::string &name) |
| void | SetModes (const BotInfo *bi, const char *umodes,...) |
| void | SetModesInternal (const char *umodes,...) |
| Anope::string | GetModes () const |
| ChanUserContainer * | FindChannel (const Channel *c) const |
| bool | IsProtected () const |
| void | Kill (const Anope::string &source, const Anope::string &reason) |
| void | KillInternal (const Anope::string &source, const Anope::string &reason) |
| void | Quit (const Anope::string &reason="") |
| bool | Quitting () const |
| Anope::string | Mask () const |
| bool | BadPassword () |
Static Public Member Functions | |
| static User * | Find (const Anope::string &name, bool nick_only=false) |
| static void | QuitUsers () |
Data Fields | |
| Anope::string | nick |
| Anope::string | host |
| Anope::string | vhost |
| Anope::string | chost |
| Anope::string | realname |
| Anope::string | fingerprint |
| Anope::string | ip |
| Server * | server |
| time_t | signon |
| time_t | timestamp |
| bool | super_admin |
| ChanUserList | chans |
| time_t | lastmemosend |
| time_t | lastnickreg |
| time_t | lastmail |
Protected Member Functions | |
| virtual | ~User () |
Protected Attributes | |
| Anope::string | vident |
| Anope::string | ident |
| Anope::string | uid |
| bool | on_access |
| std::map< Anope::string, Anope::string > | modes |
| Serialize::Reference< NickCore > | nc |
| unsigned short | invalid_pw_count |
| time_t | invalid_pw_time |
Private Attributes | |
| bool | quit |
Static Private Attributes | |
| static std::list< User * > | quitting_users |
Definition at line 33 of file users.h.
| typedef std::list<ChanUserContainer *> User::ChanUserList |
| User::User | ( | const Anope::string & | snick, | |
| const Anope::string & | sident, | |||
| const Anope::string & | shost, | |||
| const Anope::string & | svhost, | |||
| const Anope::string & | sip, | |||
| Server * | sserver, | |||
| const Anope::string & | srealname, | |||
| time_t | ssignon, | |||
| const Anope::string & | smodes, | |||
| const Anope::string & | suid = "" | |||
| ) |
Create a new user object, initialising necessary fields and adds it to the hash
| snick | The nickname of the user. | |
| sident | The username of the user | |
| shost | The hostname of the user | |
| svhost | The vhost of the user | |
| sip | The ip of the user | |
| sserver | The server of the user | |
| srealname | The realname/gecos of teh user | |
| ssignon | User's timestamp | |
| smodes | User's modes | |
| suid | The unique identifier of the user. |
Definition at line 35 of file users.cpp.
References Anope::string::c_str(), Anope::CurTime, Anope::string::empty(), FOREACH_MOD, Server::GetName(), host, I_OnUserConnect, ident, invalid_pw_count, invalid_pw_time, ip, Server::IsULined(), lastmail, lastmemosend, lastnickreg, LOG_DEBUG, MaxUserCount, MaxUserTime, nc, nick, on_access, quit, realname, server, SetCloakedHost(), SetModesInternal(), signon, super_admin, timestamp, uid, Server::users, and vhost.
| User::~User | ( | ) | [protected, virtual] |
Destroy a user.
Definition at line 229 of file users.cpp.
References chans, Anope::string::empty(), FOREACH_MOD, Server::GetName(), HasMode(), I_OnPostUserLogoff, I_OnPreUserLogoff, Logout(), nick, OperCount, realname, server, ModeManager::StackerDel(), uid, and Server::users.
| NickCore * User::Account | ( | ) | const [virtual] |
Get the account the user is logged in using
Definition at line 449 of file users.cpp.
References nc.
Referenced by ChannelInfo::AccessFor(), MyMemoServService::Check(), ChannelInfo::CheckKick(), NSCert::DoAutoIdentify(), MyXMLRPCEvent::DoUser(), CommandNSStatus::Execute(), CommandNSRegister::Execute(), CommandNSInfo::Execute(), CommandNSIdentify::Execute(), CommandNSUngroup::Execute(), CommandNSGroup::Execute(), CommandHSOn::Execute(), MChanstats::GetDisplay(), MemoInfo::HasIgnore(), IsFounder(), StatusUpdate::OnAccessAdd(), StatusUpdate::OnAccessDel(), NickServCore::OnDelNick(), BotInfo::OnMessage(), MChanstats::OnModeChange(), IdentifyInterface::OnResult(), OnIdentifyInterface::OnResult(), NSRecoverRequest::OnSuccess(), NSIdentifyRequest::OnSuccess(), NSGroupRequest::OnSuccess(), MChanstats::OnTopicUpdated(), MyMemoServService::Send(), CommandNSSetEmail::SendConfirmMail(), UnrealIRCdProto::SendLogin(), HybridProto::SendLogin(), Channel::SetCorrectModes(), and Language::Translate().
| bool User::BadPassword | ( | ) |
Notes the usage of an incorrect password. If too many incorrect passwords are used the user might be killed.
Definition at line 812 of file users.cpp.
References ServerConfig::BadPassLimit, ServerConfig::BadPassTimeout, Config, Anope::CurTime, invalid_pw_count, invalid_pw_time, Kill(), and ServerConfig::ServerName.
Referenced by CommandOSLogin::Execute(), NSRecoverRequest::OnFail(), NSIdentifyRequest::OnFail(), and NSGroupRequest::OnFail().
| void User::ChangeNick | ( | const Anope::string & | newnick, | |
| time_t | ts = Anope::CurTime | |||
| ) |
Update the nickname of a user record accordingly, should be called from ircd protocol.
| newnick | The new username | |
| ts | The time the nick was changed, User::timestamp will be updated to this. |
Definition at line 88 of file users.cpp.
References Anope::CurTime, Anope::string::empty(), Anope::string::equals_ci(), Find(), FOREACH_MOD, I_OnUserNickChange, IsIdentified(), IsRecognized(), NickAlias::last_seen, NickAlias::nc, nick, on_access, realname, super_admin, timestamp, and UpdateHost().
| void User::Collide | ( | NickAlias * | na | ) |
Collide a nick See the comment in users.cpp
| na | The nick |
Collides a nick.
First, it marks the nick (if the user is on a registered nick, we don't use it without but it could be) as COLLIDED, this is checked in NickAlias::OnCancel.
Then it does one of two things.
1. This will force change the users nick to the guest nick. This gets processed by the IRCd and comes back to call do_nick. do_nick changes the nick of the use to the new one, then calls NickAlias::OnCancel with the users old nick's nickalias (if there is one).
2. Calls User::Kill, which will either delete the user immediatly or kill them, wait for the QUIT, then delete the user then. Users destructor then calls NickAlias::OnCancel
NickAlias::OnCancel checks for NS_COLLIDED, it then does one of two things.
1. If supported, we send a SVSHold for the user. We are done here, the IRCds expires this at the time we give it.
2. We create a new client with SendClientIntroduction(). Note that is it important that this is called either after the user has been removed from our internal list of user or after the users nick has been updated completely internally. This is beacuse SendClientIntroduction will destroy any users we think are currently on the nickname (which causes a lot of problems, eg, deleting the user which recalls OnCancel), whether they really are or not. We then create a release timer for this new client that waits and later on sends a QUIT for the client. Release timers are never used for SVSHolds. Ever.
Note that now for the timers we only store the users name, not the NickAlias* pointer. We never remove timers when a user changes nick or a nick is deleted, the timers must assume that either of these may have happend.
Storing NickAlias* pointers caused quite a problem, some of which are:
Having a valid timer alive that calls User::Collide would either:
1. Kill the user, causing users destructor to cancel all timers for the nick (as it should, it has no way of knowing if we are in a timer or not) which would delete the currently active timer while it was running, causing TimerManager to explode.
2. Force a user off of their nick, this would call NickAlias::Cancel before updating the user internally (to cancel the current nicks timers, granted we could have easially saved this and called it after) which could possibly try to introduce an enforcer nick. We would then check to see if the nick is already in use (it is, internally) and send a kill for that nick. That may in turn delete the user immediatly, calling users destructor, which would attempt to delete the timer, causing TimerManager to explode.
Additionally, if we marked the timer as "in use" so that calling the ClearTimer function wouldn't delete them, users destructor would then call NickAlias::OnCancel, which would (at this point, it was unsetting GUESTED after introducing the new client) introduce the same new client again, without actually deleting the originial user, causing an infinite loop.
This is why we remove NS_GUESTED first in NickAlias::OnCancel before introducing a new client, although this should not happen anymore. If I must emphasize this again, users need to be GONE from the internal list before calling NickAlias::OnCancel. NickAlias::OnCancel intentionally reffers to this->nick, not the user passed to it. They *can* (but not always) be different, depending if the user changed nicks or disconnected.
Adam
Definition at line 346 of file users.cpp.
References _, Anope::string::c_str(), IRCDProto::CanSVSNick, Config, Anope::CurTime, Extensible::Extend(), Find(), IRCD, Kill(), NickServ, ServerConfig::NickServ, ServerConfig::NSGuestNickPrefix, IRCDProto::SendForceNickChange(), SendMessage(), and stringify().
Referenced by CommandNSSuspend::Execute(), NSRecoverRequest::OnSuccess(), and OSForbid::OnUserNickChange().
| User * User::Find | ( | const Anope::string & | name, | |
| bool | nick_only = false | |||
| ) | [static] |
Finds a user by nick, or possibly UID
| name | The nick, or possibly UID, to lookup | |
| nick_only | set to true to only look up by nick, not UID |
Definition at line 830 of file users.cpp.
References IRCD, and IRCDProto::RequiresID.
Referenced by ChangeNick(), Collide(), CommandOSAKill::DoAdd(), XOPBase::DoAdd(), CommandCSAccess::DoAdd(), XOPBase::DoDel(), CommandCSAccess::DoDel(), CommandCSFlags::DoModify(), CommandCSMode::DoSet(), MyXMLRPCEvent::DoUser(), EOld::EOld(), CommandOSSVSPart::Execute(), CommandOSSVSJoin::Execute(), CommandOSSVSNick::Execute(), CommandOSOLine::Execute(), CommandOSUMode::Execute(), CommandOSMode::Execute(), CommandOSChanList::Execute(), CommandOSKill::Execute(), CommandOSKick::Execute(), CommandNSSuspend::Execute(), CommandNSStatus::Execute(), CommandNSRecover::Execute(), CommandNSLogout::Execute(), CommandNSInfo::Execute(), CommandNSUngroup::Execute(), CommandCSDown::Execute(), CommandCSUp::Execute(), CommandCSUnban::Execute(), CommandCSStatus::Execute(), CommandSeen::Execute(), CommandCSKick::Execute(), CommandCSInvite::Execute(), CommandCSBan::Execute(), Identify(), IsIdentified(), IsRecognized(), KillInternal(), MessageSource::MessageSource(), HelpChannel::OnChannelModeSet(), NickServCore::OnDelNick(), IdentifyInterface::OnResult(), OnIdentifyInterface::OnResult(), NSRecoverRequest::OnSuccess(), MChanstats::OnTopicUpdated(), ProtoInspIRCd::ProtoInspIRCd(), ProtoPlexus::ProtoPlexus(), ProtoRatbox::ProtoRatbox(), Message::Whois::Run(), Message::Mode::Run(), Message::Kill::Run(), IRCDMessageSetName::Run(), IRCDMessageChgName::Run(), IRCDMessageChgHost::Run(), IRCDMessageNJoin::Run(), IRCDMessageEncap::Run(), IRCDMessageMetadata::Run(), IRCDMessageFJoin::Run(), IRCDMessageChgIdent::Run(), IRCDMessageSVSMode::Run(), IRCDMessageSJoin::Run(), IRCDMessageMode::Run(), MyMemoServService::Send(), InspIRCd12Proto::SendSWhois(), Channel::SetModesInternal(), SetRealname(), ExpireCallback::Tick(), Servers::TS6_UID_Retrieve(), and UpdateHost().
| ChanUserContainer * User::FindChannel | ( | const Channel * | c | ) | const |
Find the channel container for Channel c that the user is on This is preferred over using FindUser in Channel, as there are usually more users in a channel than channels a user is in
| c | The channel |
Definition at line 721 of file users.cpp.
References chans.
Referenced by CommandCSRegister::Execute(), CommandCSClone::Execute(), Channel::HasUserStatus(), Channel::KickInternal(), Channel::RemoveModeInternal(), Message::Part::Run(), and Channel::SetModeInternal().
| const Anope::string & User::GetCloakedHost | ( | ) | const |
Get the cloaked host of a user
Definition at line 161 of file users.cpp.
References chost.
Referenced by GetDisplayedHost(), NickCore::IsOnAccess(), and Entry::Matches().
| const Anope::string & User::GetDisplayedHost | ( | ) | const |
Get the displayed vhost of a user record.
Definition at line 139 of file users.cpp.
References Anope::string::empty(), GetCloakedHost(), HasMode(), host, and vhost.
Referenced by XOPBase::DoAdd(), CommandCSAccess::DoAdd(), XOPBase::DoDel(), CommandCSAccess::DoDel(), CommandCSFlags::DoModify(), CommandOSUserList::Execute(), CommandNSRegister::Execute(), GetDisplayedMask(), ChannelInfo::GetIdealBan(), Identify(), Mask(), Entry::Matches(), NSGroupRequest::OnSuccess(), UpdateHost(), and CSSeen::UpdateUser().
| Anope::string User::GetDisplayedMask | ( | ) | const |
Get the full display mask (nick!vident/chost)
Definition at line 210 of file users.cpp.
References GetDisplayedHost(), GetVIdent(), and nick.
Referenced by CommandCSKick::Execute(), CommandCSBan::Execute(), ChanAccess::Matches(), and Channel::SetCorrectModes().
| const Anope::string & User::GetIdent | ( | ) | const |
Get the real ident (username) of this user.
Definition at line 200 of file users.cpp.
References ident.
Referenced by CommandBSBot::DoAdd(), CommandBSBot::DoChange(), MyXMLRPCEvent::DoUser(), CommandOSUserList::Execute(), CommandNSRegister::Execute(), CommandBSInfo::Execute(), CommandBSBotList::Execute(), Identify(), NickCore::IsOnAccess(), IsServicesOper(), Mask(), Entry::Matches(), DBPlain::OnSaveDatabase(), NSGroupRequest::OnSuccess(), Message::Whois::Run(), and UpdateHost().
| Anope::string User::GetMask | ( | ) | const |
Get the full mask (nick!ident) of a user
Definition at line 205 of file users.cpp.
References host, ident, and nick.
Referenced by Log::BuildPrefix(), CommandBSBot::DoAdd(), CommandBSBot::DoChange(), CommandCSMode::DoSet(), BSKick::GetBanData(), MemoInfo::HasIgnore(), and RunCommand().
| Anope::string User::GetModes | ( | ) | const |
Get modes set for this user.
Definition at line 701 of file users.cpp.
References ModeManager::FindUserModeByName(), Mode::mchar, and modes.
| const Anope::string & User::GetUID | ( | ) | const |
Retrieves the UID of the user, if set, else the nick.
Definition at line 166 of file users.cpp.
References Anope::string::empty(), IRCD, nick, IRCDProto::RequiresID, and uid.
Referenced by DoServices(), CommandCSMode::DoSet(), CommandOSMode::Execute(), CommandCSRegister::Execute(), CommandCSClone::Execute(), Channel::RemoveModeInternal(), Channel::Reset(), IRCDProto::SendInvite(), IRCDProto::SendKickInternal(), SendMessage(), IRCDProto::SendOper(), InspIRCd12Proto::SendSVSJoin(), InspIRCdProto::SendSVSJoin(), IRCDProto::SendSVSKillInternal(), InspIRCd12Proto::SendSWhois(), Channel::SetCorrectModes(), Channel::SetModes(), and UplinkSocket::Message::~Message().
| const Anope::string & User::GetVIdent | ( | ) | const |
Get the displayed ident (username) of this user.
Definition at line 183 of file users.cpp.
References Anope::string::empty(), ident, and vident.
Referenced by MyXMLRPCEvent::DoUser(), GetDisplayedMask(), ChannelInfo::GetIdealBan(), Entry::Matches(), and CSSeen::UpdateUser().
| bool User::HasCommand | ( | const Anope::string & | cmdstr | ) |
Check whether this user has access to run the given command string.
| cmdstr | The string to check, e.g. botserv/set/private. |
Definition at line 511 of file users.cpp.
References IsServicesOper(), and nc.
| bool User::HasMode | ( | const Anope::string & | name | ) | const |
Check if the user has a mode
| name | Mode name |
Definition at line 544 of file users.cpp.
References modes.
Referenced by ChannelModeOper::CanSet(), ChannelModeAdmin::CanSet(), CommandCSEnforce::DoSSLOnly(), CommandOSNOOP::Execute(), CommandOSMode::Execute(), CommandOSUserList::Execute(), CommandOSChanKill::Execute(), CommandNSRegister::Execute(), CommandNSGroup::Execute(), CommandCSSuspend::Execute(), GetDisplayedHost(), Identify(), IsProtected(), CommandOSSQLine::OnAdd(), CommandOSSNLine::OnAdd(), ChanServCore::OnBotPrivmsg(), OSIgnore::OnBotPrivmsg(), OSForbid::OnUserNickChange(), RemoveMode(), Message::Stats::Run(), IRCDMessageSetHost::Run(), IRCDMessageOperType::Run(), SetMode(), ShouldHide(), and ~User().
| bool User::HasPriv | ( | const Anope::string & | privstr | ) |
Check whether this user has access to the given special permission.
| privstr | The priv to check for, e.g. users/auspex. |
Definition at line 518 of file users.cpp.
References IsServicesOper(), and nc.
Referenced by HelpChannel::OnChannelModeSet(), and MyMemoServService::Send().
| void User::Identify | ( | NickAlias * | na | ) |
Identify the user to the Nick updates last_seen, logs the user in, send messages, checks for mails, set vhost and more
| the | NickAlias |
Definition at line 374 of file users.cpp.
References IRCDProto::CanSetVHost, Config, Anope::CurTime, Anope::string::equals_ci(), Find(), ModeManager::FindUserModeByName(), FOREACH_MOD, GetDisplayedHost(), GetIdent(), HasMode(), host, I_OnNickIdentify, IRCD, IsServicesOper(), NickAlias::last_realhost, NickAlias::last_realname, NickAlias::last_seen, NickAlias::last_usermask, Login(), nc, NickAlias::nc, NickAlias::nick, nick, NickServ, ServerConfig::NoNicknameOwnership, Anope::string::npos, OperServ, realname, IRCDProto::SendLogin(), SendMessage(), IRCDProto::SendOper(), IRCDProto::SendVhost(), SetDisplayedHost(), SetMode(), and SetModes().
Referenced by NSCert::DoAutoIdentify(), and NSIdentifyRequest::OnSuccess().
| bool User::IsIdentified | ( | bool | check_nick = false |
) | const |
Check if the user is identified for their nick
| check_nick | True to check if the user is identified to the nickname they are on too |
Definition at line 454 of file users.cpp.
References Find(), NickAlias::nc, and nc.
Referenced by ChangeNick(), NSCert::DoAutoIdentify(), CommandCSEnforce::DoRegOnly(), CommandNSStatus::Execute(), KillInternal(), NickServCore::OnServerSync(), NSIdentifyRequest::OnSuccess(), Message::Quit::Run(), MyMemoServService::Send(), SetRealname(), ExpireCallback::Tick(), UpdateHost(), and Server::~Server().
| bool User::IsProtected | ( | ) | const |
Check if the user is protected from kicks and negative mode changes
Definition at line 729 of file users.cpp.
References HasMode().
Referenced by ChannelInfo::CheckKick(), CommandCSEnforce::DoBans(), CommandCSEnforce::DoLimit(), CommandCSEnforce::DoRegOnly(), CommandCSEnforce::DoRestricted(), CommandCSMode::DoSet(), CommandCSEnforce::DoSSLOnly(), CommandOSSVSPart::Execute(), CommandOSSVSJoin::Execute(), CommandOSKill::Execute(), CommandCSKick::Execute(), CommandCSBan::Execute(), and Channel::Kick().
| bool User::IsRecognized | ( | bool | check_nick = true |
) | const |
Check if the user is recognized for their nick (on the nicks access list)
| check_nick | Only returns true if the user has secure off |
Definition at line 469 of file users.cpp.
References Find(), NickAlias::nc, nick, and on_access.
Referenced by ChannelInfo::AccessFor(), ChangeNick(), CommandNSStatus::Execute(), KillInternal(), Message::Quit::Run(), SetRealname(), ExpireCallback::Tick(), UpdateHost(), and Server::~Server().
| bool User::IsServicesOper | ( | ) |
Check if the user is a services oper
Definition at line 482 of file users.cpp.
References EVENT_STOP, fingerprint, FOREACH_RESULT, GetIdent(), host, I_IsServicesOper, Anope::Match(), and nc.
Referenced by CommandNSLogout::Execute(), HasCommand(), HasPriv(), and Identify().
| void User::Kill | ( | const Anope::string & | source, | |
| const Anope::string & | reason | |||
| ) |
Kill a user
| source | The user/server doing the kill | |
| reason | The reason for the kill |
Definition at line 737 of file users.cpp.
References Anope::string::c_str(), Config, Anope::string::empty(), BotInfo::Find(), IRCD, IRCDProto::SendSVSKill(), and ServerConfig::ServerName.
Referenced by OSSession::AddSession(), BadPassword(), Collide(), CommandOSNOOP::Execute(), CommandOSKill::Execute(), CommandOSSQLine::OnAdd(), CommandOSSNLine::OnAdd(), and NSRecoverRequest::OnSuccess().
| void User::KillInternal | ( | const Anope::string & | source, | |
| const Anope::string & | reason | |||
| ) |
Process a kill for a user
| source | The user/server doing the kill | |
| reason | The reason for the kill |
Definition at line 745 of file users.cpp.
References Anope::CurTime, Find(), IsIdentified(), IsRecognized(), NickAlias::last_quit, NickAlias::last_seen, LOG_DEBUG, NickAlias::nc, nick, quit, and quitting_users.
Referenced by Message::Kill::Run().
| void User::Login | ( | NickCore * | core | ) |
Login the user to a NickCore
| core | The account the user is useing |
Definition at line 423 of file users.cpp.
References Server::IsSynced(), Logout(), nc, server, UpdateHost(), and NickCore::users.
Referenced by CommandNSRegister::Execute(), Identify(), NSRecoverRequest::OnSuccess(), NSGroupRequest::OnSuccess(), IRCDMessageEncap::Run(), and IRCDMessageMetadata::Run().
| void User::Logout | ( | ) |
Logout the user
Definition at line 435 of file users.cpp.
References nc.
Referenced by CommandNSSuspend::Execute(), CommandNSLogout::Execute(), Login(), NickServCore::OnDelCore(), NickServCore::OnDelNick(), NickCore::~NickCore(), and ~User().
| Anope::string User::Mask | ( | ) | const |
Definition at line 783 of file users.cpp.
References Anope::string::find(), Anope::string::find_first_not_of(), GetDisplayedHost(), GetIdent(), Anope::string::npos, and Anope::string::substr().
Referenced by CommandNSRegister::Execute(), and ChannelInfo::GetIdealBan().
| void User::Quit | ( | const Anope::string & | reason = "" |
) |
Processes a quit for the user, and marks them as quit
| reason | The reason for the quit |
Definition at line 766 of file users.cpp.
References LOG_DEBUG, nick, quit, and quitting_users.
Referenced by NickAlias::Release(), Message::Quit::Run(), and Server::~Server().
| bool User::Quitting | ( | ) | const |
| void User::QuitUsers | ( | ) | [static] |
Quits all users who are pending to be quit
Definition at line 848 of file users.cpp.
References quitting_users.
Referenced by UplinkSocket::ProcessRead().
Remove a mode on the user
| bi | The client setting the mode | |
| um | The user mode |
Definition at line 583 of file users.cpp.
References HasMode(), Mode::name, RemoveModeInternal(), and ModeManager::StackerAdd().
Referenced by CommandNSLogout::Execute(), CommandNSUngroup::Execute(), NickServCore::OnDelCore(), NickServCore::OnDelNick(), ProtoInspIRCd::OnUserNickChange(), RemoveMode(), and SetModes().
| void User::RemoveMode | ( | const BotInfo * | bi, | |
| const Anope::string & | name | |||
| ) |
Remove a mode from the user
| bi | The client setting the mode | |
| name | The mode name |
Definition at line 592 of file users.cpp.
References ModeManager::FindUserModeByName(), and RemoveMode().
| void User::RemoveModeInternal | ( | UserMode * | um | ) |
Remove a mode internally on the user, the IRCd is not informed
| um | The user mode |
Definition at line 559 of file users.cpp.
References FOREACH_MOD, I_OnUserModeUnset, modes, and Mode::name.
Referenced by ProtoUnreal::OnUserNickChange(), ProtongIRCd::OnUserNickChange(), ProtoInspIRCd::OnUserNickChange(), ProtoHybrid::OnUserNickChange(), ProtoBahamut::OnUserNickChange(), RemoveMode(), and SetModesInternal().
| void User::SendMessage | ( | const BotInfo * | source, | |
| const Anope::string & | msg | |||
| ) | [virtual] |
Implements CommandReply.
Definition at line 270 of file users.cpp.
References Anope::string::c_str(), Config, GetUID(), IRCD, nc, ServerConfig::NSDefFlags, IRCDProto::SendNotice(), IRCDProto::SendPrivmsg(), Language::Translate(), and ServerConfig::UsePrivmsg.
| void User::SendMessage | ( | const BotInfo * | source, | |
| const char * | fmt, | |||
| ... | ||||
| ) |
Send a message (notice or privmsg, depending on settings) to a user
| source | Sender | |
| fmt | Format of the Message | |
| ... | any number of parameters |
Definition at line 255 of file users.cpp.
References BUFSIZE, and Language::Translate().
Referenced by OSSession::AddSession(), MyMemoServService::Check(), Collide(), OSNews::DisplayNews(), NSCert::DoAutoIdentify(), CommandOSOLine::Execute(), CommandOSUMode::Execute(), CommandCSInvite::Execute(), Identify(), OnIdentifyInterface::OnResult(), NSRecoverRequest::OnSuccess(), OSForbid::OnUserNickChange(), Message::Privmsg::Run(), IRCDMessageMetadata::Run(), Mail::Send(), and MyMemoServService::Send().
| void User::SetCloakedHost | ( | const Anope::string & | newhost | ) |
Update the cloaked host of a user
| host | The cloaked host |
Definition at line 149 of file users.cpp.
References chost, Anope::string::empty(), and UpdateHost().
Referenced by IRCDMessageSetHost::Run(), IRCDMessageMetadata::Run(), and User().
| void User::SetDisplayedHost | ( | const Anope::string & | host | ) |
Update the displayed (vhost) of a user record. This is used (if set) instead of real host.
| host | The new displayed host to give the user. |
Definition at line 127 of file users.cpp.
References Anope::string::empty(), UpdateHost(), and vhost.
Referenced by Identify(), IRCDMessageSetHost::Run(), IRCDMessageChgHost::Run(), IRCDMessageMetadata::Run(), and IRCDMessageEncap::Run().
| void User::SetIdent | ( | const Anope::string & | ident | ) |
Update the real ident (username) of a user record.
| ident | The new ident to give this user. NOTE: Where possible, you should use the Get/SetVIdent() equivilants. |
Definition at line 191 of file users.cpp.
References ident, and UpdateHost().
Referenced by CommandBSBot::DoChange(), IRCDMessageEncap::Run(), and IRCDMessageChgIdent::Run().
| void User::SetMode | ( | const BotInfo * | bi, | |
| const Anope::string & | name, | |||
| const Anope::string & | param = "" | |||
| ) |
Set a mode on the user
| bi | The client setting the mode | |
| name | The mode name | |
| Param | Optional param for the mode |
Definition at line 578 of file users.cpp.
References ModeManager::FindUserModeByName(), and SetMode().
| void User::SetMode | ( | const BotInfo * | bi, | |
| UserMode * | um, | |||
| const Anope::string & | param = "" | |||
| ) |
Set a mode on the user
| bi | The client setting the mode | |
| um | The user mode | |
| Param | Optional param for the mode |
Definition at line 569 of file users.cpp.
References HasMode(), Mode::name, SetModeInternal(), and ModeManager::StackerAdd().
Referenced by CommandOSOLine::Execute(), CommandNSRegister::Execute(), Identify(), HelpChannel::OnChannelModeSet(), NSGroupRequest::OnSuccess(), IRCDMessageEncap::Run(), IRCDMessageMetadata::Run(), IRCDProto::SendOper(), SetMode(), and SetModes().
| void User::SetModeInternal | ( | UserMode * | um, | |
| const Anope::string & | param = "" | |||
| ) |
Set a mode internally on the user, the IRCd is not informed
| um | The user mode | |
| Param | The param, if there is one |
Definition at line 549 of file users.cpp.
References FOREACH_MOD, I_OnUserModeSet, modes, and Mode::name.
Referenced by SetMode(), and SetModesInternal().
| void User::SetModes | ( | const BotInfo * | bi, | |
| const char * | umodes, | |||
| ... | ||||
| ) |
Set a string of modes on a user
| bi | The client setting the modes | |
| umodes | The modes |
Definition at line 597 of file users.cpp.
References BUFSIZE, ModeManager::FindUserModeByChar(), sepstream::GetToken(), Anope::string::length(), MODE_PARAM, RemoveMode(), SetMode(), and Mode::type.
Referenced by CommandOSUMode::Execute(), and Identify().
| void User::SetModesInternal | ( | const char * | umodes, | |
| ... | ||||
| ) |
Set a string of modes on a user internally
| umodes | The modes |
Definition at line 641 of file users.cpp.
References BUFSIZE, Anope::string::clear(), Anope::string::empty(), ModeManager::FindUserModeByChar(), sepstream::GetToken(), Anope::string::length(), MODE_PARAM, Mode::name, OperCount, RemoveModeInternal(), SetModeInternal(), Mode::type, UpdateHost(), and vhost.
Referenced by BotInfo::BotInfo(), Message::Mode::Run(), IRCDMessageOperType::Run(), IRCDMessageSVSMode::Run(), IRCDMessageMode::Run(), Server::Server(), and User().
| void User::SetRealname | ( | const Anope::string & | realname | ) |
Updates the realname of the user record.
Definition at line 215 of file users.cpp.
References Anope::string::empty(), Find(), IsIdentified(), IsRecognized(), NickAlias::last_realname, nick, and realname.
Referenced by IRCDMessageSetName::Run(), IRCDMessageChgName::Run(), IRCDMessageMetadata::Run(), and IRCDMessageEncap::Run().
| void User::SetVIdent | ( | const Anope::string & | ident | ) |
Update the displayed ident (username) of a user record.
| ident | The new ident to give this user. |
Definition at line 174 of file users.cpp.
References UpdateHost(), and vident.
Referenced by CommandHSOn::Execute(), IRCDMessageSetIdent::Run(), IRCDMessageChgIdent::Run(), and IRCDMessageMetadata::Run().
| void User::UpdateHost | ( | ) |
Update the last usermask stored for a user, and check to see if they are recognized
Definition at line 525 of file users.cpp.
References Anope::string::empty(), Find(), GetDisplayedHost(), GetIdent(), host, IsIdentified(), IsRecognized(), NickAlias::last_realhost, NickAlias::last_usermask, NickAlias::nc, nick, and on_access.
Referenced by ChangeNick(), CommandHSOn::Execute(), Login(), SetCloakedHost(), SetDisplayedHost(), SetIdent(), SetModesInternal(), and SetVIdent().
Definition at line 83 of file users.h.
Referenced by Channel::DeleteUser(), MyXMLRPCEvent::DoUser(), CommandOSChanList::Execute(), FindChannel(), Channel::JoinUser(), NSRecoverRequest::OnSuccess(), Message::Kill::Run(), Message::Join::Run(), and ~User().
Definition at line 65 of file users.h.
Referenced by MyXMLRPCEvent::DoUser(), GetCloakedHost(), and SetCloakedHost().
Definition at line 69 of file users.h.
Referenced by CommandNSCert::DoAdd(), NSCert::DoAutoIdentify(), CommandNSCert::DoDel(), CommandNSGroup::Execute(), IsServicesOper(), IRCDMessageEncap::Run(), and IRCDMessageMetadata::Run().
Definition at line 61 of file users.h.
Referenced by CommandOSAKill::DoAdd(), CommandBSBot::DoAdd(), CommandBSBot::DoChange(), MyXMLRPCEvent::DoUser(), CommandOSUserList::Execute(), CommandOSChanKill::Execute(), CommandBSInfo::Execute(), CommandBSBotList::Execute(), GetDisplayedHost(), GetMask(), Identify(), NickCore::IsOnAccess(), IsServicesOper(), Entry::Matches(), DBPlain::OnSaveDatabase(), Message::Whois::Run(), BotInfo::Serialize(), BotInfo::Unserialize(), UpdateHost(), and User().
Anope::string User::ident [protected] |
Definition at line 41 of file users.h.
Referenced by GetIdent(), GetMask(), GetVIdent(), BotInfo::Serialize(), SetIdent(), and User().
unsigned short User::invalid_pw_count [protected] |
Definition at line 51 of file users.h.
Referenced by BadPassword(), and User().
time_t User::invalid_pw_time [protected] |
Definition at line 53 of file users.h.
Referenced by BadPassword(), and User().
Definition at line 71 of file users.h.
Referenced by OSSession::AddSession(), OSSession::DelSession(), MyXMLRPCEvent::DoUser(), CommandOSUserList::Execute(), Entry::Matches(), and User().
| time_t User::lastmail |
Definition at line 90 of file users.h.
Referenced by Mail::Send(), and User().
| time_t User::lastmemosend |
Definition at line 86 of file users.h.
Referenced by CommandHSRequest::Execute(), MyMemoServService::Send(), and User().
| time_t User::lastnickreg |
Definition at line 88 of file users.h.
Referenced by CommandNSRegister::Execute(), CommandNSGroup::Execute(), NSGroupRequest::OnSuccess(), and User().
std::map<Anope::string, Anope::string> User::modes [protected] |
Definition at line 46 of file users.h.
Referenced by GetModes(), HasMode(), RemoveModeInternal(), and SetModeInternal().
Serialize::Reference<NickCore> User::nc [protected] |
Definition at line 48 of file users.h.
Referenced by Account(), HasCommand(), HasPriv(), Identify(), IsIdentified(), IsServicesOper(), Login(), Logout(), SendMessage(), and User().
Definition at line 58 of file users.h.
Referenced by ChannelInfo::AccessFor(), BotInfo::BotInfo(), ChangeNick(), Channel::ChangeTopic(), Channel::ChangeTopicInternal(), ChannelInfo::CheckKick(), Channel::DeleteUser(), CommandBSBot::DoAdd(), NSCert::DoAutoIdentify(), CommandBSBot::DoChange(), MyXMLRPCEvent::DoChannel(), DoCommands(), CommandBSBot::DoDel(), DoneServices(), CommandCSMode::DoSet(), MyXMLRPCEvent::DoUser(), CommandOSSVSPart::Execute(), CommandOSSVSJoin::Execute(), CommandOSOper::Execute(), CommandOSModInfo::Execute(), CommandOSUMode::Execute(), CommandOSUserList::Execute(), CommandOSChanList::Execute(), CommandOSKill::Execute(), CommandOSKick::Execute(), CommandNSUpdate::Execute(), CommandNSLogout::Execute(), CommandNSIdentify::Execute(), CommandNSUngroup::Execute(), CommandNSGroup::Execute(), CommandHSOn::Execute(), CommandHSOff::Execute(), CommandCSUnban::Execute(), CommandCSStatus::Execute(), CommandSeen::Execute(), CommandCSLog::Execute(), CommandCSKick::Execute(), CommandCSInvite::Execute(), CommandCSBan::Execute(), CommandBSSetPrivate::Execute(), CommandBSInfo::Execute(), CommandBSBotList::Execute(), CommandBSAssign::Execute(), GetDisplayedMask(), GetMask(), MessageSource::GetName(), GetUID(), MemoInfo::HasIgnore(), Identify(), IsRecognized(), BotInfo::Join(), Channel::Kick(), Channel::KickInternal(), KillInternal(), LoadBotInfo(), LoadBots(), ModuleManager::LoadModule(), Log::Log(), Entry::Matches(), ChanAccess::Matches(), NickServCollide::NickServCollide(), StatusUpdate::OnAccessAdd(), StatusUpdate::OnAccessDel(), CommandOSSQLine::OnAdd(), OSIgnore::OnBotPrivmsg(), OSForbid::OnJoinChannel(), BotInfo::OnMessage(), IdentifyInterface::OnResult(), OnIdentifyInterface::OnResult(), DBPlain::OnSaveDatabase(), NSGroupRequest::OnSuccess(), OSDefcon::OnUserConnect(), OSForbid::OnUserNickChange(), Quit(), CommandCSDown::RemoveAll(), Channel::RemoveModeInternal(), Channel::Reset(), ChannelInfo::RestoreTopic(), Message::Whois::Run(), Message::Quit::Run(), Message::Privmsg::Run(), IRCDMessageEncap::Run(), IRCDMessageUID::Run(), IRCDMessageJoin::Run(), IRCDMessageMetadata::Run(), IRCDMessageNick::Run(), IRCDProto::SendForceNickChange(), HybridProto::SendSVSHold(), BotInfo::Serialize(), Server::Server(), Channel::SetCorrectModes(), Channel::SetModeInternal(), Channel::SetModesInternal(), BotInfo::SetNewNick(), SetRealname(), BotInfo::UnAssign(), BotInfo::Unserialize(), UpdateHost(), User(), BotInfo::~BotInfo(), UplinkSocket::Message::~Message(), Server::~Server(), UplinkSocket::~UplinkSocket(), and ~User().
bool User::on_access [protected] |
Definition at line 44 of file users.h.
Referenced by ChangeNick(), IsRecognized(), UpdateHost(), and User().
bool User::quit [private] |
Definition at line 36 of file users.h.
Referenced by KillInternal(), Quit(), Quitting(), and User().
std::list< User * > User::quitting_users [static, private] |
Definition at line 38 of file users.h.
Referenced by KillInternal(), Quit(), and QuitUsers().
Definition at line 67 of file users.h.
Referenced by ChangeNick(), CommandBSBot::DoAdd(), CommandBSBot::DoChange(), CommandNSUpdate::Execute(), CommandNSRegister::Execute(), CommandBSInfo::Execute(), Identify(), LoadBotInfo(), Entry::Matches(), CommandOSSNLine::OnAdd(), DBPlain::OnSaveDatabase(), NSGroupRequest::OnSuccess(), Message::Whois::Run(), BotInfo::Serialize(), SetRealname(), BotInfo::Unserialize(), User(), and ~User().
Definition at line 73 of file users.h.
Referenced by BSKick::bot_kick(), BSKick::check_ban(), ChannelInfo::CheckKick(), CommandOSSVSPart::Execute(), CommandOSSVSJoin::Execute(), CommandOSNOOP::Execute(), CommandOSKill::Execute(), CommandOSChanKill::Execute(), CommandCSSuspend::Execute(), Channel::Kick(), Channel::KickInternal(), Login(), CommandOSSQLine::OnAdd(), CommandOSSNLine::OnAdd(), NickServCore::OnServerSync(), OSNews::OnUserConnect(), NickAlias::Release(), Message::Whois::Run(), Message::Kill::Run(), IRCDMessageEncap::Run(), IRCDMessageMetadata::Run(), Channel::SetCorrectModes(), CSSeen::UpdateUser(), User(), UplinkSocket::Message::~Message(), Server::~Server(), UplinkSocket::~UplinkSocket(), and ~User().
| time_t User::signon |
Definition at line 75 of file users.h.
Referenced by MyXMLRPCEvent::DoUser(), Message::Whois::Run(), IRCDMessageNick::Run(), UnrealIRCdProto::SendLogin(), BahamutIRCdProto::SendLogin(), and User().
| bool User::super_admin |
Definition at line 79 of file users.h.
Referenced by ChannelInfo::AccessFor(), ChangeNick(), ChannelInfo::CheckKick(), CommandOSSet::DoSetSuperAdmin(), CommandNSLogout::Execute(), IsFounder(), and User().
| time_t User::timestamp |
Definition at line 77 of file users.h.
Referenced by ChangeNick(), MyXMLRPCEvent::DoUser(), CommandNSRegister::Execute(), IRCDMessageUID::Run(), IRCDMessageSVSMode::Run(), and User().
Anope::string User::uid [protected] |
Definition at line 42 of file users.h.
Referenced by BotInfo::BotInfo(), BotInfo::GenerateUID(), GetUID(), User(), BotInfo::~BotInfo(), and ~User().
Definition at line 63 of file users.h.
Referenced by MyXMLRPCEvent::DoUser(), CommandHSOn::Execute(), GetDisplayedHost(), NickCore::IsOnAccess(), SetDisplayedHost(), SetModesInternal(), and User().
Anope::string User::vident [protected] |
Definition at line 40 of file users.h.
Referenced by GetVIdent(), and SetVIdent().
1.7.1