1
0
mirror of https://github.com/anope/anope.git synced 2026-07-08 14:23:14 +02:00

Added a command:permission setting

This commit is contained in:
Adam
2011-08-04 21:59:01 -04:00
parent 773a1f3075
commit 9ec18a3b02
82 changed files with 329 additions and 297 deletions
+79 -77
View File
@@ -5,6 +5,8 @@
* In Anope modules can provide (multiple) commands, each of which has a unique command name. Once these modules
* are loaded you can then configure the commands to be added to any client you like with any name you like.
*
* Additionally, you may provide a permission name that must be in the opertype of users executing the command.
*
* Sane defaults are below.
*/
@@ -62,7 +64,7 @@ module { name = "cs_kick" }
command { service = "ChanServ"; name = "KICK"; command = "chanserv/kick"; }
command { service = "ChanServ"; name = "K"; command = "chanserv/kick"; }
module { name = "cs_list" }
command { service = "ChanServ"; name = "LIST"; command = "chanserv/list"; }
command { service = "ChanServ"; name = "LIST"; command = "chanserv/list"; permission = "chanserv/list"; }
module { name = "cs_mode" }
command { service = "ChanServ"; name = "MODE"; command = "chanserv/mode"; }
module { name = "cs_modes" }
@@ -81,59 +83,59 @@ command { service = "ChanServ"; name = "REGISTER"; command = "chanserv/register"
module { name = "cs_set" }
command { service = "ChanServ"; name = "SET"; command = "chanserv/set"; }
module { name = "cs_saset" }
command { service = "ChanServ"; name = "SASET"; command = "chanserv/saset"; }
command { service = "ChanServ"; name = "SASET"; command = "chanserv/saset"; permission = "chanserv/saset"; }
module { name = "cs_set_bantype" }
command { service = "ChanServ"; name = "SET BANTYPE"; command = "chanserv/set/bantype"; }
command { service = "ChanServ"; name = "SASET BANTYPE"; command = "chanserv/saset/bantype"; }
command { service = "ChanServ"; name = "SASET BANTYPE"; command = "chanserv/saset/bantype"; permission = "chanserv/saset/bantype"; }
module { name = "cs_set_description" }
command { service = "ChanServ"; name = "SET DESCRIPTION"; command = "chanserv/set/description"; }
command { service = "ChanServ"; name = "SET DESC"; command = "chanserv/set/description"; }
command { service = "ChanServ"; name = "SASET DESCRIPTION"; command = "chanserv/saset/description"; }
command { service = "ChanServ"; name = "SASET DESC"; command = "chanserv/saset/description"; }
command { service = "ChanServ"; name = "SASET DESCRIPTION"; command = "chanserv/saset/description"; permission = "chanserv/saset/description"; }
command { service = "ChanServ"; name = "SASET DESC"; command = "chanserv/saset/description"; permission = "chanserv/saset/desc"; }
module { name = "cs_set_founder" }
command { service = "ChanServ"; name = "SET FOUNDER"; command = "chanserv/set/founder"; }
command { service = "ChanServ"; name = "SASET FOUNDER"; command = "chanserv/saset/founder"; }
command { service = "ChanServ"; name = "SASET FOUNDER"; command = "chanserv/saset/founder"; permission = "chanserv/saset/founder"; }
module { name = "cs_set_keeptopic" }
command { service = "ChanServ"; name = "SET KEEPTOPIC"; command = "chanserv/set/keeptopic"; }
command { service = "ChanServ"; name = "SASET KEEPTOPIC"; command = "chanserv/saset/keeptopic"; }
command { service = "ChanServ"; name = "SASET KEEPTOPIC"; command = "chanserv/saset/keeptopic"; permission = "chanserv/saset/keeptopic"; }
module { name = "cs_set_opnotice" }
command { service = "ChanServ"; name = "SET OPNOTICE"; command = "chanserv/set/opnotice"; }
command { service = "ChanServ"; name = "SASET OPNOTICE"; command = "chanserv/saset/opnotice"; }
command { service = "ChanServ"; name = "SASET OPNOTICE"; command = "chanserv/saset/opnotice"; permission = "chanserv/saset/optnotice"; }
module { name = "cs_set_peace" }
command { service = "ChanServ"; name = "SET PEACE"; command = "chanserv/set/peace"; }
command { service = "ChanServ"; name = "SASET PEACE"; command = "chanserv/saset/peace"; }
command { service = "ChanServ"; name = "SASET PEACE"; command = "chanserv/saset/peace"; permission = "chanserv/saset/peace"; }
module { name = "cs_set_persist" }
command { service = "ChanServ"; name = "SET PERSIST"; command = "chanserv/set/persist"; }
command { service = "ChanServ"; name = "SASET PERSIST"; command = "chanserv/saset/persist"; }
command { service = "ChanServ"; name = "SASET PERSIST"; command = "chanserv/saset/persist"; permission = "chanserv/saset/persist"; }
module { name = "cs_set_private" }
command { service = "ChanServ"; name = "SET PRIVATE"; command = "chanserv/set/private"; }
command { service = "ChanServ"; name = "SASET PRIVATE"; command = "chanserv/saset/private"; }
command { service = "ChanServ"; name = "SASET PRIVATE"; command = "chanserv/saset/private"; permission = "chanserv/saset/private"; }
module { name = "cs_set_restricted" }
command { service = "ChanServ"; name = "SET RESTRICTED"; command = "chanserv/set/restricted"; }
command { service = "ChanServ"; name = "SASET RESTRICTED"; command = "chanserv/saset/restricted"; }
command { service = "ChanServ"; name = "SASET RESTRICTED"; command = "chanserv/saset/restricted"; permission = "chanserv/saset/restricted"; }
module { name = "cs_set_secure" }
command { service = "ChanServ"; name = "SET SECURE"; command = "chanserv/set/secure"; }
command { service = "ChanServ"; name = "SASET SECURE"; command = "chanserv/saset/secure"; }
command { service = "ChanServ"; name = "SASET SECURE"; command = "chanserv/saset/secure"; permission = "chanserv/saset/secure"; }
module { name = "cs_set_securefounder" }
command { service = "ChanServ"; name = "SET SECUREFOUNDER"; command = "chanserv/set/securefounder"; }
command { service = "ChanServ"; name = "SASET SECUREFOUNDER"; command = "chanserv/saset/securefounder"; }
command { service = "ChanServ"; name = "SASET SECUREFOUNDER"; command = "chanserv/saset/securefounder"; permission = "chanserv/saset/securefounder"; }
module { name = "cs_set_secureops" }
command { service = "ChanServ"; name = "SET SECUREOPS"; command = "chanserv/set/secureops"; }
command { service = "ChanServ"; name = "SASET SECUREOPS"; command = "chanserv/saset/secureops"; }
command { service = "ChanServ"; name = "SASET SECUREOPS"; command = "chanserv/saset/secureops"; permission = "chanserv/saset/secureops"; }
module { name = "cs_set_signkick" }
command { service = "ChanServ"; name = "SET SIGNKICK"; command = "chanserv/set/signkick"; }
command { service = "ChanServ"; name = "SASET SIGNKICK"; command = "chanserv/saset/signkick"; }
command { service = "ChanServ"; name = "SASET SIGNKICK"; command = "chanserv/saset/signkick"; permission = "chanserv/saset/signkick"; }
module { name = "cs_set_successor" }
command { service = "ChanServ"; name = "SET SUCCESSOR"; command = "chanserv/set/successor"; }
command { service = "ChanServ"; name = "SASET SUCCESSOR"; command = "chanserv/saset/successor"; }
command { service = "ChanServ"; name = "SASET SUCCESSOR"; command = "chanserv/saset/successor"; permission = "chanserv/saset/successor"; }
module { name = "cs_set_topiclock" }
command { service = "ChanServ"; name = "SET TOPICLOCK"; command = "chanserv/set/topiclock"; }
command { service = "ChanServ"; name = "SASET TOPICLOCK"; command = "chanserv/saset/topiclock"; }
command { service = "ChanServ"; name = "SASET TOPICLOCK"; command = "chanserv/saset/topiclock"; permission = "chanserv/saset/topiclock"; }
module { name = "cs_saset_noexpire" }
command { service = "ChanServ"; name = "SASET NOEXPIRE"; command = "chanserv/saset/noexpire"; }
command { service = "ChanServ"; name = "SASET NOEXPIRE"; command = "chanserv/saset/noexpire"; permission = "chanserv/saset/noexpire"; }
module { name = "cs_suspend" }
command { service = "ChanServ"; name = "SUSPEND"; command = "chanserv/suspend"; }
command { service = "ChanServ"; name = "UNSUSPEND"; command = "chanserv/unsuspend"; }
command { service = "ChanServ"; name = "SUSPEND"; command = "chanserv/suspend"; permission = "chanserv/suspend"; }
command { service = "ChanServ"; name = "UNSUSPEND"; command = "chanserv/unsuspend"; permission = "chanserv/suspend"; }
module { name = "cs_topic" }
command { service = "ChanServ"; name = "TOPIC"; command = "chanserv/topic"; }
module { name = "cs_unban" }
@@ -146,22 +148,22 @@ command { service = "ChanServ"; name = "HOP"; command = "chanserv/hop"; }
command { service = "ChanServ"; name = "VOP"; command = "chanserv/vop"; }
module { name = "gl_global" }
command { service = "Global"; name = "GLOBAL"; command = "global/global"; }
command { service = "Global"; name = "GLOBAL"; command = "global/global"; permission = "global/global"; }
module { name = "hs_del" }
command { service = "HostServ"; name = "DEL"; command = "hostserv/del"; }
command { service = "HostServ"; name = "DELALL"; command = "hostserv/delall"; }
command { service = "HostServ"; name = "DEL"; command = "hostserv/del"; permission = "hostserv/del"; }
command { service = "HostServ"; name = "DELALL"; command = "hostserv/delall"; permission = "hostserv/del"; }
module { name = "hs_group" }
command { service = "HostServ"; name = "GROUP"; command = "hostserv/group"; }
module { name = "hs_list" }
command { service = "HostServ"; name = "LIST"; command = "hostserv/list"; }
command { service = "HostServ"; name = "LIST"; command = "hostserv/list"; permission = "hostserv/list"; }
module { name = "hs_off" }
command { service = "HostServ"; name = "OFF"; command = "hostserv/off"; }
module { name = "hs_on" }
command { service = "HostServ"; name = "ON"; command = "hostserv/on"; }
module { name = "hs_set" }
command { service = "HostServ"; name = "SET"; command = "hostserv/set"; }
command { service = "HostServ"; name = "SETALL"; command = "hostserv/setall"; }
command { service = "HostServ"; name = "SET"; command = "hostserv/set"; permission = "hostserv/set"; }
command { service = "HostServ"; name = "SETALL"; command = "hostserv/setall"; permission = "hostserv/set"; }
module { name = "ms_cancel" }
command { service = "MemoServ"; name = "CANCEL"; command = "memoserv/cancel"; }
@@ -182,11 +184,11 @@ command { service = "MemoServ"; name = "RSEND"; command = "memoserv/rsend"; }
module { name = "ms_send" }
command { service = "MemoServ"; name = "SEND"; command = "memoserv/send"; }
module { name = "ms_sendall" }
command { service = "MemoServ"; name = "SENDALL"; command = "memoserv/sendall"; }
command { service = "MemoServ"; name = "SENDALL"; command = "memoserv/sendall"; permission = "memoserv/sendall"; }
module { name = "ms_set" }
command { service = "MemoServ"; name = "SET"; command = "memoserv/set"; }
module { name = "ms_staff" }
command { service = "MemoServ"; name = "STAFF"; command = "memoserv/staff"; }
command { service = "MemoServ"; name = "STAFF"; command = "memoserv/staff"; permission = "memoserv/staff"; }
module { name = "ns_access" }
command { service = "NickServ"; name = "ACCESS"; command = "nickserv/access"; }
@@ -199,9 +201,9 @@ command { service = "NickServ"; name = "CERT"; command = "nickserv/cert"; }
module { name = "ns_drop" }
command { service = "NickServ"; name = "DROP"; command = "nickserv/drop"; }
module { name = "ns_getemail" }
command { service = "NickServ"; name = "GETEMAIL"; command = "nickserv/getemail"; }
command { service = "NickServ"; name = "GETEMAIL"; command = "nickserv/getemail"; permission = "nickserv/getemail"; }
module { name = "ns_getpass" }
command { service = "NickServ"; name = "GETPASS"; command = "nickserv/getpass"; }
command { service = "NickServ"; name = "GETPASS"; command = "nickserv/getpass"; permission = "nickserv/getpass"; }
module { name = "ns_ghost" }
command { service = "NickServ"; name = "GHOST"; command = "nickserv/ghost"; }
module { name = "ns_group" }
@@ -237,103 +239,103 @@ command { service = "NickServ"; name = "SET DISPLAY"; command = "nickserv/set/di
command { service = "NickServ"; name = "SET PASSWORD"; command = "nickserv/set/password"; }
module { name = "ns_set_autoop" }
command { service = "NickServ"; name = "SET AUTOOP"; command = "nickserv/set/autoop"; }
command { service = "NickServ"; name = "SASET AUTOOP"; command = "nickserv/saset/autoop"; }
command { service = "NickServ"; name = "SASET AUTOOP"; command = "nickserv/saset/autoop"; permission = "nickserv/saset/autoop"; }
module { name = "ns_set_email" }
command { service = "NickServ"; name = "SET EMAIL"; command = "nickserv/set/email"; }
command { service = "NickServ"; name = "SASET EMAIL"; command = "nickserv/saset/email"; }
command { service = "NickServ"; name = "SASET EMAIL"; command = "nickserv/saset/email"; permission = "nickserv/saset/email"; }
module { name = "ns_set_greet" }
command { service = "NickServ"; name = "SET GREET"; command = "nickserv/set/greet"; }
command { service = "NickServ"; name = "SASET GREET"; command = "nickserv/saset/greet"; }
command { service = "NickServ"; name = "SASET GREET"; command = "nickserv/saset/greet"; permission = "nickserv/saset/greet"; }
module { name = "ns_set_hide" }
command { service = "NickServ"; name = "SET HIDE"; command = "nickserv/set/hide"; }
command { service = "NickServ"; name = "SASET HIDE"; command = "nickserv/saset/hide"; }
command { service = "NickServ"; name = "SASET HIDE"; command = "nickserv/saset/hide"; permission = "nickserv/saset/hide"; }
module { name = "ns_set_kill" }
command { service = "NickServ"; name = "SET KILL"; command = "nickserv/set/kill"; }
command { service = "NickServ"; name = "SASET KILL"; command = "nickserv/saset/kill"; }
command { service = "NickServ"; name = "SASET KILL"; command = "nickserv/saset/kill"; permission = "nickserv/saset/kill"; }
module { name = "ns_set_language" }
command { service = "NickServ"; name = "SET LANGUAGE"; command = "nickserv/set/language"; }
command { service = "NickServ"; name = "SASET LANGUAGE"; command = "nickserv/saset/language"; }
command { service = "NickServ"; name = "SASET LANGUAGE"; command = "nickserv/saset/language"; permission = "nickserv/saset/language"; }
module { name = "ns_set_message" }
command { service = "NickServ"; name = "SET MESSAGE"; command = "nickserv/set/message"; }
command { service = "NickServ"; name = "SASET MESSAGE"; command = "nickserv/saset/message"; }
command { service = "NickServ"; name = "SASET MESSAGE"; command = "nickserv/saset/message"; permission = "nickserv/saset/message"; }
module { name = "ns_set_private" }
command { service = "NickServ"; name = "SET PRIVATE"; command = "nickserv/set/private"; }
command { service = "NickServ"; name = "SASET PRIVATE"; command = "nickserv/saset/private"; }
command { service = "NickServ"; name = "SASET PRIVATE"; command = "nickserv/saset/private"; permission = "nickserv/saset/private"; }
module { name = "ns_set_secure" }
command { service = "NickServ"; name = "SET SECURE"; command = "nickserv/set/secure"; }
command { service = "NickServ"; name = "SASET SECURE"; command = "nickserv/saset/secure"; }
command { service = "NickServ"; name = "SASET SECURE"; command = "nickserv/saset/secure"; permission = "nickserv/saset/secure"; }
module { name = "ns_saset_noexpire" }
command { service = "NickServ"; name = "SASET NOEXPIRE"; command = "nickserv/saset/noexpire"; }
command { service = "NickServ"; name = "SASET NOEXPIRE"; command = "nickserv/saset/noexpire"; permission = "nickserv/saset/noexpire" }
module { name = "ns_sendpass" }
command { service = "NickServ"; name = "SENDPASS"; command = "nickserv/sendpass"; }
command { service = "NickServ"; name = "SENDPASS"; command = "nickserv/sendpass"; permission = "nickserv/sendpass"; }
module { name = "ns_status" }
command { service = "NickServ"; name = "STATUS"; command = "nickserv/status"; }
module { name = "ns_suspend" }
command { service = "NickServ"; name = "SUSPEND"; command = "nickserv/suspend"; }
command { service = "NickServ"; name = "UNSUSPEND"; command = "nickserv/unsuspend"; }
command { service = "NickServ"; name = "SUSPEND"; command = "nickserv/suspend"; permission = "nickserv/suspend"; }
command { service = "NickServ"; name = "UNSUSPEND"; command = "nickserv/unsuspend"; permission = "nickserv/suspend"; }
module { name = "ns_update" }
command { service = "NickServ"; name = "UPDATE"; command = "nickserv/update"; }
module { name = "os_akill" }
command { service = "OperServ"; name = "AKILL"; command = "operserv/akill"; }
command { service = "OperServ"; name = "AKILL"; command = "operserv/akill"; permission = "operserv/akill"; }
module { name = "os_chankill" }
command { service = "OperServ"; name = "CHANKILL"; command = "operserv/chankill"; }
command { service = "OperServ"; name = "CHANKILL"; command = "operserv/chankill"; permission = "operserv/chankill"; }
module { name = "os_list" }
command { service = "OperServ"; name = "CHANLIST"; command = "operserv/chanlist"; }
command { service = "OperServ"; name = "USERLIST"; command = "operserv/userlist"; }
module { name = "os_config" }
command { service = "OperServ"; name = "CONFIG"; command = "operserv/config"; }
command { service = "OperServ"; name = "CONFIG"; command = "operserv/config"; permission = "operserv/config"; }
module { name = "os_forbid" }
command { service = "OperServ"; name = "FORBID"; command = "operserv/forbid"; }
command { service = "OperServ"; name = "FORBID"; command = "operserv/forbid"; permission = "operserv/forbid"; }
module { name = "os_ignore" }
command { service = "OperServ"; name = "IGNORE"; command = "operserv/ignore"; }
command { service = "OperServ"; name = "IGNORE"; command = "operserv/ignore"; permission = "operserv/ignore"; }
module { name = "os_jupe" }
command { service = "OperServ"; name = "JUPE"; command = "operserv/jupe"; }
command { service = "OperServ"; name = "JUPE"; command = "operserv/jupe"; permission = "operserv/jupe"; }
module { name = "os_kick" }
command { service = "OperServ"; name = "KICK"; command = "operserv/kick"; }
command { service = "OperServ"; name = "KICK"; command = "operserv/kick"; permission = "operserv/kick"; }
module { name = "os_kill" }
command { service = "OperServ"; name = "KILL"; command = "operserv/kill"; }
command { service = "OperServ"; name = "KILL"; command = "operserv/kill"; permission = "operserv/kill"; }
module { name = "os_login" }
command { service = "OperServ"; name = "LOGIN"; command = "operserv/login"; }
module { name = "os_mode" }
command { service = "OperServ"; name = "MODE"; command = "operserv/mode"; }
command { service = "OperServ"; name = "UMODE"; command = "operserv/umode"; }
command { service = "OperServ"; name = "MODE"; command = "operserv/mode"; permission = "operserv/mode"; }
command { service = "OperServ"; name = "UMODE"; command = "operserv/umode"; permission = "operserv/umode"; }
module { name = "os_modinfo" }
command { service = "OperServ"; name = "MODINFO"; command = "operserv/modinfo"; }
command { service = "OperServ"; name = "MODLIST"; command = "operserv/modlist"; }
command { service = "OperServ"; name = "MODLIST"; command = "operserv/modlist"; permission = "operserv/modlist"; }
module { name = "os_module" }
command { service = "OperServ"; name = "MODLOAD"; command = "operserv/modload"; }
command { service = "OperServ"; name = "MODRELOAD"; command = "operserv/modreload"; }
command { service = "OperServ"; name = "MODUNLOAD"; command = "operserv/modunload"; }
command { service = "OperServ"; name = "MODLOAD"; command = "operserv/modload"; permission = "operserv/modload"; }
command { service = "OperServ"; name = "MODRELOAD"; command = "operserv/modreload"; permission = "operserv/modload"; }
command { service = "OperServ"; name = "MODUNLOAD"; command = "operserv/modunload"; permission = "operserv/modload"; }
module { name = "os_news" }
command { service = "OperServ"; name = "LOGONNEWS"; command = "operserv/logonnews"; }
command { service = "OperServ"; name = "OPERNEWS"; command = "operserv/opernews"; }
command { service = "OperServ"; name = "RANDOMNEWS"; command = "operserv/randomnews"; }
command { service = "OperServ"; name = "LOGONNEWS"; command = "operserv/logonnews"; permission = "operserv/news"; }
command { service = "OperServ"; name = "OPERNEWS"; command = "operserv/opernews"; permission = "operserv/news"; }
command { service = "OperServ"; name = "RANDOMNEWS"; command = "operserv/randomnews"; permission = "operserv/news"; }
module { name = "os_noop" }
command { service = "OperServ"; name = "NOOP"; command = "operserv/noop"; }
command { service = "OperServ"; name = "NOOP"; command = "operserv/noop"; permission = "operserv/noop"; }
module { name = "os_oline" }
command { service = "OperServ"; name = "OLINE"; command = "operserv/oline"; }
command { service = "OperServ"; name = "OLINE"; command = "operserv/oline"; permission = "operserv/oline"; }
module { name = "os_oper" }
command { service = "OperServ"; name = "OPER"; command = "operserv/oper"; }
command { service = "OperServ"; name = "OPER"; command = "operserv/oper"; permission = "operserv/oper"; }
module { name = "os_reload" }
command { service = "OperServ"; name = "RELOAD"; command = "operserv/reload"; }
command { service = "OperServ"; name = "RELOAD"; command = "operserv/reload"; permission = "operserv/reload"; }
module { name = "os_session" }
command { service = "OperServ"; name = "EXCEPTION"; command = "operserv/exception"; }
command { service = "OperServ"; name = "SESSION"; command = "operserv/session"; }
command { service = "OperServ"; name = "EXCEPTION"; command = "operserv/exception"; permission = "operserv/exception"; }
command { service = "OperServ"; name = "SESSION"; command = "operserv/session"; permission = "operserv/session"; }
module { name = "os_set" }
command { service = "OperServ"; name = "SET"; command = "operserv/set"; }
command { service = "OperServ"; name = "SET"; command = "operserv/set"; permission = "operserv/set"; }
module { name = "os_shutdown" }
command { service = "OperServ"; name = "QUIT"; command = "operserv/quit"; }
command { service = "OperServ"; name = "RESTART"; command = "operserv/restart"; }
command { service = "OperServ"; name = "SHUTDOWN"; command = "operserv/shutdown"; }
command { service = "OperServ"; name = "QUIT"; command = "operserv/quit"; permission = "operserv/quit"; }
command { service = "OperServ"; name = "RESTART"; command = "operserv/restart"; permission = "operserv/restart"; }
command { service = "OperServ"; name = "SHUTDOWN"; command = "operserv/shutdown"; permission = "operserv/shutdown"; }
module { name = "os_stats" }
command { service = "OperServ"; name = "STATS"; command = "operserv/stats"; }
command { service = "OperServ"; name = "STATS"; command = "operserv/stats"; permission = "operserv/stats"; }
module { name = "os_svsnick" }
command { service = "OperServ"; name = "SVSNICK"; command = "operserv/svsnick"; }
command { service = "OperServ"; name = "SVSNICK"; command = "operserv/svsnick"; permission = "operserv/svsnick"; }
module { name = "os_sxline" }
command { service = "OperServ"; name = "SNLINE"; command = "operserv/snline"; }
command { service = "OperServ"; name = "SQLINE"; command = "operserv/sqline"; }
command { service = "OperServ"; name = "SZLINE"; command = "operserv/szline"; }
command { service = "OperServ"; name = "SNLINE"; command = "operserv/snline"; permission = "operserv/snline"; }
command { service = "OperServ"; name = "SQLINE"; command = "operserv/sqline"; permission = "operserv/sqline"; }
command { service = "OperServ"; name = "SZLINE"; command = "operserv/szline"; permission = "operserv/szline"; }
module { name = "os_update" }
command { service = "OperServ"; name = "UPDATE"; command = "operserv/update"; }
command { service = "OperServ"; name = "UPDATE"; command = "operserv/update"; permission = "operserv/update"; }
+4 -16
View File
@@ -719,13 +719,6 @@ chanserv
*/
inhabit = 15s
/*
* Limits the use of the ChanServ LIST command to IRC operators.
*
* This directive is optional.
*/
#listopersonly = yes
/*
* The maximum number of channels to be returned for a ChanServ LIST command.
*/
@@ -1058,13 +1051,6 @@ nickserv
*/
#nogroupchange = yes
/*
* Limits the use of the NickServ LIST command to IRC operators.
*
* This directive is optional.
*/
#listopersonly = yes
/*
* The maximum number of nicks to be returned for a NickServ LIST command.
*/
@@ -1375,7 +1361,9 @@ log
* This block is recommended, as without it you will be unable to access most oper commands.
* It replaces the old ServicesRoot directive amongst others.
*
* Note that third party modules may add additional commands and privileges to this list.
* The command names below are defaults and are configured in commands.conf. If you configure
* additional commands with permissions, such as commands from third party modules, the permissions
* must be included in the opertype block before the command can be used.
*
* Available privileges:
* botserv/administration - Can perform certain BotServ administrative tasks
@@ -1418,7 +1406,7 @@ log
*
* global/global
*
* operserv/news operserv/stats operserv/kick
* operserv/news operserv/stats operserv/kick operserv/exception
* operserv/mode operserv/session operserv/modlist operserv/ignore
* operserv/chankill operserv/akill operserv/sqline operserv/snline
* operserv/szline operserv/oper operserv/config operserv/umode
+14 -1
View File
@@ -13,7 +13,6 @@ class BotInfo;
extern CoreExport Anope::insensitive_map<BotInfo *> BotListByNick;
extern CoreExport Anope::map<BotInfo *> BotListByUID;
typedef Anope::insensitive_map<BotInfo *> botinfo_map;
typedef Anope::insensitive_map<Anope::string> command_map;
/** Flags settable on a bot
*/
@@ -39,6 +38,7 @@ class CoreExport BotInfo : public User, public Flags<BotFlag, BI_END>
uint32 chancount;
time_t created; /* Birth date ;) */
time_t lastmsg; /* Last time we said something */
typedef Anope::insensitive_map<CommandInfo> command_map;
command_map commands; /* Commands, actual name to service name */
/** Create a new bot.
@@ -100,6 +100,19 @@ class CoreExport BotInfo : public User, public Flags<BotFlag, BI_END>
* @param message The users' message
*/
virtual void OnMessage(User *u, const Anope::string &message);
/** Link a command name to a command in services
* @param cname The command name
* @param sname The service name
* @param permission Permission required to execute the command, if any
*/
void SetCommand(const Anope::string &cname, const Anope::string &sname, const Anope::string &permission = "");
/** Get command info for a command
* @param cname The command name
* @return A struct containing service name and permission
*/
CommandInfo *GetCommand(const Anope::string &cname);
};
#endif // BOTS_H
+9 -8
View File
@@ -30,6 +30,12 @@ const Anope::string CommandFlagStrings[] = {
""
};
struct CommandInfo
{
Anope::string name;
Anope::string permission;
};
/* The source for a command */
struct CoreExport CommandSource
{
@@ -43,6 +49,8 @@ struct CoreExport CommandSource
BotInfo *service;
/* The actual name of the command being executed */
Anope::string command;
/* The permission of the command being executed */
Anope::string permission;
std::list<Anope::string> reply;
@@ -64,8 +72,6 @@ class CoreExport Command : public Service, public Flags<CommandFlag>
size_t MaxParams;
/* Minimum parameters required to use this command */
size_t MinParams;
/* Permission needed to use this comand */
Anope::string permission;
/* Module which owns us */
Module *module;
@@ -77,7 +83,7 @@ class CoreExport Command : public Service, public Flags<CommandFlag>
* @param max_params The maximum number of parameters the parser will create, after max_params, all will be combined into the last argument.
* NOTE: If max_params is not set (default), there is no limit to the max number of params.
*/
Command(Module *owner, const Anope::string &sname, size_t min_params, size_t max_params = 0, const Anope::string &spermission = "");
Command(Module *owner, const Anope::string &sname, size_t min_params, size_t max_params = 0);
virtual ~Command();
@@ -117,11 +123,6 @@ class CoreExport Command : public Service, public Flags<CommandFlag>
* @param subcommand The subcommand the user tried to use
*/
virtual void OnSyntaxError(CommandSource &source, const Anope::string &subcommand);
/** Set which command permission (e.g. chanserv/forbid) is required for this command.
* @param reststr The permission required to successfully execute this command
*/
void SetPermission(const Anope::string &reststr);
};
#endif // COMMANDS_H
-4
View File
@@ -482,8 +482,6 @@ class CoreExport ServerConfig
Anope::string NSEnforcerHost;
/* How long before recovered nicks are released */
time_t NSReleaseTimeout;
/* /nickserv list is oper only */
bool NSListOpersOnly;
/* Max number of entries that can be returned from the list command */
unsigned NSListMax;
/* Only allow usermode +a etc on real services admins */
@@ -523,8 +521,6 @@ class CoreExport ServerConfig
Anope::string CSAutokickReason;
/* Time ChanServ should stay in the channel to hold it to keep users from getting in */
time_t CSInhabit;
/* ChanServ's LIST command is oper only */
bool CSListOpersOnly;
/* Max number of entries allowed to be returned from the LIST command */
unsigned CSListMax;
/* true to make ChanServ oper only */
+1
View File
@@ -674,6 +674,7 @@ enum
#include "users.h"
#include "account.h"
#include "commands.h"
#include "bots.h"
struct LevelInfo
+3 -3
View File
@@ -314,7 +314,7 @@ class CommandBSBot : public Command
if (cmd.equals_ci("ADD"))
{
// ADD nick user host real - 5
if (!u->HasCommand("botserv/botserv/bot/add"))
if (!u->HasCommand("botserv/bot/add"))
{
source.Reply(ACCESS_DENIED);
return;
@@ -337,7 +337,7 @@ class CommandBSBot : public Command
{
// CHANGE oldn newn user host real - 6
// but only oldn and newn are required
if (!u->HasCommand("botserv/botserv/bot/change"))
if (!u->HasCommand("botserv/bot/change"))
{
source.Reply(ACCESS_DENIED);
return;
@@ -354,7 +354,7 @@ class CommandBSBot : public Command
else if (cmd.equals_ci("DEL"))
{
// DEL nick
if (!u->HasCommand("botserv/botserv/bot/del"))
if (!u->HasCommand("botserv/bot/del"))
{
source.Reply(ACCESS_DENIED);
return;
-6
View File
@@ -33,12 +33,6 @@ class CommandCSList : public Command
int count = 0, from = 0, to = 0;
bool suspended = false, channoexpire = false;
if (Config->CSListOpersOnly && !u->HasMode(UMODE_OPER))
{
source.Reply(ACCESS_DENIED);
return;
}
if (pattern[0] == '#')
{
Anope::string n1 = myStrGetToken(pattern.substr(1), '-', 0), /* Read FROM out */
+6 -4
View File
@@ -16,7 +16,7 @@
class CommandCSSASet : public Command
{
public:
CommandCSSASet(Module *creator) : Command(creator, "chanserv/saset", 2, 3, "chanserv/saset")
CommandCSSASet(Module *creator) : Command(creator, "chanserv/saset", 2, 3)
{
this->SetDesc(_("Forcefully set channel options and information"));
this->SetSyntax(_("\037option\037 \037channel\037 \037parameters\037"));
@@ -37,11 +37,13 @@ class CommandCSSASet : public Command
" \n"
"Available options:"));
Anope::string this_name = source.command;
for (command_map::iterator it = source.owner->commands.begin(), it_end = source.owner->commands.end(); it != it_end; ++it)
for (BotInfo::command_map::iterator it = source.owner->commands.begin(), it_end = source.owner->commands.end(); it != it_end; ++it)
{
if (it->first.find_ci(this_name + " ") == 0)
const Anope::string &c_name = it->first;
CommandInfo &info = it->second;
if (c_name.find_ci(this_name + " ") == 0)
{
service_reference<Command> command(it->second);
service_reference<Command> command(info.name);
if (command)
{
source.command = it->first;
+2 -2
View File
@@ -16,7 +16,7 @@
class CommandCSSASetNoexpire : public Command
{
public:
CommandCSSASetNoexpire(Module *creator) : Command(creator, "chanserv/saset/noexpire", 2, 2, "chanserv/saset/noexpire")
CommandCSSASetNoexpire(Module *creator) : Command(creator, "chanserv/saset/noexpire", 2, 2)
{
this->SetDesc(_("Prevent the channel from expiring"));
this->SetDesc(_("\037channel\037 {ON | OFF}"));
@@ -32,7 +32,7 @@ class CommandCSSASetNoexpire : public Command
return;
}
if (!this->permission.empty() && !ci->HasPriv(u, CA_SET))
if (source.permission.empty() && !ci->HasPriv(u, CA_SET))
{
source.Reply(ACCESS_DENIED);
return;
+5 -3
View File
@@ -37,11 +37,13 @@ class CommandCSSet : public Command
" \n"
"Available options:"));
Anope::string this_name = source.command;
for (command_map::iterator it = source.owner->commands.begin(), it_end = source.owner->commands.end(); it != it_end; ++it)
for (BotInfo::command_map::iterator it = source.owner->commands.begin(), it_end = source.owner->commands.end(); it != it_end; ++it)
{
if (it->first.find_ci(this_name + " ") == 0)
const Anope::string &c_name = it->first;
CommandInfo &info = it->second;
if (c_name.find_ci(this_name + " ") == 0)
{
service_reference<Command> command(it->second);
service_reference<Command> command(info.name);
if (command)
{
source.command = it->first;
+3 -3
View File
@@ -16,7 +16,7 @@
class CommandCSSetBanType : public Command
{
public:
CommandCSSetBanType(Module *creator, const Anope::string &cname = "chanserv/set/bantype", const Anope::string &cpermission = "") : Command(creator, cname, 2, 2, cpermission)
CommandCSSetBanType(Module *creator, const Anope::string &cname = "chanserv/set/bantype") : Command(creator, cname, 2, 2)
{
this->SetDesc(_("Set how Services make bans on the channel"));
this->SetSyntax(_("\037channel\037 \037bantype\037"));
@@ -32,7 +32,7 @@ class CommandCSSetBanType : public Command
return;
}
if (!this->permission.empty() && !ci->HasPriv(u, CA_SET))
if (source.permission.empty() && !ci->HasPriv(u, CA_SET))
{
source.Reply(ACCESS_DENIED);
return;
@@ -74,7 +74,7 @@ class CommandCSSetBanType : public Command
class CommandCSSASetBanType : public CommandCSSetBanType
{
public:
CommandCSSASetBanType(Module *creator) : CommandCSSetBanType(creator, "chanserv/saset/bantype", "chanserv/saset/bantype")
CommandCSSASetBanType(Module *creator) : CommandCSSetBanType(creator, "chanserv/saset/bantype")
{
}
};
+3 -3
View File
@@ -16,7 +16,7 @@
class CommandCSSetDescription : public Command
{
public:
CommandCSSetDescription(Module *creator, const Anope::string &cname = "chanserv/set/description", const Anope::string &cpermission = "") : Command(creator, cname, 1, 2, cpermission)
CommandCSSetDescription(Module *creator, const Anope::string &cname = "chanserv/set/description") : Command(creator, cname, 1, 2)
{
this->SetDesc(_("Set the channel description"));
this->SetSyntax(_("\037channel\037 [\037description\037]"));
@@ -32,7 +32,7 @@ class CommandCSSetDescription : public Command
return;
}
if (!this->permission.empty() && !ci->HasPriv(u, CA_SET))
if (source.permission.empty() && !ci->HasPriv(u, CA_SET))
{
source.Reply(ACCESS_DENIED);
return;
@@ -65,7 +65,7 @@ class CommandCSSetDescription : public Command
class CommandCSSASetDescription : public CommandCSSetDescription
{
public:
CommandCSSASetDescription(Module *creator) : CommandCSSetDescription(creator, "chanserv/saset/description", "chanserv/saset/description")
CommandCSSASetDescription(Module *creator) : CommandCSSetDescription(creator, "chanserv/saset/description")
{
}
};
+5 -5
View File
@@ -16,7 +16,7 @@
class CommandCSSetFounder : public Command
{
public:
CommandCSSetFounder(Module *creator, const Anope::string &cname = "chanserv/set/founder", const Anope::string &cpermission = "") : Command(creator, cname, 2, 2, cpermission)
CommandCSSetFounder(Module *creator, const Anope::string &cname = "chanserv/set/founder") : Command(creator, cname, 2, 2)
{
this->SetDesc(_("Set the founder of a channel"));
this->SetSyntax(_("\037channel\037 \037nick\037"));
@@ -32,13 +32,13 @@ class CommandCSSetFounder : public Command
return;
}
if (!this->permission.empty() && !ci->HasPriv(u, CA_SET))
if (source.permission.empty() && !ci->HasPriv(u, CA_SET))
{
source.Reply(ACCESS_DENIED);
return;
}
if (this->permission.empty() && (ci->HasFlag(CI_SECUREFOUNDER) ? !IsFounder(u, ci) : !ci->HasPriv(u, CA_FOUNDER)))
if (source.permission.empty() && (ci->HasFlag(CI_SECUREFOUNDER) ? !IsFounder(u, ci) : !ci->HasPriv(u, CA_FOUNDER)))
{
source.Reply(ACCESS_DENIED);
return;
@@ -59,7 +59,7 @@ class CommandCSSetFounder : public Command
return;
}
Log(!this->permission.empty() ? LOG_ADMIN : LOG_COMMAND, u, this, ci) << "to change the founder to " << nc->display;
Log(!source.permission.empty() ? LOG_ADMIN : LOG_COMMAND, u, this, ci) << "to change the founder to " << nc->display;
ci->SetFounder(nc);
@@ -81,7 +81,7 @@ class CommandCSSetFounder : public Command
class CommandCSSASetFounder : public CommandCSSetFounder
{
public:
CommandCSSASetFounder(Module *creator) : CommandCSSetFounder(creator, "chanserv/saset/founder", "chanserv/saset/founder")
CommandCSSASetFounder(Module *creator) : CommandCSSetFounder(creator, "chanserv/saset/founder")
{
}
};
+3 -3
View File
@@ -16,7 +16,7 @@
class CommandCSSetKeepTopic : public Command
{
public:
CommandCSSetKeepTopic(Module *creator, const Anope::string &cname = "chanserv/set/keeptopic", const Anope::string &cpermission = "") : Command(creator, cname, 2, 2, cpermission)
CommandCSSetKeepTopic(Module *creator, const Anope::string &cname = "chanserv/set/keeptopic") : Command(creator, cname, 2, 2)
{
this->SetDesc(_("Retain topic when channel is not in use"));
this->SetSyntax(_("\037channel\037 {ON | OFF}"));
@@ -32,7 +32,7 @@ class CommandCSSetKeepTopic : public Command
return;
}
if (!this->permission.empty() && !ci->HasPriv(u, CA_SET))
if (source.permission.empty() && !ci->HasPriv(u, CA_SET))
{
source.Reply(ACCESS_DENIED);
return;
@@ -70,7 +70,7 @@ class CommandCSSetKeepTopic : public Command
class CommandCSSASetKeepTopic : public CommandCSSetKeepTopic
{
public:
CommandCSSASetKeepTopic(Module *creator) : CommandCSSetKeepTopic(creator, "chanserv/saset/keeptopic", "chanserv/saset/keeptopic")
CommandCSSASetKeepTopic(Module *creator) : CommandCSSetKeepTopic(creator, "chanserv/saset/keeptopic")
{
}
};
+3 -3
View File
@@ -16,7 +16,7 @@
class CommandCSSetOpNotice : public Command
{
public:
CommandCSSetOpNotice(Module *creator, const Anope::string &cname = "chanserv/set/notice", const Anope::string &cpermission = "") : Command(creator, cname, 2, 2, cpermission)
CommandCSSetOpNotice(Module *creator, const Anope::string &cname = "chanserv/set/notice") : Command(creator, cname, 2, 2)
{
this->SetDesc(_("Send a notice when OP/DEOP commands are used"));
this->SetSyntax(_("\037channel\037 {ON | OFF}"));
@@ -32,7 +32,7 @@ class CommandCSSetOpNotice : public Command
return;
}
if (!this->permission.empty() && !ci->HasPriv(u, CA_SET))
if (source.permission.empty() && !ci->HasPriv(u, CA_SET))
{
source.Reply(ACCESS_DENIED);
return;
@@ -69,7 +69,7 @@ class CommandCSSetOpNotice : public Command
class CommandCSSASetOpNotice : public CommandCSSetOpNotice
{
public:
CommandCSSASetOpNotice(Module *creator) : CommandCSSetOpNotice(creator, "chanserv/saset/opnotice", "chanserv/saset/opnotice")
CommandCSSASetOpNotice(Module *creator) : CommandCSSetOpNotice(creator, "chanserv/saset/opnotice")
{
}
};
+3 -3
View File
@@ -16,7 +16,7 @@
class CommandCSSetPeace : public Command
{
public:
CommandCSSetPeace(Module *creator, const Anope::string &cname = "chanserv/set/peace", const Anope::string &cpermission = "") : Command(creator, cname, 2, 2, cpermission)
CommandCSSetPeace(Module *creator, const Anope::string &cname = "chanserv/set/peace") : Command(creator, cname, 2, 2)
{
this->SetDesc(_("Regulate the use of critical commands"));
this->SetSyntax(_("\037channel\037 {ON | OFF}"));
@@ -32,7 +32,7 @@ class CommandCSSetPeace : public Command
return;
}
if (!this->permission.empty() && !ci->HasPriv(u, CA_SET))
if (source.permission.empty() && !ci->HasPriv(u, CA_SET))
{
source.Reply(ACCESS_DENIED);
return;
@@ -69,7 +69,7 @@ class CommandCSSetPeace : public Command
class CommandCSSASetPeace : public CommandCSSetPeace
{
public:
CommandCSSASetPeace(Module *creator) : CommandCSSetPeace(creator, "chanserv/saset/peace", "chanserv/saset/peace")
CommandCSSASetPeace(Module *creator) : CommandCSSetPeace(creator, "chanserv/saset/peace")
{
}
};
+3 -3
View File
@@ -16,7 +16,7 @@
class CommandCSSetPersist : public Command
{
public:
CommandCSSetPersist(Module *creator, const Anope::string &cname = "chanserv/set/persist", const Anope::string &cpermission = "") : Command(creator, cname, 2, 2, cpermission)
CommandCSSetPersist(Module *creator, const Anope::string &cname = "chanserv/set/persist") : Command(creator, cname, 2, 2)
{
this->SetDesc(_("Set the channel as permanent"));
this->SetSyntax(_("\037channel\037 {ON | OFF}"));
@@ -32,7 +32,7 @@ class CommandCSSetPersist : public Command
return;
}
if (!this->permission.empty() && !ci->HasPriv(u, CA_SET))
if (source.permission.empty() && !ci->HasPriv(u, CA_SET))
{
source.Reply(ACCESS_DENIED);
return;
@@ -156,7 +156,7 @@ class CommandCSSetPersist : public Command
class CommandCSSASetPersist : public CommandCSSetPersist
{
public:
CommandCSSASetPersist(Module *creator) : CommandCSSetPersist(creator, "chanserv/saset/persist", "chanserv/saset/persist")
CommandCSSASetPersist(Module *creator) : CommandCSSetPersist(creator, "chanserv/saset/persist")
{
}
};
+3 -3
View File
@@ -16,7 +16,7 @@
class CommandCSSetPrivate : public Command
{
public:
CommandCSSetPrivate(Module *creator, const Anope::string &cname = "chanserv/set/private", const Anope::string &cpermission = "") : Command(creator, cname, 2, 2, cpermission)
CommandCSSetPrivate(Module *creator, const Anope::string &cname = "chanserv/set/private") : Command(creator, cname, 2, 2)
{
this->SetDesc(_("Hide channel from LIST command"));
this->SetSyntax(_("\037channel\037 {ON | OFF}"));
@@ -32,7 +32,7 @@ class CommandCSSetPrivate : public Command
return;
}
if (!this->permission.empty() && !ci->HasPriv(u, CA_SET))
if (source.permission.empty() && !ci->HasPriv(u, CA_SET))
{
source.Reply(ACCESS_DENIED);
return;
@@ -69,7 +69,7 @@ class CommandCSSetPrivate : public Command
class CommandCSSASetPrivate : public CommandCSSetPrivate
{
public:
CommandCSSASetPrivate(Module *creator) : CommandCSSetPrivate(creator, "chanserv/saset/private", "chanserv/saset/private")
CommandCSSASetPrivate(Module *creator) : CommandCSSetPrivate(creator, "chanserv/saset/private")
{
}
};
+3 -3
View File
@@ -15,7 +15,7 @@
class CommandCSSetRestricted : public Command
{
public:
CommandCSSetRestricted(Module *creator, const Anope::string &cname = "chanserv/set/restricted", const Anope::string &cpermission = "") : Command(creator, cname, 2, 2, cpermission)
CommandCSSetRestricted(Module *creator, const Anope::string &cname = "chanserv/set/restricted") : Command(creator, cname, 2, 2)
{
this->SetDesc(_("Restrict access to the channel"));
this->SetSyntax(_("\037channel\037 {ON | OFF}"));
@@ -31,7 +31,7 @@ class CommandCSSetRestricted : public Command
return;
}
if (!this->permission.empty() && !ci->HasPriv(u, CA_SET))
if (source.permission.empty() && !ci->HasPriv(u, CA_SET))
{
source.Reply(ACCESS_DENIED);
return;
@@ -67,7 +67,7 @@ class CommandCSSetRestricted : public Command
class CommandCSSASetRestricted : public CommandCSSetRestricted
{
public:
CommandCSSASetRestricted(Module *creator) : CommandCSSetRestricted(creator, "chanserv/saset/restricted", "chanserv/saset/restricted")
CommandCSSASetRestricted(Module *creator) : CommandCSSetRestricted(creator, "chanserv/saset/restricted")
{
}
};
+3 -3
View File
@@ -16,7 +16,7 @@
class CommandCSSetSecure : public Command
{
public:
CommandCSSetSecure(Module *creator, const Anope::string &cname = "chanserv/set/secure", const Anope::string &cpermission = "") : Command(creator, cname, 2, 2, cpermission)
CommandCSSetSecure(Module *creator, const Anope::string &cname = "chanserv/set/secure") : Command(creator, cname, 2, 2)
{
this->SetDesc(_("Activate security features"));
this->SetSyntax(_("\037channel\037 {ON | OFF}"));
@@ -32,7 +32,7 @@ class CommandCSSetSecure : public Command
return;
}
if (!this->permission.empty() && !ci->HasPriv(u, CA_SET))
if (source.permission.empty() && !ci->HasPriv(u, CA_SET))
{
source.Reply(ACCESS_DENIED);
return;
@@ -70,7 +70,7 @@ class CommandCSSetSecure : public Command
class CommandCSSASetSecure : public CommandCSSetSecure
{
public:
CommandCSSASetSecure(Module *creator) : CommandCSSetSecure(creator, "chanserv/saset/secure", "chanserv/saset/secure")
CommandCSSASetSecure(Module *creator) : CommandCSSetSecure(creator, "chanserv/saset/secure")
{
}
};
+3 -3
View File
@@ -16,7 +16,7 @@
class CommandCSSetSecureFounder : public Command
{
public:
CommandCSSetSecureFounder(Module *creator, const Anope::string &cname = "chanserv/set/securefounder", const Anope::string &cpermission = "") : Command(creator, cname, 2, 2, cpermission)
CommandCSSetSecureFounder(Module *creator, const Anope::string &cname = "chanserv/set/securefounder") : Command(creator, cname, 2, 2)
{
this->SetDesc(_("Stricter control of channel founder status"));
this->SetSyntax(_("\037channel\037 {ON | OFF}"));
@@ -33,7 +33,7 @@ class CommandCSSetSecureFounder : public Command
}
if (this->permission.empty() && ci->HasFlag(CI_SECUREFOUNDER) ? !IsFounder(u, ci) : !ci->HasPriv(u, CA_FOUNDER))
if (source.permission.empty() && ci->HasFlag(CI_SECUREFOUNDER) ? !IsFounder(u, ci) : !ci->HasPriv(u, CA_FOUNDER))
{
source.Reply(ACCESS_DENIED);
return;
@@ -71,7 +71,7 @@ class CommandCSSetSecureFounder : public Command
class CommandCSSASetSecureFounder : public CommandCSSetSecureFounder
{
public:
CommandCSSASetSecureFounder(Module *creator) : CommandCSSetSecureFounder(creator, "chanserv/saset/securefounder", "chanserv/saset/securefounder")
CommandCSSASetSecureFounder(Module *creator) : CommandCSSetSecureFounder(creator, "chanserv/saset/securefounder")
{
}
};
+3 -3
View File
@@ -16,7 +16,7 @@
class CommandCSSetSecureOps : public Command
{
public:
CommandCSSetSecureOps(Module *creator, const Anope::string &cname = "chanserv/set/secureops", const Anope::string &cpermission = "") : Command(creator, cname, 2, 2, cpermission)
CommandCSSetSecureOps(Module *creator, const Anope::string &cname = "chanserv/set/secureops") : Command(creator, cname, 2, 2)
{
this->SetDesc(_("Stricter control of chanop status"));
this->SetSyntax(_("\037channel\037 {ON | OFF}"));
@@ -32,7 +32,7 @@ class CommandCSSetSecureOps : public Command
return;
}
if (!this->permission.empty() && !ci->HasPriv(u, CA_SET))
if (source.permission.empty() && !ci->HasPriv(u, CA_SET))
{
source.Reply(ACCESS_DENIED);
return;
@@ -68,7 +68,7 @@ class CommandCSSetSecureOps : public Command
class CommandCSSASetSecureOps : public CommandCSSetSecureOps
{
public:
CommandCSSASetSecureOps(Module *creator) : CommandCSSetSecureOps(creator, "chanserv/saset/secureops", "chanserv/saset/secureops")
CommandCSSASetSecureOps(Module *creator) : CommandCSSetSecureOps(creator, "chanserv/saset/secureops")
{
}
};
+3 -3
View File
@@ -16,7 +16,7 @@
class CommandCSSetSignKick : public Command
{
public:
CommandCSSetSignKick(Module *creator, const Anope::string &cname = "chanserv/set/signkick", const Anope::string &cpermission = "") : Command(creator, cname, 2, 2, cpermission)
CommandCSSetSignKick(Module *creator, const Anope::string &cname = "chanserv/set/signkick") : Command(creator, cname, 2, 2)
{
this->SetDesc(_("Sign kicks that are done with KICK command"));
this->SetSyntax(_("\037channel\037 SIGNKICK {ON | LEVEL | OFF}"));
@@ -32,7 +32,7 @@ class CommandCSSetSignKick : public Command
return;
}
if (!this->permission.empty() && !ci->HasPriv(u, CA_SET))
if (source.permission.empty() && !ci->HasPriv(u, CA_SET))
{
source.Reply(ACCESS_DENIED);
return;
@@ -80,7 +80,7 @@ class CommandCSSetSignKick : public Command
class CommandCSSASetSignKick : public CommandCSSetSignKick
{
public:
CommandCSSASetSignKick(Module *creator) : CommandCSSetSignKick(creator, "chanserv/saset/signkick", "chanserv/saset/signkick")
CommandCSSASetSignKick(Module *creator) : CommandCSSetSignKick(creator, "chanserv/saset/signkick")
{
}
};
+5 -5
View File
@@ -16,7 +16,7 @@
class CommandCSSetSuccessor : public Command
{
public:
CommandCSSetSuccessor(Module *creator, const Anope::string &cname = "chanserv/set/successor", const Anope::string &cpermission = "") : Command(creator, cname, 1, 2, cpermission)
CommandCSSetSuccessor(Module *creator, const Anope::string &cname = "chanserv/set/successor") : Command(creator, cname, 1, 2)
{
this->SetDesc(_("Set the successor for a channel"));
this->SetSyntax(_("\037channel\037 \037nick\037"));
@@ -32,13 +32,13 @@ class CommandCSSetSuccessor : public Command
return;
}
if (!this->permission.empty() && !ci->HasPriv(u, CA_SET))
if (source.permission.empty() && !ci->HasPriv(u, CA_SET))
{
source.Reply(ACCESS_DENIED);
return;
}
if (this->permission.empty() && ci->HasFlag(CI_SECUREFOUNDER) ? !IsFounder(u, ci) : !ci->HasPriv(u, CA_FOUNDER))
if (source.permission.empty() && ci->HasFlag(CI_SECUREFOUNDER) ? !IsFounder(u, ci) : !ci->HasPriv(u, CA_FOUNDER))
{
source.Reply(ACCESS_DENIED);
return;
@@ -65,7 +65,7 @@ class CommandCSSetSuccessor : public Command
else
nc = NULL;
Log(!this->permission.empty() ? LOG_ADMIN : LOG_COMMAND, u, this, ci) << "to change the successor from " << (ci->successor ? ci->successor->display : "none") << " to " << (nc ? nc->display : "none");
Log(!source.permission.empty() ? LOG_ADMIN : LOG_COMMAND, u, this, ci) << "to change the successor from " << (ci->successor ? ci->successor->display : "none") << " to " << (nc ? nc->display : "none");
ci->successor = nc;
@@ -95,7 +95,7 @@ class CommandCSSetSuccessor : public Command
class CommandCSSASetSuccessor : public CommandCSSetSuccessor
{
public:
CommandCSSASetSuccessor(Module *creator) : CommandCSSetSuccessor(creator, "chanserv/saset/successor", "chanserv/saset/successor")
CommandCSSASetSuccessor(Module *creator) : CommandCSSetSuccessor(creator, "chanserv/saset/successor")
{
}
};
+3 -3
View File
@@ -16,7 +16,7 @@
class CommandCSSetTopicLock : public Command
{
public:
CommandCSSetTopicLock(Module *creator, const Anope::string &cname = "chanserv/set/topiclock", const Anope::string &cpermission = "") : Command(creator, cname, 2, 2, cpermission)
CommandCSSetTopicLock(Module *creator, const Anope::string &cname = "chanserv/set/topiclock") : Command(creator, cname, 2, 2)
{
this->SetDesc(_("Topic can only be changed with TOPIC"));
this->SetSyntax(_("\037channel\037 {ON | OFF}"));
@@ -32,7 +32,7 @@ class CommandCSSetTopicLock : public Command
return;
}
if (!this->permission.empty() && !ci->HasPriv(u, CA_SET))
if (source.permission.empty() && !ci->HasPriv(u, CA_SET))
{
source.Reply(ACCESS_DENIED);
return;
@@ -68,7 +68,7 @@ class CommandCSSetTopicLock : public Command
class CommandCSSASetTopicLock : public CommandCSSetTopicLock
{
public:
CommandCSSASetTopicLock(Module *creator) : CommandCSSetTopicLock(creator, "chanserv/saset/topiclock", "chanserv/saset/topiclock")
CommandCSSASetTopicLock(Module *creator) : CommandCSSetTopicLock(creator, "chanserv/saset/topiclock")
{
}
};
+2 -2
View File
@@ -16,7 +16,7 @@
class CommandCSSuspend : public Command
{
public:
CommandCSSuspend(Module *creator) : Command(creator, "chanserv/suspend", 1, 2, "chanserv/suspend")
CommandCSSuspend(Module *creator) : Command(creator, "chanserv/suspend", 1, 2)
{
this->SetDesc(_("Prevent a channel from being used preserving channel data and settings"));
this->SetSyntax(_("\037channel\037 [\037reason\037]"));
@@ -86,7 +86,7 @@ class CommandCSSuspend : public Command
class CommandCSUnSuspend : public Command
{
public:
CommandCSUnSuspend(Module *creator) : Command(creator, "chanserv/unsuspend", 1, 1, "chanserv/suspend")
CommandCSUnSuspend(Module *creator) : Command(creator, "chanserv/unsuspend", 1, 1)
{
this->SetDesc(_("Releases a suspended channel"));
this->SetSyntax(_("\037channel\037"));
+1 -1
View File
@@ -52,7 +52,7 @@ static void WriteBotMetadata(const Anope::string &key, const Anope::string &data
class CommandSQLSync : public Command
{
public:
CommandSQLSync(Module *creator) : Command(creator, "SQLSYNC", 0, 0, "operserv/sqlsync")
CommandSQLSync(Module *creator) : Command(creator, "SQLSYNC", 0, 0)
{
this->SetDesc(_("Import your databases to SQL"));
this->SetSyntax("");
+1 -1
View File
@@ -17,7 +17,7 @@
class CommandGLGlobal : public Command
{
public:
CommandGLGlobal(Module *creator) : Command(creator, "global/global", 1, 1, "global/global")
CommandGLGlobal(Module *creator) : Command(creator, "global/global", 1, 1)
{
this->SetDesc(_("Send a message to all users"));
this->SetSyntax(_("\037message\037"));
+25 -15
View File
@@ -32,19 +32,22 @@ class CommandHelp : public Command
if (params.empty())
{
for (command_map::iterator it = bi->commands.begin(), it_end = bi->commands.end(); it != it_end; ++it)
for (BotInfo::command_map::iterator it = bi->commands.begin(), it_end = bi->commands.end(); it != it_end; ++it)
{
const Anope::string &c_name = it->first;
CommandInfo &info = it->second;
// Smaller command exists
Anope::string cmd = myStrGetToken(it->first, ' ', 0);
Anope::string cmd = myStrGetToken(c_name, ' ', 0);
if (cmd != it->first && bi->commands.count(cmd))
continue;
service_reference<Command> c(it->second);
service_reference<Command> c(info.name);
if (!c)
continue;
if (!Config->HidePrivilegedCommands || c->permission.empty() || u->HasCommand(c->permission))
if (!Config->HidePrivilegedCommands || info.permission.empty() || u->HasCommand(info.permission))
{
source.command = it->first;
source.command = c_name;
c->OnServHelp(source);
}
}
@@ -59,15 +62,17 @@ class CommandHelp : public Command
full_command += " " + params[i];
full_command.erase(full_command.begin());
std::map<Anope::string, Anope::string>::iterator it = bi->commands.find(full_command);
BotInfo::command_map::iterator it = bi->commands.find(full_command);
if (it == bi->commands.end())
continue;
service_reference<Command> c(it->second);
CommandInfo &info = it->second;
service_reference<Command> c(info.name);
if (!c)
continue;
if (Config->HidePrivilegedCommands && !c->permission.empty() && !u->HasCommand(c->permission))
if (Config->HidePrivilegedCommands && !info.permission.empty() && !u->HasCommand(info.permission))
continue;
const Anope::string &subcommand = params.size() > max ? params[max] : "";
@@ -76,19 +81,24 @@ class CommandHelp : public Command
continue;
helped = true;
source.Reply(" ");
/* Inform the user what permission is required to use the command */
if (!c->permission.empty())
source.Reply(_("Access to this command requires the permission \002%s\002 to be present in your opertype."), c->permission.c_str());
if (!info.permission.empty())
{
source.Reply(" ");
source.Reply(_("Access to this command requires the permission \002%s\002 to be present in your opertype."), info.permission.c_str());
}
if (!c->HasFlag(CFLAG_ALLOW_UNREGISTERED) && !u->IsIdentified())
{
if (info.permission.empty())
source.Reply(" ");
source.Reply( _("You need to be identified to use this command."));
}
/* User doesn't have the proper permission to use this command */
else if (!c->permission.empty() && !u->HasCommand(c->permission))
else if (!info.permission.empty() && !u->HasCommand(info.permission))
{
source.Reply(_("You cannot use this command."));
/* User can use this command */
else
source.Reply(_("You can use this command."));
}
break;
}
+2 -2
View File
@@ -16,7 +16,7 @@
class CommandHSDel : public Command
{
public:
CommandHSDel(Module *creator) : Command(creator, "hostserv/del", 1, 1, "hostserv/del")
CommandHSDel(Module *creator) : Command(creator, "hostserv/del", 1, 1)
{
this->SetDesc(_("Delete the vhost of another user"));
this->SetSyntax(_("\037nick\037"));
@@ -51,7 +51,7 @@ class CommandHSDel : public Command
class CommandHSDelAll : public Command
{
public:
CommandHSDelAll(Module *creator) : Command(creator, "hostserv/delall", 1, 1, "hostserv/del")
CommandHSDelAll(Module *creator) : Command(creator, "hostserv/delall", 1, 1)
{
this->SetDesc(_("Delete the vhost for all nicks in a group"));
this->SetSyntax(_("\037nick\037"));
+1 -1
View File
@@ -16,7 +16,7 @@
class CommandHSList : public Command
{
public:
CommandHSList(Module *creator) : Command(creator, "hostserv/list", 0, 1, "hostserv/list")
CommandHSList(Module *creator) : Command(creator, "hostserv/list", 0, 1)
{
this->SetDesc(_("Displays one or more vhost entries."));
this->SetSyntax(_("\002[<key>|<#X-Y>]"));
+2 -2
View File
@@ -16,7 +16,7 @@
class CommandHSSet : public Command
{
public:
CommandHSSet(Module *creator) : Command(creator, "hostserv/set", 2, 2, "hostserv/set")
CommandHSSet(Module *creator) : Command(creator, "hostserv/set", 2, 2)
{
this->SetDesc(_("Set the vhost of another user"));
this->SetSyntax(_("\037nick\037 \037hostmask\037"));
@@ -123,7 +123,7 @@ class CommandHSSetAll : public Command
}
public:
CommandHSSetAll(Module *creator) : Command(creator, "hostserv/setall", 2, 2, "hostserv/set")
CommandHSSetAll(Module *creator) : Command(creator, "hostserv/setall", 2, 2)
{
this->SetDesc(_("Set the vhost for all nicks in a group"));
this->SetSyntax(_("\037nick\037 \037hostmask>\037"));
+1 -1
View File
@@ -17,7 +17,7 @@
class CommandMSSendAll : public Command
{
public:
CommandMSSendAll(Module *creator) : Command(creator, "memoserv/sendall", 1, 1, "memoserv/sendall")
CommandMSSendAll(Module *creator) : Command(creator, "memoserv/sendall", 1, 1)
{
this->SetDesc(_("Send a memo to all registered users"));
this->SetSyntax(_("\037memo-text\037"));
+1 -1
View File
@@ -17,7 +17,7 @@
class CommandMSStaff : public Command
{
public:
CommandMSStaff(Module *creator) : Command(creator, "memoserv/staff", 1, 1, "memoserv/staff")
CommandMSStaff(Module *creator) : Command(creator, "memoserv/staff", 1, 1)
{
this->SetDesc(_("Send a memo to all opers/admins"));
this->SetSyntax(_("\037memo-text\037"));
+1 -1
View File
@@ -20,7 +20,7 @@
class CommandNSGetEMail : public Command
{
public:
CommandNSGetEMail(Module *creator) : Command(creator, "nickserv/getemail", 1, 1, "nickserv/getemail")
CommandNSGetEMail(Module *creator) : Command(creator, "nickserv/getemail", 1, 1)
{
this->SetDesc(_("Matches and returns all users that registered using given email"));
this->SetSyntax(_("\037user@email-host\037"));
+1 -1
View File
@@ -16,7 +16,7 @@
class CommandNSGetPass : public Command
{
public:
CommandNSGetPass(Module *creator) : Command(creator, "nickserv/getpass", 1, 1, "nickserv/getpass")
CommandNSGetPass(Module *creator) : Command(creator, "nickserv/getpass", 1, 1)
{
this->SetDesc(_("Retrieve the password for a nickname"));
this->SetSyntax(_("\037nickname\037"));
-6
View File
@@ -36,12 +36,6 @@ class CommandNSList : public Command
suspended = nsnoexpire = unconfirmed = false;
if (Config->NSListOpersOnly && !u->HasMode(UMODE_OPER)) /* reverse the help logic */
{
source.Reply(ACCESS_DENIED);
return;
}
if (pattern[0] == '#')
{
Anope::string n1 = myStrGetToken(pattern.substr(1), '-', 0), /* Read FROM out */
+9 -6
View File
@@ -33,14 +33,17 @@ class CommandNSSASet : public Command
this->SendSyntax(source);
source.Reply(_("Sets various nickname options. \037option\037 can be one of:"));
Anope::string this_name = source.command;
for (command_map::iterator it = source.owner->commands.begin(), it_end = source.owner->commands.end(); it != it_end; ++it)
for (BotInfo::command_map::iterator it = source.owner->commands.begin(), it_end = source.owner->commands.end(); it != it_end; ++it)
{
if (it->first.find_ci(this_name + " ") == 0)
const Anope::string &c_name = it->first;
CommandInfo &info = it->second;
if (c_name.find_ci(this_name + " ") == 0)
{
service_reference<Command> command(it->second);
service_reference<Command> command(info.name);
if (command)
{
source.command = it->first;
source.command = c_name;
command->OnServHelp(source);
}
}
@@ -55,7 +58,7 @@ class CommandNSSASet : public Command
class CommandNSSASetDisplay : public Command
{
public:
CommandNSSASetDisplay(Module *creator) : Command(creator, "nickserv/saset/display", 2, 2, "nickserv/saset/display")
CommandNSSASetDisplay(Module *creator) : Command(creator, "nickserv/saset/display", 2, 2)
{
this->SetDesc(_("Set the display of the group in Services"));
this->SetSyntax(_("\037nickname\037 \037new-display\037"));
@@ -95,7 +98,7 @@ class CommandNSSASetDisplay : public Command
class CommandNSSASetPassword : public Command
{
public:
CommandNSSASetPassword(Module *creator) : Command(creator, "nickserv/saset/password", 2, 2, "nickserv/saset/password")
CommandNSSASetPassword(Module *creator) : Command(creator, "nickserv/saset/password", 2, 2)
{
this->SetDesc(_("Set the nickname password"));
this->SetSyntax(_("\037nickname\037 \037new-password\037"));
+1 -1
View File
@@ -16,7 +16,7 @@
class CommandNSSASetNoexpire : public Command
{
public:
CommandNSSASetNoexpire(Module *creator) : Command(creator, "nickserv/saset/noexpire", 1, 2, "nickserv/saset/noexpire")
CommandNSSASetNoexpire(Module *creator) : Command(creator, "nickserv/saset/noexpire", 1, 2)
{
this->SetDesc(_("Prevent the nickname from expiring"));
this->SetSyntax(_("\037nickname\037 {ON | OFF}"));
+7 -4
View File
@@ -34,14 +34,17 @@ class CommandNSSet : public Command
source.Reply(" ");
source.Reply(_("Sets various nickname options. \037option\037 can be one of:"));
Anope::string this_name = source.command;
for (command_map::iterator it = source.owner->commands.begin(), it_end = source.owner->commands.end(); it != it_end; ++it)
for (BotInfo::command_map::iterator it = source.owner->commands.begin(), it_end = source.owner->commands.end(); it != it_end; ++it)
{
if (it->first.find_ci(this_name + " ") == 0)
const Anope::string &c_name = it->first;
CommandInfo &info = it->second;
if (c_name.find_ci(this_name + " ") == 0)
{
service_reference<Command> command(it->second);
service_reference<Command> command(info.name);
if (command)
{
source.command = it->first;
source.command = c_name;
command->OnServHelp(source);
}
}
+2 -2
View File
@@ -16,7 +16,7 @@
class CommandNSSetAutoOp : public Command
{
public:
CommandNSSetAutoOp(Module *creator, const Anope::string &sname = "nickserv/set/autoop", size_t min = 1, const Anope::string &spermission = "") : Command(creator, sname, min, min + 1, spermission)
CommandNSSetAutoOp(Module *creator, const Anope::string &sname = "nickserv/set/autoop", size_t min = 1) : Command(creator, sname, min, min + 1)
{
this->SetDesc(_("Should services op you automatically."));
this->SetSyntax(_("{ON | OFF}"));
@@ -66,7 +66,7 @@ class CommandNSSetAutoOp : public Command
class CommandNSSASetAutoOp : public CommandNSSetAutoOp
{
public:
CommandNSSASetAutoOp(Module *creator) : CommandNSSetAutoOp(creator, "nickserv/saset/autoop", 2, "nickserv/saset/autoop")
CommandNSSASetAutoOp(Module *creator) : CommandNSSetAutoOp(creator, "nickserv/saset/autoop", 2)
{
this->ClearSyntax();
this->SetSyntax(_("\037nickname\037 {ON | OFF}"));
+2 -2
View File
@@ -44,7 +44,7 @@ static bool SendConfirmMail(User *u, BotInfo *bi)
class CommandNSSetEmail : public Command
{
public:
CommandNSSetEmail(Module *creator, const Anope::string &cname = "nickserv/set/email", size_t min = 0, const Anope::string &spermission = "") : Command(creator, cname, min, min + 1, spermission)
CommandNSSetEmail(Module *creator, const Anope::string &cname = "nickserv/set/email", size_t min = 0) : Command(creator, cname, min, min + 1)
{
this->SetDesc(_("Associate an E-mail address with your nickname"));
this->SetSyntax(_("\037address\037"));
@@ -122,7 +122,7 @@ class CommandNSSetEmail : public Command
class CommandNSSASetEmail : public CommandNSSetEmail
{
public:
CommandNSSASetEmail(Module *creator) : CommandNSSetEmail(creator, "nickserv/saset/email", 2, "nickserv/saset/email")
CommandNSSASetEmail(Module *creator) : CommandNSSetEmail(creator, "nickserv/saset/email", 2)
{
this->ClearSyntax();
this->SetSyntax(_("\037nickname\037 \037address\037"));
+2 -2
View File
@@ -16,7 +16,7 @@
class CommandNSSetGreet : public Command
{
public:
CommandNSSetGreet(Module *creator, const Anope::string &sname = "nickserv/set/greet", size_t min = 0, const Anope::string &spermission = "") : Command(creator, sname, min, min + 1, spermission)
CommandNSSetGreet(Module *creator, const Anope::string &sname = "nickserv/set/greet", size_t min = 0) : Command(creator, sname, min, min + 1)
{
this->SetDesc(_("Associate a greet message with your nickname"));
this->SetSyntax(_("\037message\037"));
@@ -66,7 +66,7 @@ class CommandNSSetGreet : public Command
class CommandNSSASetGreet : public CommandNSSetGreet
{
public:
CommandNSSASetGreet(Module *creator) : CommandNSSetGreet(creator, "nickserv/saset/greet", 1, "nickserv/saset/greet")
CommandNSSASetGreet(Module *creator) : CommandNSSetGreet(creator, "nickserv/saset/greet", 1)
{
this->ClearSyntax();
this->SetSyntax(_("\037nickname\037 \037message\037"));
+2 -2
View File
@@ -16,7 +16,7 @@
class CommandNSSetHide : public Command
{
public:
CommandNSSetHide(Module *creator, const Anope::string &sname = "nickserv/set/hide", size_t min = 2, const Anope::string &spermission = "") : Command(creator, sname, min, min + 1, spermission)
CommandNSSetHide(Module *creator, const Anope::string &sname = "nickserv/set/hide", size_t min = 2) : Command(creator, sname, min, min + 1)
{
this->SetDesc(_("Hide certain pieces of nickname information"));
this->SetSyntax(_("{EMAIL | STATUS | USERMASK | QUIT} {ON | OFF}"));
@@ -104,7 +104,7 @@ class CommandNSSetHide : public Command
class CommandNSSASetHide : public CommandNSSetHide
{
public:
CommandNSSASetHide(Module *creator) : CommandNSSetHide(creator, "nickserv/saset/hide", 3, "nickserv/saset/hide")
CommandNSSASetHide(Module *creator) : CommandNSSetHide(creator, "nickserv/saset/hide", 3)
{
this->SetSyntax("\037nickname\037 {EMAIL | STATUS | USERMASK | QUIT} {ON | OFF}");
}
+2 -2
View File
@@ -16,7 +16,7 @@
class CommandNSSetKill : public Command
{
public:
CommandNSSetKill(Module *creator, const Anope::string &sname = "nickserv/set/kill", size_t min = 1, const Anope::string &spermission = "") : Command(creator, sname, min, min + 1, spermission)
CommandNSSetKill(Module *creator, const Anope::string &sname = "nickserv/set/kill", size_t min = 1) : Command(creator, sname, min, min + 1)
{
this->SetDesc(_("Turn protection on or off"));
this->SetSyntax(_("{ON | QUICK | IMMED | OFF}"));
@@ -99,7 +99,7 @@ class CommandNSSetKill : public Command
class CommandNSSASetKill : public CommandNSSetKill
{
public:
CommandNSSASetKill(Module *creator) : CommandNSSetKill(creator, "nickserv/saset/kill", 2, "nickserv/saset/kill")
CommandNSSASetKill(Module *creator) : CommandNSSetKill(creator, "nickserv/saset/kill", 2)
{
this->SetSyntax(_("\037nickname\037 {ON | QUICK | IMMED | OFF}"));
}
+2 -2
View File
@@ -16,7 +16,7 @@
class CommandNSSetLanguage : public Command
{
public:
CommandNSSetLanguage(Module *creator, const Anope::string &sname = "nickserv/set/language", size_t min = 1, const Anope::string &spermission = "") : Command(creator, sname, min, min + 1, spermission)
CommandNSSetLanguage(Module *creator, const Anope::string &sname = "nickserv/set/language", size_t min = 1) : Command(creator, sname, min, min + 1)
{
this->SetDesc(_("Set the language Services will use when messaging you"));
this->SetSyntax(_("\037language\037"));
@@ -79,7 +79,7 @@ class CommandNSSetLanguage : public Command
class CommandNSSASetLanguage : public CommandNSSetLanguage
{
public:
CommandNSSASetLanguage(Module *creator) : CommandNSSetLanguage(creator, "nickserv/saset/language", 2, "nickserv/saset/language")
CommandNSSASetLanguage(Module *creator) : CommandNSSetLanguage(creator, "nickserv/saset/language", 2)
{
this->ClearSyntax();
this->SetSyntax(_("\037nickname\037 \037language\037"));
+2 -2
View File
@@ -16,7 +16,7 @@
class CommandNSSetMessage : public Command
{
public:
CommandNSSetMessage(Module *creator, const Anope::string &sname = "nickserv/set/message", size_t min = 1, const Anope::string &spermission = "") : Command(creator, sname, min, min + 1, spermission)
CommandNSSetMessage(Module *creator, const Anope::string &sname = "nickserv/set/message", size_t min = 1) : Command(creator, sname, min, min + 1)
{
this->SetDesc(_("Change the communication method of Services"));
this->SetSyntax(_("{ON | OFF}"));
@@ -73,7 +73,7 @@ class CommandNSSetMessage : public Command
class CommandNSSASetMessage : public CommandNSSetMessage
{
public:
CommandNSSASetMessage(Module *creator) : CommandNSSetMessage(creator, "nickserv/saset/message", 2, "nickserv/saset/message")
CommandNSSASetMessage(Module *creator) : CommandNSSetMessage(creator, "nickserv/saset/message", 2)
{
this->ClearSyntax();
this->SetSyntax(_("\037nickname\037 {ON | OFF}"));
+2 -2
View File
@@ -16,7 +16,7 @@
class CommandNSSetPrivate : public Command
{
public:
CommandNSSetPrivate(Module *creator, const Anope::string &sname = "nickserv/set/private", size_t min = 1, const Anope::string &spermission = "") : Command(creator, sname, min, min + 1, spermission)
CommandNSSetPrivate(Module *creator, const Anope::string &sname = "nickserv/set/private", size_t min = 1) : Command(creator, sname, min, min + 1)
{
this->SetDesc(Anope::printf(_("Prevent the nickname from appearing in a \002%s%s LIST\002"), Config->UseStrictPrivMsgString.c_str(), Config->NickServ.c_str()));
this->SetSyntax(_("{ON | OFF}"));
@@ -70,7 +70,7 @@ class CommandNSSetPrivate : public Command
class CommandNSSASetPrivate : public CommandNSSetPrivate
{
public:
CommandNSSASetPrivate(Module *creator) : CommandNSSetPrivate(creator, "nickserv/saset/private", 2, "nickserv/saset/private")
CommandNSSASetPrivate(Module *creator) : CommandNSSetPrivate(creator, "nickserv/saset/private", 2)
{
this->ClearSyntax();
this->SetSyntax(_("\037nickname\037 {ON | OFF}"));
+2 -2
View File
@@ -16,7 +16,7 @@
class CommandNSSetSecure : public Command
{
public:
CommandNSSetSecure(Module *creator, const Anope::string &sname = "nickserv/set/secure", size_t min = 1, const Anope::string &cpermission = "") : Command(creator, sname, min, min + 1, cpermission)
CommandNSSetSecure(Module *creator, const Anope::string &sname = "nickserv/set/secure", size_t min = 1) : Command(creator, sname, min, min + 1)
{
this->SetDesc(_("Turn nickname security on or off"));
this->SetSyntax(_("{ON | OFF}"));
@@ -69,7 +69,7 @@ class CommandNSSetSecure : public Command
class CommandNSSASetSecure : public CommandNSSetSecure
{
public:
CommandNSSASetSecure(Module *creator) : CommandNSSetSecure(creator, "nickserv/saset/secure", 2, "nickserv/saset/secure")
CommandNSSASetSecure(Module *creator) : CommandNSSetSecure(creator, "nickserv/saset/secure", 2)
{
this->ClearSyntax();
this->SetSyntax(_("\037nickname\037 {ON | OFF}"));
+2 -2
View File
@@ -16,7 +16,7 @@
class CommandNSSuspend : public Command
{
public:
CommandNSSuspend(Module *creator) : Command(creator, "nickserv/suspend", 2, 2, "nickserv/suspend")
CommandNSSuspend(Module *creator) : Command(creator, "nickserv/suspend", 2, 2)
{
this->SetDesc(_("Suspend a given nick"));
this->SetSyntax(_("\037nickname\037 \037reason\037"));
@@ -92,7 +92,7 @@ class CommandNSSuspend : public Command
class CommandNSUnSuspend : public Command
{
public:
CommandNSUnSuspend(Module *creator) : Command(creator, "nickserv/unsuspend", 1, 1, "nickserv/suspend")
CommandNSUnSuspend(Module *creator) : Command(creator, "nickserv/unsuspend", 1, 1)
{
this->SetDesc(_("Unsuspend a given nick"));
this->SetSyntax(_("\037nickname\037"));
+1 -1
View File
@@ -370,7 +370,7 @@ class CommandOSAKill : public Command
return;
}
public:
CommandOSAKill(Module *creator) : Command(creator, "operserv/akill", 1, 4, "operserv/akill")
CommandOSAKill(Module *creator) : Command(creator, "operserv/akill", 1, 4)
{
this->SetDesc(_("Manipulate the AKILL list"));
this->SetSyntax(_("ADD [+\037expiry\037] \037mask\037 \037reason\037"));
+1 -1
View File
@@ -18,7 +18,7 @@ static service_reference<XLineManager> akills("xlinemanager/sgline");
class CommandOSChanKill : public Command
{
public:
CommandOSChanKill(Module *creator) : Command(creator, "operserv/chankill", 2, 3, "operserv/chankill")
CommandOSChanKill(Module *creator) : Command(creator, "operserv/chankill", 2, 3)
{
this->SetDesc(_("AKILL all users on a specific channel"));
this->SetSyntax(_("[+\037expiry\037] \037channel\037 \037reason\037"));
+1 -1
View File
@@ -32,7 +32,7 @@ class CommandOSConfig : public Command
}
public:
CommandOSConfig(Module *creator) : Command(creator, "operserv/config", 1, 4, "operserv/config")
CommandOSConfig(Module *creator) : Command(creator, "operserv/config", 1, 4)
{
this->SetDesc(_("View and change configuration file settings"));
this->SetSyntax(_("{\037MODIFY\037|\037VIEW\037} [\037block name\037 \037item name\037 \037item value\037]"));
+1 -1
View File
@@ -77,7 +77,7 @@ class CommandOSForbid : public Command
{
service_reference<ForbidService> fs;
public:
CommandOSForbid(Module *creator) : Command(creator, "operserv/forbid", 1, 5, "operserv/forbid"), fs("forbid")
CommandOSForbid(Module *creator) : Command(creator, "operserv/forbid", 1, 5), fs("forbid")
{
this->SetDesc(_("Forbid usage of nicknames, channels, and emails"));
this->SetSyntax(_("ADD {NICK|CHAN|EMAIL} [+\037expiry\037] \037entry\037\002 [\037reason\037]"));
+1 -1
View File
@@ -233,7 +233,7 @@ class CommandOSIgnore : public Command
}
public:
CommandOSIgnore(Module *creator) : Command(creator, "operserv/ignore", 1, 4, "operserv/ignore")
CommandOSIgnore(Module *creator) : Command(creator, "operserv/ignore", 1, 4)
{
this->SetDesc(_("Modify the Services ignore list"));
this->SetSyntax(_("ADD \037time\037 \037nick\037 \037reason\037"));
+1 -1
View File
@@ -16,7 +16,7 @@
class CommandOSJupe : public Command
{
public:
CommandOSJupe(Module *creator) : Command(creator, "operserv/jupe", 1, 2, "operserv/jupe")
CommandOSJupe(Module *creator) : Command(creator, "operserv/jupe", 1, 2)
{
this->SetDesc(_("\"Jupiter\" a server"));
this->SetSyntax(_("\037server\037 [\037reason\037]"));
+1 -1
View File
@@ -16,7 +16,7 @@
class CommandOSKick : public Command
{
public:
CommandOSKick(Module *creator) : Command(creator, "operserv/kick", 3, 3, "operserv/kick")
CommandOSKick(Module *creator) : Command(creator, "operserv/kick", 3, 3)
{
this->SetDesc(_("Kick a user from a channel"));
this->SetSyntax(_("\037channel\037 \037user\037 \037reason\037"));
+1 -1
View File
@@ -16,7 +16,7 @@
class CommandOSKill : public Command
{
public:
CommandOSKill(Module *creator) : Command(creator, "operserv/kill", 1, 2, "operserv/kill")
CommandOSKill(Module *creator) : Command(creator, "operserv/kill", 1, 2)
{
this->SetDesc(_("Kill a user"));
this->SetSyntax(_("\037user\037 [\037reason\037]"));
+2 -2
View File
@@ -16,7 +16,7 @@
class CommandOSMode : public Command
{
public:
CommandOSMode(Module *creator) : Command(creator, "operserv/mode", 2, 2, "operserv/mode")
CommandOSMode(Module *creator) : Command(creator, "operserv/mode", 2, 2)
{
this->SetDesc(_("Change channel modes"));
this->SetSyntax(_("\037channel\037 \037modes\037"));
@@ -54,7 +54,7 @@ class CommandOSMode : public Command
class CommandOSUMode : public Command
{
public:
CommandOSUMode(Module *creator) : Command(creator, "operserv/umode", 2, 2, "operserv/umode")
CommandOSUMode(Module *creator) : Command(creator, "operserv/umode", 2, 2)
{
this->SetDesc(_("Change channel or user modes"));
this->SetSyntax(_("\037user\037 \037modes\037"));
+6 -4
View File
@@ -43,11 +43,13 @@ class CommandOSModInfo : public Command
{
BotInfo *bi = it->second;
for (command_map::const_iterator cit = bi->commands.begin(), cit_end = bi->commands.end(); cit != cit_end; ++cit)
for (BotInfo::command_map::const_iterator cit = bi->commands.begin(), cit_end = bi->commands.end(); cit != cit_end; ++cit)
{
if (cit->second != s->name)
const Anope::string &c_name = cit->first;
const CommandInfo &info = cit->second;
if (info.name != s->name)
continue;
source.Reply(_(" Command \002%s\002 on \002%s\002 is linked to \002%s\002"), cit->first.c_str(), bi->nick.c_str(), s->name.c_str());
source.Reply(_(" Command \002%s\002 on \002%s\002 is linked to \002%s\002"), c_name.c_str(), bi->nick.c_str(), s->name.c_str());
}
}
}
@@ -70,7 +72,7 @@ class CommandOSModInfo : public Command
class CommandOSModList : public Command
{
public:
CommandOSModList(Module *creator) : Command(creator, "operserv/modlist", 0, 1, "operserv/modlist")
CommandOSModList(Module *creator) : Command(creator, "operserv/modlist", 0, 1)
{
this->SetDesc(_("List loaded modules"));
this->SetSyntax(_("[Core|3rd|protocol|encryption|supported]"));
+3 -3
View File
@@ -16,7 +16,7 @@
class CommandOSModLoad : public Command
{
public:
CommandOSModLoad(Module *creator) : Command(creator, "operserv/modload", 1, 1, "operserv/modload")
CommandOSModLoad(Module *creator) : Command(creator, "operserv/modload", 1, 1)
{
this->SetDesc(_("Load a module"));
this->SetSyntax(_("\037modname\037"));
@@ -61,7 +61,7 @@ class CommandOSModLoad : public Command
class CommandOSModReLoad : public Command
{
public:
CommandOSModReLoad(Module *creator) : Command(creator, "operserv/modreload", 1, 1, "operserv/modload")
CommandOSModReLoad(Module *creator) : Command(creator, "operserv/modreload", 1, 1)
{
this->SetDesc(_("Reload a module"));
this->SetSyntax(_("\037modname\037"));
@@ -131,7 +131,7 @@ class CommandOSModReLoad : public Command
class CommandOSModUnLoad : public Command
{
public:
CommandOSModUnLoad(Module *creator) : Command(creator, "operserv/modunload", 1, 1, "operserv/modload")
CommandOSModUnLoad(Module *creator) : Command(creator, "operserv/modunload", 1, 1)
{
this->SetDesc(_("Un-Load a module"));
this->SetSyntax(_("\037modname\037"));
+1 -1
View File
@@ -216,7 +216,7 @@ class NewsBase : public Command
return;
}
public:
NewsBase(Module *creator, const Anope::string &newstype) : Command(creator, newstype, 1, 2, "operserv/news"), ns("news")
NewsBase(Module *creator, const Anope::string &newstype) : Command(creator, newstype, 1, 2), ns("news")
{
this->SetSyntax(_("ADD \037text\037"));
this->SetSyntax(_("DEL {\037num\037 | ALL}"));
+1 -1
View File
@@ -16,7 +16,7 @@
class CommandOSNOOP : public Command
{
public:
CommandOSNOOP(Module *creator) : Command(creator, "operserv/noop", 2, 2, "operserv/noop")
CommandOSNOOP(Module *creator) : Command(creator, "operserv/noop", 2, 2)
{
this->SetDesc(_("Temporarily remove all O:lines of a server remotely"));
this->SetSyntax(_("SET \037server\037"));
+1 -1
View File
@@ -16,7 +16,7 @@
class CommandOSOLine : public Command
{
public:
CommandOSOLine(Module *creator) : Command(creator, "operserv/oline", 2, 2, "operserv/oline")
CommandOSOLine(Module *creator) : Command(creator, "operserv/oline", 2, 2)
{
this->SetDesc(_("Give Operflags to a certain user"));
this->SetSyntax(_("\037nick\037 \037flags\037"));
+1 -1
View File
@@ -16,7 +16,7 @@
class CommandOSOper : public Command
{
public:
CommandOSOper(Module *creator) : Command(creator, "operserv/oper", 1, 3, "operserv/oper")
CommandOSOper(Module *creator) : Command(creator, "operserv/oper", 1, 3)
{
this->SetDesc(_("View and change services operators"));
this->SetSyntax(_("ADD \037oper\037 \037type\037"));
+1 -1
View File
@@ -16,7 +16,7 @@
class CommandOSReload : public Command
{
public:
CommandOSReload(Module *creator) : Command(creator, "operserv/reload", 0, 0, "operserv/reload")
CommandOSReload(Module *creator) : Command(creator, "operserv/reload", 0, 0)
{
this->SetDesc(_("Reload services' configuration file"));
this->SetSyntax("");
+1 -1
View File
@@ -266,7 +266,7 @@ class CommandOSSession : public Command
return;
}
public:
CommandOSSession(Module *creator) : Command(creator, "operserv/session", 2, 2, "operserv/session")
CommandOSSession(Module *creator) : Command(creator, "operserv/session", 2, 2)
{
this->SetDesc(_("View the list of host sessions"));
this->SetSyntax(_("LIST \037threshold\037"));
+1 -1
View File
@@ -168,7 +168,7 @@ class CommandOSSet : public Command
return;
}
public:
CommandOSSet(Module *creator) : Command(creator, "operserv/set", 1, 2, "operserv/set")
CommandOSSet(Module *creator) : Command(creator, "operserv/set", 1, 2)
{
this->SetDesc(_("Set various global Services options"));
this->SetSyntax(_("\037option\037 \037setting\037"));
+3 -3
View File
@@ -16,7 +16,7 @@
class CommandOSQuit : public Command
{
public:
CommandOSQuit(Module *creator) : Command(creator, "operserv/quit", 0, 0, "operserv/quit")
CommandOSQuit(Module *creator) : Command(creator, "operserv/quit", 0, 0)
{
this->SetDesc(_("Terminate Services WITHOUT saving"));
this->SetSyntax("");
@@ -45,7 +45,7 @@ class CommandOSQuit : public Command
class CommandOSRestart : public Command
{
public:
CommandOSRestart(Module *creator) : Command(creator, "operserv/restart", 0, 0, "operserv/restart")
CommandOSRestart(Module *creator) : Command(creator, "operserv/restart", 0, 0)
{
this->SetDesc(_("Save databases and restart Services"));
this->SetSyntax("");
@@ -72,7 +72,7 @@ class CommandOSRestart : public Command
class CommandOSShutdown : public Command
{
public:
CommandOSShutdown(Module *creator) : Command(creator, "operserv/shutdown", 0, 0, "operserv/shutdown")
CommandOSShutdown(Module *creator) : Command(creator, "operserv/shutdown", 0, 0)
{
this->SetDesc(_("Terminate services with save"));
this->SetSyntax("");
+1 -1
View File
@@ -157,7 +157,7 @@ class CommandOSStats : public Command
}
public:
CommandOSStats(Module *creator) : Command(creator, "operserv/stats", 0, 1, "operserv/stats"),
CommandOSStats(Module *creator) : Command(creator, "operserv/stats", 0, 1),
akills("xlinemanager/sgline"), snlines("xlinemanager/snline"), sqlines("xlinemanager/sqline"), szlines("xlinemanager/szline")
{
this->SetDesc(_("Show status of Services and network"));
+1 -1
View File
@@ -16,7 +16,7 @@
class CommandOSSVSNick : public Command
{
public:
CommandOSSVSNick(Module *creator) : Command(creator, "operserv/svsnick", 2, 2, "operserv/svsnick")
CommandOSSVSNick(Module *creator) : Command(creator, "operserv/svsnick", 2, 2)
{
this->SetDesc(_("Forcefully change a user's nickname"));
this->SetSyntax(_("\037nick\037 \037newnick\037"));
+4 -4
View File
@@ -278,7 +278,7 @@ class CommandOSSXLineBase : public Command
return;
}
public:
CommandOSSXLineBase(Module *creator, const Anope::string &cmd, const Anope::string &perm) : Command(creator, cmd, 1, 3, perm)
CommandOSSXLineBase(Module *creator, const Anope::string &cmd) : Command(creator, cmd, 1, 3)
{
this->SetDesc(Anope::printf(_("Manipulate the %s list"), cmd.c_str()));
this->SetSyntax(_("ADD [+\037expiry\037] \037mask\037:\037reason\037"));
@@ -430,7 +430,7 @@ class CommandOSSNLine : public CommandOSSXLineBase
service_reference<XLineManager> snlines;
public:
CommandOSSNLine(Module *creator) : CommandOSSXLineBase(creator, "SNLINE", "operserv/snline"), snlines("xlinemanager/snline")
CommandOSSNLine(Module *creator) : CommandOSSXLineBase(creator, "operserv/snline"), snlines("xlinemanager/snline")
{
}
@@ -580,7 +580,7 @@ class CommandOSSQLine : public CommandOSSXLineBase
service_reference<XLineManager> sqlines;
public:
CommandOSSQLine(Module *creator) : CommandOSSXLineBase(creator, "SQLINE", "operserv/sqline"), sqlines("xlinemanager/sqline")
CommandOSSQLine(Module *creator) : CommandOSSXLineBase(creator, "operserv/sqline"), sqlines("xlinemanager/sqline")
{
}
@@ -736,7 +736,7 @@ class CommandOSSZLine : public CommandOSSXLineBase
service_reference<XLineManager> szlines;
public:
CommandOSSZLine(Module *creator) : CommandOSSXLineBase(creator, "SZLINE", "operserv/szline"), szlines("xlinemanager/szline")
CommandOSSZLine(Module *creator) : CommandOSSXLineBase(creator, "operserv/szline"), szlines("xlinemanager/szline")
{
}
+1 -1
View File
@@ -16,7 +16,7 @@
class CommandOSUpdate : public Command
{
public:
CommandOSUpdate(Module *creator) : Command(creator, "operserv/update", 0, 0, "operserv/update")
CommandOSUpdate(Module *creator) : Command(creator, "operserv/update", 0, 0)
{
this->SetDesc(_("Force the Services databases to be updated immediately"));
this->SetSyntax("");
+2 -2
View File
@@ -15,7 +15,7 @@
class CommandCSSetMisc : public Command
{
public:
CommandCSSetMisc(Module *creator, const Anope::string &cname = "chanserv/set/misc", const Anope::string &cpermission = "") : Command(creator, cname, 1, 2, cpermission)
CommandCSSetMisc(Module *creator, const Anope::string &cname = "chanserv/set/misc") : Command(creator, cname, 1, 2)
{
this->SetSyntax(_("\037channel\037 \037parameters\037"));
}
@@ -43,7 +43,7 @@ class CommandCSSetMisc : public Command
class CommandCSSASetMisc : public CommandCSSetMisc
{
public:
CommandCSSASetMisc(Module *creator) : CommandCSSetMisc(creator, "chanserv/saset/misc", "chanserv/saset/misc")
CommandCSSASetMisc(Module *creator) : CommandCSSetMisc(creator, "chanserv/saset/misc")
{
}
};
+3 -3
View File
@@ -134,7 +134,7 @@ class CommandHSRequest : public Command
class CommandHSActivate : public Command
{
public:
CommandHSActivate(Module *creator) : Command(creator, "hostserv/activate", 1, 1, "hostserv/set")
CommandHSActivate(Module *creator) : Command(creator, "hostserv/activate", 1, 1)
{
this->SetDesc(_("Approve the requested vHost of a user"));
this->SetSyntax(_("\037nick\037"));
@@ -187,7 +187,7 @@ class CommandHSActivate : public Command
class CommandHSReject : public Command
{
public:
CommandHSReject(Module *creator) : Command(creator, "hostserv/reject", 1, 2, "hostserv/set")
CommandHSReject(Module *creator) : Command(creator, "hostserv/reject", 1, 2)
{
this->SetDesc(_("Reject the requested vHost of a user"));
}
@@ -264,7 +264,7 @@ class HSListBase : public Command
return;
}
public:
HSListBase(Module *creator, const Anope::string &cmd, int min, int max) : Command(creator, cmd, min, max, "hostserv/set")
HSListBase(Module *creator, const Anope::string &cmd, int min, int max) : Command(creator, cmd, min, max)
{
}
};
+1 -1
View File
@@ -46,7 +46,7 @@ class AsynchCommandMutex : public CommandMutex
return;
}
if (!command->permission.empty() && !u->HasCommand(command->permission))
if (!this->source.permission.empty() && !u->HasCommand(this->source.permission))
{
u->SendMessage(bi, ACCESS_DENIED);
Log(LOG_COMMAND, "denied", bi) << "Access denied for user " << u->GetMask() << " with command " << command;
+2 -2
View File
@@ -16,7 +16,7 @@
class CommandNSSetMisc : public Command
{
public:
CommandNSSetMisc(Module *creator, const Anope::string &cname = "nickserv/set/misc", const Anope::string &cpermission = "", size_t min = 1) : Command(creator, cname, min, min + 1, cpermission)
CommandNSSetMisc(Module *creator, const Anope::string &cname = "nickserv/set/misc", size_t min = 1) : Command(creator, cname, min, min + 1)
{
this->SetSyntax(_("\037parameter\037"));
}
@@ -52,7 +52,7 @@ class CommandNSSetMisc : public Command
class CommandNSSASetMisc : public CommandNSSetMisc
{
public:
CommandNSSASetMisc(Module *creator) : CommandNSSetMisc(creator, "nickserv/saset/misc", "nickserv/saset/misc", 2)
CommandNSSASetMisc(Module *creator) : CommandNSSetMisc(creator, "nickserv/saset/misc", 2)
{
this->ClearSyntax();
this->SetSyntax(_("\037nickname\037 \037parameter\037"));
+1 -1
View File
@@ -163,7 +163,7 @@ class CommandOSDefcon : public Command
}
public:
CommandOSDefcon(Module *creator) : Command(creator, "operserv/defcon", 1, 1, "operserv/defcon")
CommandOSDefcon(Module *creator) : Command(creator, "operserv/defcon", 1, 1)
{
this->SetDesc(_("Manipulate the DefCon system"));
this->SetSyntax(_("[\0021\002|\0022\002|\0023\002|\0024\002|\0025\002]"));
+31 -4
View File
@@ -203,7 +203,7 @@ void BotInfo::OnMessage(User *u, const Anope::string &message)
{
std::vector<Anope::string> params = BuildStringVector(message);
command_map::iterator it = this->commands.end();
BotInfo::command_map::iterator it = this->commands.end();
unsigned count = 0;
for (unsigned max = params.size(); it == this->commands.end() && max > 0; --max)
{
@@ -222,11 +222,12 @@ void BotInfo::OnMessage(User *u, const Anope::string &message)
return;
}
service_reference<Command> c(it->second);
CommandInfo &info = it->second;
service_reference<Command> c(info.name);
if (!c)
{
u->SendMessage(this, _("Unknown command \002%s\002. \"%s%s HELP\" for help."), message.c_str(), Config->UseStrictPrivMsgString.c_str(), this->nick.c_str());
Log(this) << "Command " << it->first << " exists on me, but its service " << it->second << " was not found!";
Log(this) << "Command " << it->first << " exists on me, but its service " << info.name << " was not found!";
return;
}
@@ -253,6 +254,7 @@ void BotInfo::OnMessage(User *u, const Anope::string &message)
source.owner = this;
source.service = this;
source.command = it->first;
source.permission = info.permission;
EventReturn MOD_RESULT;
FOREACH_RESULT(I_OnPreCommand, OnPreCommand(source, c, params));
@@ -271,7 +273,7 @@ void BotInfo::OnMessage(User *u, const Anope::string &message)
}
// If the command requires a permission, and they aren't registered or don't have the required perm, DENIED
if (!c->permission.empty() && !u->HasCommand(c->permission))
if (!info.permission.empty() && !u->HasCommand(info.permission))
{
u->SendMessage(this, ACCESS_DENIED);
Log(LOG_COMMAND, "denied", this) << "Access denied for user " << u->GetMask() << " with command " << c->name;
@@ -289,3 +291,28 @@ void BotInfo::OnMessage(User *u, const Anope::string &message)
}
}
/** Link a command name to a command in services
* @param cname The command name
* @param sname The service name
* @param permission Permission required to execute the command, if any
*/
void BotInfo::SetCommand(const Anope::string &cname, const Anope::string &sname, const Anope::string &permission)
{
CommandInfo ci;
ci.name = sname;
ci.permission = permission;
this->commands[cname] = ci;
}
/** Get command info for a command
* @param cname The command name
* @return A struct containing service name and permission
*/
CommandInfo *BotInfo::GetCommand(const Anope::string &cname)
{
command_map::iterator it = this->commands.find(cname);
if (it != this->commands.end())
return &it->second;
return NULL;
}
+1 -6
View File
@@ -56,7 +56,7 @@ void CommandSource::DoReply()
}
}
Command::Command(Module *o, const Anope::string &sname, size_t min_params, size_t max_params, const Anope::string &spermission) : Service(o, sname), Flags<CommandFlag>(CommandFlagStrings), MaxParams(max_params), MinParams(min_params), permission(spermission), module(owner)
Command::Command(Module *o, const Anope::string &sname, size_t min_params, size_t max_params) : Service(o, sname), Flags<CommandFlag>(CommandFlagStrings), MaxParams(max_params), MinParams(min_params), module(owner)
{
}
@@ -113,8 +113,3 @@ void Command::OnSyntaxError(CommandSource &source, const Anope::string &subcomma
source.Reply(MORE_INFO, Config->UseStrictPrivMsgString.c_str(), source.owner->nick.c_str(), source.command.c_str());
}
void Command::SetPermission(const Anope::string &reststr)
{
this->permission = reststr;
}
+5 -6
View File
@@ -871,6 +871,7 @@ static bool DoCommands(ServerConfig *config, const Anope::string &, const Anope:
Anope::string service = values[0].GetValue();
Anope::string name = values[1].GetValue();
Anope::string command = values[2].GetValue();
Anope::string permission = values[3].GetValue();
ValueItem vi(service);
if (!ValidateNotEmpty(config, "command", "service", vi))
@@ -891,7 +892,7 @@ static bool DoCommands(ServerConfig *config, const Anope::string &, const Anope:
if (bi->commands.count(name))
throw ConfigException("Command name " + name + " already exists on " + bi->nick);
bi->commands[name] = command;
bi->SetCommand(name, command, permission);
return true;
}
@@ -1127,7 +1128,6 @@ ConfigItems::ConfigItems(ServerConfig *conf)
{"nickserv", "releasetimeout", "0", new ValueContainerTime(&conf->NSReleaseTimeout), DT_TIME, ValidateNotZero},
{"nickserv", "allowkillimmed", "no", new ValueContainerBool(&conf->NSAllowKillImmed), DT_BOOLEAN | DT_NORELOAD, NoValidation},
{"nickserv", "nogroupchange", "no", new ValueContainerBool(&conf->NSNoGroupChange), DT_BOOLEAN, NoValidation},
{"nickserv", "listopersonly", "no", new ValueContainerBool(&conf->NSListOpersOnly), DT_BOOLEAN, NoValidation},
{"nickserv", "listmax", "0", new ValueContainerUInt(&conf->NSListMax), DT_UINTEGER, ValidateNotZero},
{"nickserv", "guestnickprefix", "", new ValueContainerString(&conf->NSGuestNickPrefix), DT_STRING, ValidateGuestPrefix},
{"nickserv", "secureadmins", "no", new ValueContainerBool(&conf->NSSecureAdmins), DT_BOOLEAN, NoValidation},
@@ -1154,7 +1154,6 @@ ConfigItems::ConfigItems(ServerConfig *conf)
{"chanserv", "autokickmax", "0", new ValueContainerUInt(&conf->CSAutokickMax), DT_UINTEGER, ValidateChanServ},
{"chanserv", "autokickreason", "User has been banned from the channel", new ValueContainerString(&conf->CSAutokickReason), DT_STRING, ValidateChanServ},
{"chanserv", "inhabit", "0", new ValueContainerTime(&conf->CSInhabit), DT_TIME, ValidateChanServ},
{"chanserv", "listopersonly", "no", new ValueContainerBool(&conf->CSListOpersOnly), DT_BOOLEAN, ValidateChanServ},
{"chanserv", "listmax", "0", new ValueContainerUInt(&conf->CSListMax), DT_UINTEGER, ValidateChanServ},
{"chanserv", "opersonly", "no", new ValueContainerBool(&conf->CSOpersOnly), DT_BOOLEAN, ValidateChanServ},
{"memoserv", "name", "", new ValueContainerString(&conf->MemoServ), DT_STRING, NoValidation},
@@ -1242,9 +1241,9 @@ ConfigItems::ConfigItems(ServerConfig *conf)
{DT_STRING, DT_STRING, DT_INTEGER, DT_BOOLEAN, DT_STRING, DT_STRING, DT_STRING, DT_STRING, DT_STRING, DT_STRING, DT_STRING, DT_BOOLEAN, DT_BOOLEAN},
InitLogs, DoLogs, DoneLogs},
{"command",
{"service", "name", "command", ""},
{"", "", "", ""},
{DT_STRING, DT_STRING, DT_STRING},
{"service", "name", "command", "permission", ""},
{"", "", "", "", ""},
{DT_STRING, DT_STRING, DT_STRING, DT_STRING},
InitCommands, DoCommands, DoneCommands},
{"",
{""},