ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/svn/ircd-hybrid/trunk/modules/m_admin.c
(Generate patch)

Comparing ircd-hybrid-8/modules/m_admin.c (file contents):
Revision 1178 by michael, Mon Aug 15 08:11:31 2011 UTC vs.
Revision 1230 by michael, Thu Sep 22 19:41:19 2011 UTC

# Line 37 | Line 37
37   #include "modules.h"
38   #include "irc_string.h"
39  
40 static void m_admin(struct Client *, struct Client *, int, char *[]);
41 static void mr_admin(struct Client *, struct Client *, int, char *[]);
42 static void ms_admin(struct Client *, struct Client *, int, char *[]);
43 static void do_admin(struct Client *);
40  
45 struct Message admin_msgtab = {
46  "ADMIN", 0, 0, 0, MAXPARA, MFLG_SLOW | MFLG_UNREG, 0,
47  {mr_admin, m_admin, ms_admin, m_ignore, ms_admin, m_ignore}
48 };
41  
42 < const char *_version = "$Revision$";
43 <
44 < void
45 < _modinit(void)
42 > /*! \brief Sends administrative information about this server.
43 > *
44 > * \param source_p Pointer to client to report to
45 > */
46 > static void
47 > do_admin(struct Client *source_p)
48   {
49 <  mod_add_cmd(&admin_msgtab);
50 < }
49 >  const char *me_name;
50 >  const char *nick;
51  
52 < void
53 < _moddeinit(void)
54 < {
55 <  mod_del_cmd(&admin_msgtab);
52 >  sendto_realops_flags(UMODE_SPY, L_ALL,
53 >                       "ADMIN requested by %s (%s@%s) [%s]",
54 >                       source_p->name, source_p->username,
55 >                       source_p->host, source_p->servptr->name);
56 >
57 >  me_name = ID_or_name(&me, source_p->from);
58 >  nick = ID_or_name(source_p, source_p->from);
59 >
60 >  sendto_one(source_p, form_str(RPL_ADMINME),
61 >             me_name, nick, me.name);
62 >  if (AdminInfo.name != NULL)
63 >    sendto_one(source_p, form_str(RPL_ADMINLOC1),
64 >               me_name, nick, AdminInfo.name);
65 >  if (AdminInfo.description != NULL)
66 >    sendto_one(source_p, form_str(RPL_ADMINLOC2),
67 >               me_name, nick, AdminInfo.description);
68 >  if (AdminInfo.email != NULL)
69 >    sendto_one(source_p, form_str(RPL_ADMINEMAIL),
70 >               me_name, nick, AdminInfo.email);
71   }
72  
73   /*! \brief ADMIN command handler (called by unregistered,
# Line 157 | Line 166 | ms_admin(struct Client *client_p, struct
166      do_admin(source_p);
167   }
168  
169 < /*! \brief Sends administrative information about this server.
170 < *
171 < * \param source_p Pointer to client to report to
172 < */
169 > static struct Message admin_msgtab = {
170 >  "ADMIN", 0, 0, 0, MAXPARA, MFLG_SLOW | MFLG_UNREG, 0,
171 >  {mr_admin, m_admin, ms_admin, m_ignore, ms_admin, m_ignore}
172 > };
173 >
174   static void
175 < do_admin(struct Client *source_p)
175 > module_init(void)
176   {
177 <  const char *me_name;
178 <  const char *nick;
169 <
170 <  sendto_realops_flags(UMODE_SPY, L_ALL,
171 <                       "ADMIN requested by %s (%s@%s) [%s]",
172 <                       source_p->name, source_p->username,
173 <                       source_p->host, source_p->servptr->name);
174 <
175 <  me_name = ID_or_name(&me, source_p->from);
176 <  nick = ID_or_name(source_p, source_p->from);
177 >  mod_add_cmd(&admin_msgtab);
178 > }
179  
180 <  sendto_one(source_p, form_str(RPL_ADMINME),
181 <             me_name, nick, me.name);
182 <  if (AdminInfo.name != NULL)
183 <    sendto_one(source_p, form_str(RPL_ADMINLOC1),
182 <               me_name, nick, AdminInfo.name);
183 <  if (AdminInfo.description != NULL)
184 <    sendto_one(source_p, form_str(RPL_ADMINLOC2),
185 <               me_name, nick, AdminInfo.description);
186 <  if (AdminInfo.email != NULL)
187 <    sendto_one(source_p, form_str(RPL_ADMINEMAIL),
188 <               me_name, nick, AdminInfo.email);
180 > static void
181 > module_exit(void)
182 > {
183 >  mod_del_cmd(&admin_msgtab);
184   }
185 +
186 + struct module module_entry = {
187 +  .node    = { NULL, NULL, NULL },
188 +  .name    = NULL,
189 +  .version = "$Revision$",
190 +  .handle  = NULL,
191 +  .modinit = module_init,
192 +  .modexit = module_exit,
193 +  .flags   = 0
194 + };

Diff Legend

Removed lines
+ Added lines
< Changed lines (old)
> Changed lines (new)