Created
April 15, 2010 18:03
-
-
Save jjulian/367418 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def handle_approved(handle) | |
allowed = YAML::load_file('/var/www/allowed.yml') | |
allowed.include?(handle.downcase) | |
end | |
# in the action, after the twitter handle is pulled from oauth | |
if !handle_approved(handle) | |
reset_session | |
flash[:notice] = 'Sorry, your username is not allowed' | |
logger.error "denied access for #{handle}" | |
redirect_to root_url and return | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment