1
0
mirror of https://github.com/unrealircd/unrealircd.git synced 2026-07-04 00:03:13 +02:00
Files
unrealircd/src/modules/tsctl.c
T
Bram Matthys bf2c5110db IsPerson() -> IsUser(), MyClient() -> MyUser(), etc.
This so we have a few simple concepts:
Client: this can be a user, server, or something unknown yet
Then the type of clients:
User: this is a user, someone with a nick name.
Server: this is a server
Etc.
2019-09-11 17:43:17 +02:00

75 lines
1.9 KiB
C

/*
* Unreal Internet Relay Chat Daemon, src/modules/m_tsctl.c
* (C) 2000-2001 Carsten V. Munk and the UnrealIRCd Team
* Moved to modules by Fish (Justin Hammond)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 1, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include "unrealircd.h"
ModuleHeader MOD_HEADER(tsctl)
= {
"tsctl", /* Name of module */
"5.0", /* Version */
"command /tsctl", /* Short description of module */
"UnrealIRCd Team",
"unrealircd-5",
};
CMD_FUNC(m_tsctl);
MOD_INIT(tsctl)
{
CommandAdd(modinfo->handle, "TSCTL", m_tsctl, MAXPARA, M_USER|M_SERVER);
MARK_AS_OFFICIAL_MODULE(modinfo);
return MOD_SUCCESS;
}
MOD_LOAD(tsctl)
{
return MOD_SUCCESS;
}
MOD_UNLOAD(tsctl)
{
return MOD_SUCCESS;
}
CMD_FUNC(m_tsctl)
{
if (!ValidatePermissionsForPath("server:tsctl:view",sptr,NULL,NULL,NULL))
{
sendnumeric(sptr, ERR_NOPRIVILEGES);
return 0;
}
if (MyUser(sptr) && (!parv[1] || strcasecmp(parv[1], "alltime")))
{
sendnotice(sptr, "/TSCTL now shows the time on all servers. You can now longer MODIFY the time.");
parv[1] = "alltime";
}
if (parv[1] && !strcasecmp(parv[1], "alltime"))
{
sendnotice(sptr, "*** Server=%s TStime=%lld",
me.name, (long long)TStime());
sendto_server(cptr, 0, 0, NULL, ":%s TSCTL alltime", sptr->name);
return 0;
}
return 0;
}