env.rb 471 B

12345678910111213141516171819
  1. # Copyright (C) 2012-2016 Zammad Foundation, http://zammad-foundation.org/
  2. module Sso::Env
  3. def self.check( _params, _config_item )
  4. # try to find user based on login
  5. if ENV['REMOTE_USER']
  6. user = User.where( login: ENV['REMOTE_USER'], active: true ).first
  7. return user if user
  8. end
  9. if ENV['HTTP_REMOTE_USER']
  10. user = User.where( login: ENV['HTTP_REMOTE_USER'], active: true ).first
  11. return user if user
  12. end
  13. false
  14. end
  15. end