disable twitter and email notifications by default

This commit is contained in:
Marc Wickenden
2012-08-03 22:14:20 +01:00
parent bd4b28ae3c
commit 192eb9706d
2 changed files with 15 additions and 10 deletions

View File

@@ -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

View File

@@ -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