diff options
author | Christoph Helma <helma@in-silico.ch> | 2011-08-22 11:12:47 +0000 |
---|---|---|
committer | Christoph Helma <helma@in-silico.ch> | 2011-08-22 11:12:47 +0000 |
commit | 28da7a09067ee75b07f7c11ab83b6d4d54048384 (patch) | |
tree | 7678aac801aa6b73723ba05c7bcc097546a91788 /helper.rb | |
parent | 3b7a80f1af7e8b68f2f8bc9fd137ec9be5658c20 (diff) | |
parent | a4b6e68acf76949a1765177b6d5b8c454990cb8a (diff) |
Merge branch 'development' of github.com:opentox/toxcreate into development
Conflicts:
application.rb
Diffstat (limited to 'helper.rb')
-rw-r--r-- | helper.rb | 30 |
1 files changed, 0 insertions, 30 deletions
@@ -1,35 +1,5 @@ helpers do - def login(username, password) - logout - session[:subjectid] = OpenTox::Authorization.authenticate(username, password) - #LOGGER.debug "ToxCreate login user #{username} with subjectid: " + session[:subjectid].to_s - if session[:subjectid] != nil - session[:username] = username - return true - else - session[:username] = "" - return false - end - end - - def logout - if session[:subjectid] != nil - session[:subjectid] = nil - session[:username] = "" - return true - end - return false - end - - def logged_in() - return true if !AA_SERVER - if session[:subjectid] != nil - return OpenTox::Authorization.is_token_valid(session[:subjectid]) - end - return false - end - def is_authorized(uri, action) if OpenTox::Authorization.server && session[:subjectid] != nil return OpenTox::Authorization.authorized?(uri, action, session[:subjectid]) |