Guest User

Untitled

a guest
Oct 12th, 2011
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.94 KB | None | 0 0
  1. module Authlogic
  2. module Session
  3. module Callbacks
  4. def self.included(base) #:nodoc:
  5. base.send :include, ActiveSupport::Callbacks
  6. base.define_callbacks *METHODS
  7. base.define_callbacks :persist, :terminator => "result == true"
  8.  
  9. # If Rails 3, support the new callback syntax
  10. if base.send(base.respond_to?(:singleton_class) ? :singleton_class : :metaclass).method_defined?(:set_callback)
  11. METHODS.each do |method|
  12. base.class_eval <<-"end_eval", __FILE__, __LINE__
  13. def self.#{method}(*methods, &block)
  14. set_callback :#{method}, *methods, &block
  15. end
  16. end_eval
  17. end
  18. end
  19. end
  20. end
  21. end
  22. module ControllerAdapters
  23. class AbstractAdapter
  24.  
  25. def responds_to_http_auth_allowed?
  26. controller.respond_to?(:http_auth_allowed?, true)
  27. end
  28.  
  29. def http_auth_allowed?
  30. controller.send(:http_auth_allowed?)
  31. end
  32.  
  33. end
  34. end
  35. end
Advertisement
Add Comment
Please, Sign In to add comment