added basic ssl support to ircu
[ircu2.10.12-pk.git] / ircd / m_restart.c
index 290dc9892de1eb705e37a6af932aa1b4d6aff34c..08246db0b32fd07e6fd4ed012b6fdd286eb2255d 100644 (file)
  *            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
-  {
-    sendto_one(sptr, err_str(ERR_NOPRIVILEGES), me.name, parv[0]);
-    return 0;
-  }
-  ircd_log(L_NOTICE, "Server RESTART by %s\n", get_client_name(sptr, HIDE_IP));
-  server_restart("received RESTART");
-
-#endif /* defined(OPER_RESTART) || defined(LOCOP_RESTART) */
-  return 0;
-}
-
+  if (!HasPriv(sptr, PRIV_RESTART))
+    return send_reply(sptr, ERR_NOPRIVILEGES);
 
-#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]);
-    return 0;
-  }
-  ircd_log(L_NOTICE, "Server RESTART by %s\n", get_client_name(sptr, HIDE_IP));
+  log_write(LS_SYSTEM, L_NOTICE, 0, "Server RESTART by %#C", sptr);
   server_restart("received RESTART");
+
   return 0;
 }
-#endif
-#endif /* 0 */