mirror of
https://github.com/unrealircd/unrealircd.git
synced 2026-07-10 02:23:12 +02:00
Merge branch 'unreal34' of github.com:unrealircd/unrealircd into unreal34
This commit is contained in:
@@ -86,7 +86,7 @@ DLLFUNC CMD_FUNC(m_addmotd)
|
||||
if (!MyConnect(sptr))
|
||||
return 0;
|
||||
|
||||
if (!(IsAdmin(sptr) || IsCoAdmin(sptr)))
|
||||
if (!IsAdmin(sptr) && !IsCoAdmin(sptr) && !OperClass_evaluateACLPath(sptr->user->operlogin,"add:motd",sptr,NULL,NULL,NULL))
|
||||
{
|
||||
sendto_one(sptr, err_str(ERR_NOPRIVILEGES), me.name, parv[0]);
|
||||
return 0;
|
||||
|
||||
@@ -86,7 +86,7 @@ DLLFUNC CMD_FUNC(m_addomotd)
|
||||
if (!MyConnect(sptr))
|
||||
return 0;
|
||||
|
||||
if (!(IsAdmin(sptr) || IsCoAdmin(sptr)))
|
||||
if (!IsAdmin(sptr) && !IsCoAdmin(sptr) && !OperClass_evaluateACLPath(sptr->user->operlogin,"add:omotd",sptr,NULL,NULL,NULL))
|
||||
{
|
||||
sendto_one(sptr, err_str(ERR_NOPRIVILEGES), me.name, parv[0]);
|
||||
return 0;
|
||||
|
||||
@@ -96,7 +96,7 @@ DLLFUNC int m_admins(aClient *cptr, aClient *sptr, int parc, char *parv[])
|
||||
return 0;
|
||||
}
|
||||
#ifdef ADMINCHAT
|
||||
if (MyClient(sptr) && !IsAdmin(sptr) && !IsCoAdmin(sptr))
|
||||
if (MyClient(sptr) && !IsAdmin(sptr) && !IsCoAdmin(sptr) && !OperClass_evaluateACLPath(sptr->user->operlogin,"chat:admin",sptr,NULL,NULL,NULL))
|
||||
#else
|
||||
if (MyClient(sptr))
|
||||
#endif
|
||||
|
||||
+22
-12
@@ -85,23 +85,25 @@ DLLFUNC CMD_FUNC(m_sajoin)
|
||||
char jbuf[BUFSIZE];
|
||||
int did_anything = 0;
|
||||
|
||||
if (!IsSAdmin(sptr) && !IsULine(sptr))
|
||||
if (parc < 3)
|
||||
{
|
||||
sendto_one(sptr, err_str(ERR_NEEDMOREPARAMS), me.name, parv[0], "SAJOIN");
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (!(acptr = find_person(parv[1], NULL)))
|
||||
{
|
||||
sendto_one(sptr, err_str(ERR_NOSUCHNICK), me.name, parv[0], parv[1]);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Is this user disallowed from operating on this victim at all? */
|
||||
if (!IsSAdmin(sptr) && !IsULine(sptr) && !OperClass_evaluateACLPath(sptr->user->operlogin,"sajoin",sptr,acptr,NULL,NULL))
|
||||
{
|
||||
sendto_one(sptr, err_str(ERR_NOPRIVILEGES), me.name, parv[0]);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (parc < 3)
|
||||
{
|
||||
sendto_one(sptr, err_str(ERR_NEEDMOREPARAMS), me.name, parv[0], "SAJOIN");
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (!(acptr = find_person(parv[1], NULL)))
|
||||
{
|
||||
sendto_one(sptr, err_str(ERR_NOSUCHNICK), me.name, parv[0], parv[1]);
|
||||
return 0;
|
||||
}
|
||||
if (MyClient(acptr))
|
||||
{
|
||||
char *name, *p = NULL;
|
||||
@@ -135,6 +137,14 @@ DLLFUNC CMD_FUNC(m_sajoin)
|
||||
}
|
||||
|
||||
chptr = get_channel(acptr, name, 0);
|
||||
|
||||
/* If this _specific_ channel is not permitted, skip it */
|
||||
if (!IsSAdmin(sptr) && !IsULine(sptr) && !OperClass_evaluateACLPath(sptr->user->operlogin,"sajoin",sptr,acptr,chptr,NULL))
|
||||
{
|
||||
sendto_one(sptr, err_str(ERR_NOPRIVILEGES), me.name, parv[0]);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!parted && chptr && (lp = find_membership_link(acptr->user->channel, chptr)))
|
||||
{
|
||||
sendto_one(sptr, err_str(ERR_USERONCHANNEL), me.name, parv[0],
|
||||
|
||||
+14
-13
@@ -82,24 +82,25 @@ DLLFUNC CMD_FUNC(m_samode)
|
||||
{
|
||||
aChannel *chptr;
|
||||
|
||||
if (!IsPrivileged(cptr) || !IsSAdmin(sptr))
|
||||
if (parc > 2)
|
||||
{
|
||||
chptr = find_channel(parv[1], NullChn);
|
||||
if (chptr == NullChn)
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
sendto_one(sptr, err_str(ERR_NEEDMOREPARAMS),
|
||||
me.name, parv[0], "SAMODE");
|
||||
return 0;
|
||||
}
|
||||
|
||||
if ((!IsPrivileged(cptr) || !IsSAdmin(sptr)) && !OperClass_evaluateACLPath(sptr->user->operlogin,"samode",sptr,NULL,chptr,NULL))
|
||||
{
|
||||
sendto_one(sptr, err_str(ERR_NOPRIVILEGES), me.name, parv[0]);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (parc > 2)
|
||||
{
|
||||
chptr = find_channel(parv[1], NullChn);
|
||||
if (chptr == NullChn)
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
sendto_one(sptr, err_str(ERR_NEEDMOREPARAMS),
|
||||
me.name, parv[0], "SAMODE");
|
||||
return 0;
|
||||
}
|
||||
opermode = 0;
|
||||
(void)do_mode(chptr, cptr, sptr, parc - 2, parv + 2, 0, 1);
|
||||
|
||||
|
||||
+22
-13
@@ -92,24 +92,25 @@ DLLFUNC CMD_FUNC(m_sapart)
|
||||
char commentx[512];
|
||||
char jbuf[BUFSIZE];
|
||||
|
||||
if (!IsSAdmin(sptr) && !IsULine(sptr))
|
||||
if (parc < 3)
|
||||
{
|
||||
sendto_one(sptr, err_str(ERR_NEEDMOREPARAMS), me.name, parv[0], "SAPART");
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (!(acptr = find_person(parv[1], NULL)))
|
||||
{
|
||||
sendto_one(sptr, err_str(ERR_NOSUCHNICK), me.name, parv[0], parv[1]);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* See if we can operate on this vicim/this command */
|
||||
if (!IsSAdmin(sptr) && !IsULine(sptr) && !OperClass_evaluateACLPath(sptr->user->operlogin,"sapart",sptr,acptr,NULL,NULL))
|
||||
{
|
||||
sendto_one(sptr, err_str(ERR_NOPRIVILEGES), me.name, parv[0]);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (parc < 3)
|
||||
{
|
||||
sendto_one(sptr, err_str(ERR_NEEDMOREPARAMS), me.name, parv[0], "SAPART");
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (!(acptr = find_person(parv[1], NULL)))
|
||||
{
|
||||
sendto_one(sptr, err_str(ERR_NOSUCHNICK), me.name, parv[0], parv[1]);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (MyClient(acptr))
|
||||
{
|
||||
/* Now works like m_join */
|
||||
@@ -124,6 +125,14 @@ DLLFUNC CMD_FUNC(m_sapart)
|
||||
name);
|
||||
continue;
|
||||
}
|
||||
|
||||
/* Validate oper can do this on chan/victim */
|
||||
if (!IsSAdmin(sptr) && !IsULine(sptr) && !OperClass_evaluateACLPath(sptr->user->operlogin,"sapart",sptr,acptr,chptr,NULL))
|
||||
{
|
||||
sendto_one(sptr, err_str(ERR_NOPRIVILEGES), me.name, parv[0]);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!(lp = find_membership_link(acptr->user->channel, chptr)))
|
||||
{
|
||||
sendto_one(sptr, err_str(ERR_USERNOTINCHANNEL), me.name, parv[0],
|
||||
|
||||
@@ -81,7 +81,7 @@ DLLFUNC int MOD_UNLOAD(m_sdesc)(int module_unload)
|
||||
|
||||
int m_sdesc(aClient *cptr, aClient *sptr, int parc, char *parv[])
|
||||
{
|
||||
if (!IsAdmin(sptr) && !IsCoAdmin(sptr))
|
||||
if (!IsAdmin(sptr) && !IsCoAdmin(sptr) && !OperClass_evaluateACLPath(sptr->user->operlogin,"add:description",sptr,NULL,NULL,NULL))
|
||||
{
|
||||
sendto_one(sptr, err_str(ERR_NOPRIVILEGES), me.name, sptr->name);
|
||||
return 0;
|
||||
|
||||
@@ -91,7 +91,7 @@ DLLFUNC int m_tsctl(aClient *cptr, aClient *sptr, int parc, char *parv[])
|
||||
|
||||
if (!MyClient(sptr))
|
||||
goto doit;
|
||||
if (!IsAdmin(sptr) && !IsCoAdmin(sptr))
|
||||
if (!IsAdmin(sptr) && !IsCoAdmin(sptr) && !OperClass_evaluateACLPath(sptr->user->operlogin,"tsctl",sptr,NULL,NULL,NULL))
|
||||
{
|
||||
sendto_one(sptr, err_str(ERR_NOPRIVILEGES), me.name, parv[0]);
|
||||
return 0;
|
||||
|
||||
@@ -87,7 +87,7 @@ DLLFUNC CMD_FUNC(m_wallops)
|
||||
me.name, parv[0], "WALLOPS");
|
||||
return 0;
|
||||
}
|
||||
if (MyClient(sptr) && !OPCanWallOps(sptr))
|
||||
if (MyClient(sptr) && !OPCanWallOps(sptr) && !OperClass_evaluateACLPath(sptr->user->operlogin,"chat:wallops",sptr,NULL,NULL,NULL))
|
||||
{
|
||||
sendto_one(sptr, err_str(ERR_NOPRIVILEGES), me.name, parv[0]);
|
||||
return 0;
|
||||
|
||||
Reference in New Issue
Block a user