2
* Copyright (C) 2004-2011 See the AUTHORS file for details.
4
* This program is free software; you can redistribute it and/or modify it
5
* under the terms of the GNU General Public License version 2 as published
6
* by the Free Software Foundation.
12
class CNotifyConnectMod : public CGlobalModule {
14
GLOBALMODCONSTRUCTOR(CNotifyConnectMod) {}
16
virtual void OnClientLogin() {
17
SendAdmins(m_pUser->GetUserName() + " attached (from " + m_pClient->GetRemoteIP() + ")");
20
virtual void OnClientDisconnect() {
21
SendAdmins(m_pUser->GetUserName() + " detached (gone: " + m_pClient->GetRemoteIP() + ")");
25
void SendAdmins(const CString &msg) {
26
CZNC::Get().Broadcast(msg, true, NULL, GetClient());
30
GLOBALMODULEDEFS(CNotifyConnectMod, "Notifies all admin users when a client connects or disconnects.")