* CMDDESC: Shows or modifies user access on a channel.
* CMDFUNC: csc_dochanlev
* CMDPROTO: int csc_dochanlev(void *source, int cargc, char **cargv);
+ * CMDHELP: Usage: chanlev <#channel> [<user> [<flag change>]]
+ * CMDHELP: where <user> is either nickname on the network or #accountname.
+ * CMDHELP: If only a channel name is supplied, list registered users on the channel.
+ * CMDHELP: If a user is also specified, shows that user's access on the channel.
+ * CMDHELP: If a change string is specified, the flags for that user are changed, provided
+ * CMDHELP: you have sufficient access on the channel to do so. This can be used to add or
+ * CMDHELP: remove users from the channel.
+ * CMDHELP: Valid flags are:
+ * CMDHELP: Access level flags - these control your overall privilege level on the channel:
+ * CMDHELP: +n OWNER Can add or remove masters and all other flags (except personal flags)
+ * CMDHELP: +m MASTER Can add or remove all access except master or owner
+ * CMDHELP: +o OP Can get ops on the channel
+ * CMDHELP: +v VOICE Can get voice on the channel
+ * CMDHELP: +k KNOWN Known on the channel - can get invites to the channel via INVITE
+ * CMDHELP: +q DEVOICE Not allowed to be voiced on the channel
+ * CMDHELP: +d DEOP Not allowed to be opped on the channel
+ * CMDHELP: +b BANNED Banned from the channel
+ * CMDHELP: Extra flags - these control specific behaviour on the channel:
+ * CMDHELP: +a AUTOOP Ops the user automatically when they join the channel (the user
+ * CMDHELP: must also hold +o in order to have this flag)
+ * CMDHELP: +g AUTOVOICE Voices the user automatically when they join the channel (the
+ * CMDHELP: user must also hold +v in order to have this flag)
+ * CMDHELP: +p PROTECT If the user has +o or +v, this makes sure they will always have
+ * CMDHELP: that status, they will be reopped/voiced if deopped/voiced
+ * CMDHELP: +t TOPIC Can use SETTOPIC to alter the topic on the channel
+ * CMDHELP: Personal flags - these control user personal preferences and can only be changed
+ * CMDHELP: by the user concerned. You need to be known on the channel (hold +k,
+ * CMDHELP: +v, +o, +m or +n) in order to set personal flags.
+ * CMDHELP: +w NOWELCOME Prevents the welcome message being sent when you join the channel.
+ * CMDHELP: +j AUTOINV Invites you to the channel automatically when you authenticate.
+ * CMDHELP: Note that channel owners (+n) can grant +n to channel masters but they must use
+ * CMDHELP: the the GIVEOWNER command for this.
+ * CMDHELP: Non-sensible combinations of flags are not allowed.
*/
#include "../chanserv.h"
flagmask = (QCUFLAG_OWNER | QCUFLAG_MASTER | QCUFLAG_OP | QCUFLAG_VOICE | QCUFLAG_AUTOVOICE |
QCUFLAG_AUTOOP | QCUFLAG_TOPIC | QCUFLAG_PROTECT | QCUFLAG_KNOWN);
- /* If user has +m or above, or helper access, show everything */
- if (cs_privcheck(QPRIV_VIEWFULLCHANLEV, sender) || CUHasMasterPriv(rcup)) {
+ /* masters and above can see everything except personal flags */
+ if (CUHasMasterPriv(rcup)) {
+ flagmask = QCUFLAG_ALL & ~QCUFLAGS_PERSONAL;
+ showtimes=1;
+ }
+
+ /* Staff access, show everything */
+ if (cs_privcheck(QPRIV_VIEWFULLCHANLEV, sender)) {
flagmask = QCUFLAG_ALL;
showtimes=1;
}
} else {
changemask=0;
- /* Everyone can change their own flags (except +dqb), and control personal flags */
+ /* Everyone can change their own flags (except +dqb), and control (and see) personal flags */
if (rcup==rcuplist) {
changemask = (rcup->flags | QCUFLAGS_PERSONAL) &
~(QCUFLAG_BANNED | QCUFLAG_DENY | QCUFLAG_QUIET);
chanservaddcommand("banlist", QCMD_AUTHED, 1, csc_dobanlist, "Displays all persistent bans on a channel.", "");
chanservaddcommand("bantimer", QCMD_AUTHED, 2, csc_dobantimer, "Shows or changes the time after which bans are removed.", "");
chanservaddcommand("chanflags", QCMD_AUTHED, 2, csc_dochanflags, "Shows or changes the flags on a channel.", "");
- chanservaddcommand("chanlev", QCMD_AUTHED, 3, csc_dochanlev, "Shows or modifies user access on a channel.", "");
+ chanservaddcommand("chanlev", QCMD_AUTHED, 3, csc_dochanlev, "Shows or modifies user access on a channel.", "Usage: chanlev <#channel> [<user> [<flag change>]]\n where <user> is either nickname on the network or #accountname.\nIf only a channel name is supplied, list registered users on the channel.\nIf a user is also specified, shows that user's access on the channel.\nIf a change string is specified, the flags for that user are changed, provided\nyou have sufficient access on the channel to do so. This can be used to add or\nremove users from the channel.\nValid flags are:\nAccess level flags - these control your overall privilege level on the channel:\n +n OWNER Can add or remove masters and all other flags (except personal flags)\n +m MASTER Can add or remove all access except master or owner\n +o OP Can get ops on the channel\n +v VOICE Can get voice on the channel\n +k KNOWN Known on the channel - can get invites to the channel via INVITE\n +q DEVOICE Not allowed to be voiced on the channel\n +d DEOP Not allowed to be opped on the channel\n +b BANNED Banned from the channel\nExtra flags - these control specific behaviour on the channel:\n +a AUTOOP Ops the user automatically when they join the channel (the user \n must also hold +o in order to have this flag)\n +g AUTOVOICE Voices the user automatically when they join the channel (the \n user must also hold +v in order to have this flag)\n +p PROTECT If the user has +o or +v, this makes sure they will always have\n that status, they will be reopped/voiced if deopped/voiced\n +t TOPIC Can use SETTOPIC to alter the topic on the channel\nPersonal flags - these control user personal preferences and can only be changed\n by the user concerned. You need to be known on the channel (hold +k, \n +v, +o, +m or +n) in order to set personal flags.\n +w NOWELCOME Prevents the welcome message being sent when you join the channel.\n +j AUTOINV Invites you to the channel automatically when you authenticate.\nNote that channel owners (+n) can grant +n to channel masters but they must use \nthe the GIVEOWNER command for this.\nNon-sensible combinations of flags are not allowed.\n");
chanservaddcommand("chanlevhistory", QCMD_HELPER, 2, csc_dochanlevhistory, "View user access changes on a channel.", "");
chanservaddcommand("chanmode", QCMD_AUTHED, 4, csc_dochanmode, "Shows which modes are forced or denied on a channel.", "");
chanservaddcommand("channelcomment", QCMD_OPER, 2, csc_dochannelcomment, "Shows or changes the staff comment for a channel.", "");