From 192eb9706d0e4606ef90e45e7c2c980d6e39baa7 Mon Sep 17 00:00:00 2001 From: Marc Wickenden Date: Fri, 3 Aug 2012 22:14:20 +0100 Subject: [PATCH] disable twitter and email notifications by default --- extensions/notifications/config.yaml | 12 ++++++------ extensions/notifications/notifications.rb | 13 +++++++++---- 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/extensions/notifications/config.yaml b/extensions/notifications/config.yaml index e3957dab8..bac1a0318 100644 --- a/extensions/notifications/config.yaml +++ b/extensions/notifications/config.yaml @@ -19,12 +19,12 @@ beef: enable: true name: Notifications twitter: - enable: true - consumer_key: your_app_consumer_key - consumer_secret: your_app_consumer_secret - oauth_token: your_twitter_access_token_for_this_app - oauth_token_secret: your_twitter_access_secret_for_this_app - target_username: your_twitter_username + enable: false + consumer_key: consumer_key + consumer_secret: consumer_secret + oauth_token: oauth_token_for_this_app + oauth_token_secret: oauth_token_secret_for_this_app + target_username: twitter_handle_to_receive_tweet email: enable: false from_address: your_email_address diff --git a/extensions/notifications/notifications.rb b/extensions/notifications/notifications.rb index e4a447b3d..b9e5cbb94 100644 --- a/extensions/notifications/notifications.rb +++ b/extensions/notifications/notifications.rb @@ -37,12 +37,17 @@ module Notifications @hb = hb end - username = @config.get('beef.extension.notifications.twitter.target_username') - to_address = @config.get('beef.extension.notifications.email.to_address') message = "#{from} #{event} #{time_now} #{hb}" - BeEF::Extension::Notifications::Channels::Tweet.new(username,message) - BeEF::Extension::Notifications::Channels::Email.new(to_address,message) + if @config.get('beef.extension.notifications.twitter.enable') == true + username = @config.get('beef.extension.notifications.twitter.target_username') + BeEF::Extension::Notifications::Channels::Tweet.new(username,message) + end + + if @config.get('beef.extension.notifications.email.enable') == true + to_address = @config.get('beef.extension.notifications.email.to_address') + BeEF::Extension::Notifications::Channels::Email.new(to_address,message) + end end end