diff options
-rw-r--r-- | application.rb | 5 | ||||
-rw-r--r-- | helper.rb | 30 | ||||
-rw-r--r-- | model.rb | 2 |
3 files changed, 4 insertions, 33 deletions
diff --git a/application.rb b/application.rb index 8ace27c..d2ee131 100644 --- a/application.rb +++ b/application.rb @@ -9,8 +9,9 @@ require 'ftools' require File.join(File.dirname(__FILE__),'model.rb') require File.join(File.dirname(__FILE__),'helper.rb') -use Rack::Session::Cookie, :expire_after => 28800, - :secret => "ui6vaiNi-change_me" +#moved to wrapper->environment +#use Rack::Session::Cookie, :expire_after => 28800, +# :secret => "ui6vaiNi-change_me" use Rack::Flash set :lock, true @@ -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]) @@ -31,7 +31,7 @@ class ToxCreateModel < Ohm::Model attribute :nr_compounds attribute :nr_predictions attribute :correct_predictions - attribute :weighted_area_under_roc + attribute :average_area_under_roc attribute :sensitivity attribute :specificity attribute :r_square |