1
0
mirror of https://github.com/unrealircd/unrealircd.git synced 2026-07-07 01:43:12 +02:00
This commit is contained in:
codemastr
2001-12-11 20:45:45 +00:00
parent eb4eb7a8c6
commit c2420f2eee
5 changed files with 17 additions and 37 deletions
+9 -15
View File
@@ -161,7 +161,7 @@ aCtab cFlagTab[] = {
#define BADOP_OVERRIDE 4
/* is some kind of admin */
#define IsSkoAdmin(sptr) (IsAdmin(sptr) || IsNetAdmin(sptr) || IsTechAdmin(sptr) || IsSAdmin(sptr))
#define IsSkoAdmin(sptr) (IsAdmin(sptr) || IsNetAdmin(sptr) || IsSAdmin(sptr))
char cmodestring[512];
@@ -1597,8 +1597,7 @@ int do_mode_char(aChannel *chptr, long modetype, char modechar, char *param, u_
case MODE_AUDITORIUM:
if (IsULine(cptr) || IsServer(cptr))
goto auditorium_ok;
if (!IsNetAdmin(cptr) && !IsTechAdmin(cptr)
&& !is_chanowner(cptr, chptr))
if (!IsNetAdmin(cptr) && !is_chanowner(cptr, chptr))
{
sendto_one(cptr,
":%s %s %s :*** Channel mode +u can only be set by the channel owner",
@@ -1690,8 +1689,7 @@ int do_mode_char(aChannel *chptr, long modetype, char modechar, char *param, u_
/* do pro-opping here (popping) */
case MODE_CHANOWNER:
if (!IsULine(cptr) && !IsServer(cptr)
&& !IsNetAdmin(cptr) && !IsTechAdmin(cptr)
&& !is_chanowner(cptr, chptr))
&& !IsNetAdmin(cptr) && !is_chanowner(cptr, chptr))
{
sendto_one(cptr, err_str(ERR_ONLYSERVERSCANCHANGE),
me.name, cptr->name, chptr->chname);
@@ -1699,8 +1697,7 @@ int do_mode_char(aChannel *chptr, long modetype, char modechar, char *param, u_
}
case MODE_CHANPROT:
if (!IsULine(cptr) && !IsServer(cptr)
&& !IsNetAdmin(cptr) && !IsTechAdmin(cptr)
&& !is_chanowner(cptr, chptr))
&& !IsNetAdmin(cptr) && !is_chanowner(cptr, chptr))
{
sendto_one(cptr,
":%s %s %s :*** Protected users can only be set by the channel owner.",
@@ -1932,8 +1929,7 @@ int do_mode_char(aChannel *chptr, long modetype, char modechar, char *param, u_
goto linkok;
}
if (!IsNetAdmin(cptr) && !IsTechAdmin(cptr)
&& !is_chanowner(cptr, chptr))
if (!IsNetAdmin(cptr) && !is_chanowner(cptr, chptr))
{
sendto_one(cptr,
":%s %s %s :*** Channel mode +L can only be set by the channel owner",
@@ -2369,7 +2365,7 @@ static int can_join(aClient *cptr, aClient *sptr, aChannel *chptr, char *key, ch
}
break;
case 3:
if (IsNetAdmin(sptr) || IsTechAdmin(sptr))
if (IsNetAdmin(sptr))
return 0;
break;
default:
@@ -3434,8 +3430,7 @@ int m_kick(aClient *cptr, aClient *sptr, int parc, char *parv[])
if (is_chanprot(who, chptr)
|| is_chanowner(who, chptr)
|| IsServices(who))
if (IsNetAdmin
(sptr) || IsTechAdmin(sptr))
if (IsNetAdmin(sptr))
{ /* IRCop kicking owner/prot */
sendto_snomask(SNO_EYES,
"*** OperKick [%s @ %s -> %s (%s)]",
@@ -3467,8 +3462,7 @@ int m_kick(aClient *cptr, aClient *sptr, int parc, char *parv[])
if (IsKix(who) && !IsULine(sptr))
{
if (!(IsNetAdmin(sptr)
|| IsTechAdmin(sptr)))
if (!IsNetAdmin(sptr))
{
sendto_one(sptr,
":%s %s %s :*** Cannot kick %s from channel %s (usermode +q)",
@@ -4349,7 +4343,7 @@ int m_names(aClient *cptr, aClient *sptr, int parc, char *parv[])
acptr = cm->cptr;
if (IsInvisible(acptr) && !member)
continue;
if (IsHiding(acptr) && acptr != sptr && !(IsNetAdmin(sptr) || IsTechAdmin(sptr)))
if (IsHiding(acptr) && acptr != sptr && !IsNetAdmin(sptr))
continue;
if (chptr->mode.mode & MODE_AUDITORIUM)
if (!is_chan_op(sptr, chptr)
+3 -3
View File
@@ -3356,7 +3356,7 @@ int m_rehash(cptr, sptr, parc, parv)
sendto_one(sptr, err_str(ERR_NOPRIVILEGES), me.name, parv[0]);
return 0;
}
if (!MyClient(sptr) && !IsTechAdmin(sptr) && !IsNetAdmin(sptr)
if (!MyClient(sptr) && !IsNetAdmin(sptr)
&& !IsULine(sptr))
{
sendto_one(sptr, err_str(ERR_NOPRIVILEGES), me.name, parv[0]);
@@ -3545,7 +3545,7 @@ int m_restart(cptr, sptr, parc, parv)
sendto_one(sptr, err_str(ERR_NOPRIVILEGES), me.name, parv[0]);
return 0;
}
if (!MyClient(sptr) && !(IsTechAdmin(sptr) || IsNetAdmin(sptr))
if (!MyClient(sptr) && !IsNetAdmin(sptr)
&& !IsULine(sptr))
{
sendto_one(sptr, err_str(ERR_NOPRIVILEGES), me.name, parv[0]);
@@ -3554,7 +3554,7 @@ int m_restart(cptr, sptr, parc, parv)
if (parc > 3)
{
/* Remote restart. */
if (MyClient(sptr) && !(IsNetAdmin(sptr) || IsTechAdmin(sptr)))
if (MyClient(sptr) && !IsNetAdmin(sptr))
{
sendto_one(sptr, err_str(ERR_NOPRIVILEGES), me.name,
parv[0]);
+1 -12
View File
@@ -2193,8 +2193,6 @@ int m_umode(aClient *cptr, aClient *sptr, int parc, char *parv[])
ClearHideOper(sptr);
if (IsCoAdmin(sptr))
ClearCoAdmin(sptr);
if (IsTechAdmin(sptr))
ClearTechAdmin(sptr);
if (sptr->user->snomask & SNO_CLIENT)
sptr->user->snomask &= ~SNO_CLIENT;
if (sptr->user->snomask & SNO_FCLIENT)
@@ -2223,10 +2221,6 @@ int m_umode(aClient *cptr, aClient *sptr, int parc, char *parv[])
*/
if (MyClient(sptr)) {
if (IsAnOper(sptr)) {
if (IsClientF(sptr) && !OPCanUModeC(sptr))
ClearClientF(sptr);
if (IsFloodF(sptr) && !OPCanUModeF(sptr))
ClearFloodF(sptr);
if (IsAdmin(sptr) && !OPIsAdmin(sptr))
ClearAdmin(sptr);
if (IsSAdmin(sptr) && !OPIsSAdmin(sptr))
@@ -2235,23 +2229,18 @@ int m_umode(aClient *cptr, aClient *sptr, int parc, char *parv[])
ClearNetAdmin(sptr);
if (IsCoAdmin(sptr) && !OPIsCoAdmin(sptr))
ClearCoAdmin(sptr);
if (IsTechAdmin(sptr) && !OPIsTechAdmin(sptr))
ClearTechAdmin(sptr);
if ((sptr->umodes & UMODE_HIDING)
&& !(sptr->user->oflag & OFLAG_INVISIBLE))
sptr->umodes &= ~UMODE_HIDING;
if (MyClient(sptr) && (sptr->umodes & UMODE_SECURE)
&& !IsSecure(sptr))
sptr->umodes &= ~UMODE_SECURE;
if (IsTechAdmin(sptr) && IsNetAdmin(sptr))
ClearTechAdmin(sptr);
}
/*
This is to remooove the kix bug.. and to protect some stuffie
-techie
*/
if ((sptr->umodes & (UMODE_KIX)) && !(IsNetAdmin(sptr)
|| IsTechAdmin(sptr)))
if ((sptr->umodes & (UMODE_KIX)) && !IsNetAdmin(sptr))
sptr->umodes &= ~UMODE_KIX;
if ((sptr->umodes & UMODE_HIDING) && !IsAnOper(sptr))
+3 -3
View File
@@ -1785,7 +1785,7 @@ void sendto_channels_inviso_join(aClient *user)
for (users = channels->chptr->members; users; users = users->next)
{
cptr = users->cptr;
if (!MyConnect(cptr) || IsTechAdmin(cptr) || IsNetAdmin(cptr) || sentalong[cptr->fd] || cptr == user)
if (!MyConnect(cptr) || IsNetAdmin(cptr) || sentalong[cptr->fd] || cptr == user)
continue;
sentalong[cptr->fd]++;
sendto_one(cptr, ":%s!%s@%s JOIN :%s", user->name, user->user->username,
@@ -1808,7 +1808,7 @@ void sendto_channels_inviso_part(aClient *user)
for (users = channels->chptr->members; users; users = users->next)
{
cptr = users->cptr;
if (!MyConnect(cptr) || IsTechAdmin(cptr) || IsNetAdmin(cptr) || sentalong[cptr->fd] || cptr == user)
if (!MyConnect(cptr) || IsNetAdmin(cptr) || sentalong[cptr->fd] || cptr == user)
continue;
sentalong[cptr->fd]++;
sendto_one(cptr, ":%s!%s@%s PART :%s", user->name, user->user->username, (IsHidden(user) ? user->user->virthost : user->user->realhost), channels->chptr->chname);
@@ -1828,7 +1828,7 @@ void sendto_channel_ntadmins(aClient *from, aChannel *chptr, char *pattern, ...)
for (lp = chptr->members; lp; lp = lp->next)
{
acptr = lp->cptr;
if (acptr->from == from || !(IsNetAdmin(acptr) || IsTechAdmin(acptr)) || (IsDeaf(acptr) && !(sendanyways == 1)))
if (acptr->from == from || !IsNetAdmin(acptr) || (IsDeaf(acptr) && !(sendanyways == 1)))
continue;
if (MyConnect(acptr)) /* (It is always a client) */
vsendto_prefix_one(acptr, from, pattern, vl);
+1 -4
View File
@@ -301,7 +301,7 @@ int w_whois(aClient *cptr, aClient *sptr, int parc, char *parv[])
}
if (buf[0] != '\0' && !IsULine(acptr) && (!IsHiding(acptr) ||
IsNetAdmin(sptr) || IsTechAdmin(sptr) || sptr == acptr))
IsNetAdmin(sptr) || sptr == acptr))
sendto_one(sptr,
":IRC PRIVMSG %s :%s is on %s",
sptr->name, name, buf);
@@ -322,9 +322,6 @@ int w_whois(aClient *cptr, aClient *sptr, int parc, char *parv[])
buf[0] = '\0';
if (IsNetAdmin(acptr))
strcat(buf, "a Network Administrator");
else if (IsTechAdmin(acptr))
strcat(buf,
"a Technical Administrator");
else if (IsSAdmin(acptr))
strcat(buf, "a Services Operator");
else if (IsAdmin(acptr) && !IsCoAdmin(acptr))