From 6b903407ed8ab8d53129821307c760e4d68ad259 Mon Sep 17 00:00:00 2001 From: reality Date: Sat, 12 Jan 2013 09:49:41 +0000 Subject: [PATCH] Used access parameter on all elevated access commadns I can think of [#124] --- modules/js/js.js | 10 ++--- modules/quotes/quotes.js | 33 ++++++++-------- modules/users/users.js | 83 ++++++++++++++++++++-------------------- 3 files changed, 62 insertions(+), 64 deletions(-) diff --git a/modules/js/js.js b/modules/js/js.js index 76d5f91..917e0a5 100644 --- a/modules/js/js.js +++ b/modules/js/js.js @@ -22,17 +22,17 @@ var js = function(dbot) { // Run JS code un-sandboxed, with access to DBot memory (admin-only). '~ajs': function(event) { - if(dbot.config.admins.include(event.user) ) { - var ret = eval(event.input[1]); - if(ret !== undefined) { - event.reply(ret); - } + var ret = eval(event.input[1]); + if(ret !== undefined) { + event.reply(ret); } } }; commands['~js'].regex = [/^~js (.*)/, 2]; commands['~ajs'].regex = [/^~ajs (.*)/, 2]; + commands['~ajs'].access = 'admin'; + return { 'name': 'js', 'ignorable': true, diff --git a/modules/quotes/quotes.js b/modules/quotes/quotes.js index c93307e..9d605f1 100644 --- a/modules/quotes/quotes.js +++ b/modules/quotes/quotes.js @@ -93,28 +93,24 @@ var quotes = function(dbot) { }, '~rmconfirm': function(event) { - if(dbot.config.admins.include(event.user)) { - var rmCacheCount = rmCache.length; - rmCache.length = 0; - event.reply(dbot.t('quote_cache_cleared', - { 'count': rmCacheCount })); - } + var rmCacheCount = rmCache.length; + rmCache.length = 0; + event.reply(dbot.t('quote_cache_cleared', + { 'count': rmCacheCount })); }, '~rmdeny': function(event) { - if(dbot.config.admins.include(event.user)) { - var rmCacheCount = rmCache.length; - for(var i=0;i