* note: it is guaranteed that parv[0]..parv[parc-1] are all
* non-NULL pointers.
*/
-#if 0
-/*
- * No need to include handlers.h here the signatures must match
- * and we don't need to force a rebuild of all the handlers everytime
- * we add a new one to the list. --Bleep
- */
-#include "handlers.h"
-#endif /* 0 */
+#include "config.h"
+
#include "client.h"
#include "ircd.h"
#include "ircd_log.h"
#include "numnicks.h"
#include "send.h"
-#include <assert.h>
+/* #include <assert.h> -- Now using assert in ircd_log.h */
/*
* mo_restart - oper message handler
*/
int mo_restart(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
{
-#if defined(OPER_RESTART) || defined(LOCOP_RESTART)
-#ifndef LOCOP_RESTART
- if (!MyUser(sptr) || !IsOper(sptr))
-#else
-#ifdef OPER_RESTART
- if (!MyUser(sptr) || !IsAnOper(sptr))
-#else
- if (!MyUser(sptr) || !IsLocOp(sptr))
-#endif
-#endif
- {
- send_reply(sptr, ERR_NOPRIVILEGES);
- return 0;
- }
+ if (!HasPriv(sptr, PRIV_RESTART))
+ return send_reply(sptr, ERR_NOPRIVILEGES);
+
log_write(LS_SYSTEM, L_NOTICE, 0, "Server RESTART by %#C", sptr);
server_restart("received RESTART");
-#endif /* defined(OPER_RESTART) || defined(LOCOP_RESTART) */
- return 0;
-}
-
-
-#if 0
-#if defined(OPER_RESTART) || defined(LOCOP_RESTART)
-/*
- * m_restart
- */
-int m_restart(struct Client *cptr, struct Client *sptr, int parc,
- char *parv[])
-{
-#ifndef LOCOP_RESTART
- if (!MyUser(sptr) || !IsOper(sptr))
-#else
-#ifdef OPER_RESTART
- if (!MyUser(sptr) || !IsAnOper(sptr))
-#else
- if (!MyUser(sptr) || !IsLocOp(sptr))
-#endif
-#endif
- {
- sendto_one(sptr, err_str(ERR_NOPRIVILEGES), me.name, parv[0]); /* XXX DEAD */
- return 0;
- }
- ircd_log(L_NOTICE, "Server RESTART by %s\n", get_client_name(sptr, HIDE_IP)); /* XXX DEAD */
- server_restart("received RESTART");
return 0;
}
-#endif
-#endif /* 0 */