cirandas.net

ref: master

plugins/oauth_client/controllers/oauth_client_plugin_admin_controller.rb


 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
class OauthClientPluginAdminController < AdminController

  def index
  end

  def new
    @provider = environment.oauth_providers.new
    render :file => 'oauth_client_plugin_admin/edit'
  end

  def remove
    environment.oauth_providers.find(params[:id]).destroy
    redirect_to :action => 'index'
  end

  def edit
    @provider = params[:id] ? environment.oauth_providers.find(params[:id]) : environment.oauth_providers.new
    if request.post?
      if @provider.update(params['oauth_client_plugin_provider'])
        session[:notice] = _('Saved!')
      else
        session[:notice] = _('Error!')
      end
    end
  end

end