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/trunk/modules/m_admin.c (file contents):
Revision 1834 by michael, Fri Apr 19 19:50:27 2013 UTC vs.
Revision 2888 by michael, Tue Jan 21 17:47:11 2014 UTC

# Line 1 | Line 1
1   /*
2 < *  ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd).
2 > *  ircd-hybrid: an advanced, lightweight Internet Relay Chat Daemon (ircd)
3   *
4 < *  Copyright (C) 2002 by the past and present ircd coders, and others.
4 > *  Copyright (c) 1997-2014 ircd-hybrid development team
5   *
6   *  This program is free software; you can redistribute it and/or modify
7   *  it under the terms of the GNU General Public License as published by
# Line 41 | Line 41
41   *
42   * \param source_p Pointer to client to report to
43   */
44 < static void
44 > static int
45   do_admin(struct Client *source_p)
46   {
47 <  const char *me_name = ID_or_name(&me, source_p->from);
48 <  const char *nick = ID_or_name(source_p, source_p->from);
47 >  const char *me_name = ID_or_name(&me, source_p);
48 >  const char *nick = ID_or_name(source_p, source_p);
49  
50    sendto_realops_flags(UMODE_SPY, L_ALL, SEND_NOTICE,
51                         "ADMIN requested by %s (%s@%s) [%s]",
# Line 64 | Line 64 | do_admin(struct Client *source_p)
64    if (AdminInfo.email != NULL)
65      sendto_one(source_p, form_str(RPL_ADMINEMAIL),
66                 me_name, nick, AdminInfo.email);
67 +  return 0;
68   }
69  
70   /*! \brief NICK command handler (called by already registered,
# Line 80 | Line 81 | do_admin(struct Client *source_p)
81   *      - parv[0] = sender prefix
82   *      - parv[1] = nickname/servername
83   */
84 < static void
84 > static int
85   m_admin(struct Client *client_p, struct Client *source_p,
86          int parc, char *parv[])
87   {
# Line 90 | Line 91 | m_admin(struct Client *client_p, struct
91    {
92      sendto_one(source_p,form_str(RPL_LOAD2HI),
93                 me.name, source_p->name);
94 <    return;
94 >    return 0;
95    }
96  
97    last_used = CurrentTime;
98  
99 <  if (!ConfigFileEntry.disable_remote)
99 >  if (!ConfigServerHide.disable_remote_commands)
100      if (hunt_server(client_p, source_p, ":%s ADMIN :%s", 1,
101                      parc, parv) != HUNTED_ISME)
102 <      return;
102 >      return 0;
103  
104 <  do_admin(source_p);
104 >  return do_admin(source_p);
105   }
106  
107   /*! \brief ADMIN command handler (called by operators and
# Line 117 | Line 118 | m_admin(struct Client *client_p, struct
118   *      - parv[0] = sender prefix
119   *      - parv[1] = nickname/servername
120   */
121 < static void
121 > static int
122   ms_admin(struct Client *client_p, struct Client *source_p,
123           int parc, char *parv[])
124   {
125    if (hunt_server(client_p, source_p, ":%s ADMIN :%s", 1,
126                    parc, parv) != HUNTED_ISME)
127 <    return;
127 >    return 0;
128  
129 <  if (IsClient(source_p))
129 <    do_admin(source_p);
129 >  return do_admin(source_p);
130   }
131  
132 < static struct Message admin_msgtab = {
132 > static struct Message admin_msgtab =
133 > {
134    "ADMIN", 0, 0, 0, MAXPARA, MFLG_SLOW, 0,
135    { m_unregistered, m_admin, ms_admin, m_ignore, ms_admin, m_ignore }
136   };
# Line 146 | Line 147 | module_exit(void)
147    mod_del_cmd(&admin_msgtab);
148   }
149  
150 < struct module module_entry = {
150 > struct module module_entry =
151 > {
152    .node    = { NULL, NULL, NULL },
153    .name    = NULL,
154    .version = "$Revision$",

Diff Legend

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