mirror of
https://github.com/discourse/discourse.git
synced 2025-08-21 19:11:18 +08:00
working plugin interface for custom openid auth, custom css and custom js
This commit is contained in:
parent
61b330abb4
commit
160107a712
12 changed files with 422 additions and 95 deletions
|
@ -23,6 +23,31 @@ module Discourse
|
|||
# Cross site request forgery
|
||||
class CSRF < Exception; end
|
||||
|
||||
def self.activate_plugins!
|
||||
@plugins = Plugin.find_all("#{Rails.root}/plugins")
|
||||
@plugins.each do |plugin|
|
||||
plugin.activate!
|
||||
end
|
||||
end
|
||||
|
||||
def self.plugins
|
||||
@plugins
|
||||
end
|
||||
|
||||
def self.auth_providers
|
||||
providers = nil
|
||||
if plugins
|
||||
plugins.each do |p|
|
||||
next unless p.auth_providers
|
||||
p.auth_providers.each do |prov|
|
||||
providers ||= []
|
||||
providers << prov
|
||||
end
|
||||
end
|
||||
end
|
||||
providers
|
||||
end
|
||||
|
||||
def self.cache
|
||||
@cache ||= Cache.new
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue