Commit 642d0fb041fd5acb22c5fa60cf657635245379ce

Authored by Vitor Barbosa de Araujo
Committed by Matheus Miranda Lacerda
1 parent cf1bed68

Initializing admin option for external login

Signed-off-by: Sabryna Sousa <sabryna.sousa1323@gmail.com>
Signed-off-by: Victor Navarro <victor.matias.navarro@gmail.com>
Signed-off-by: Vitor Barbosa <vitornga15@gmail.com>
plugins/oauth_client/controllers/oauth_client_plugin_admin_controller.rb
... ... @@ -24,4 +24,8 @@ class OauthClientPluginAdminController &lt; AdminController
24 24 end
25 25 end
26 26  
  27 + def edit_login_option
  28 + option = params['oauth_client_plugin_option']
  29 + end
  30 +
27 31 end
... ...
plugins/oauth_client/db/migrate/20160714113820_create_oauth_client_plugin_config.rb 0 → 100644
... ... @@ -0,0 +1,9 @@
  1 +class CreateOauthClientPluginConfig < ActiveRecord::Migration
  2 +
  3 + def change
  4 + create_table :oauth_client_plugin_configs do |t|
  5 + t.belongs_to :environment
  6 + t.boolean :create_account_for_login, :default => false
  7 + end
  8 + end
  9 +end
... ...
plugins/oauth_client/models/oauth_client_plugin/config.rb 0 → 100644
... ... @@ -0,0 +1,7 @@
  1 +class OauthClientPlugin::Config < ApplicationRecord
  2 +
  3 + belongs_to :environment
  4 +
  5 + attr_accessible :create_account_for_login
  6 +
  7 +end
... ...
plugins/oauth_client/views/oauth_client_plugin_admin/index.html.erb
1 1 <h1><%= _('Oauth Client Settings') %></h1>
  2 +
  3 +<%= labelled_form_for("") do |f| %>
  4 + <table>
  5 + <tr>
  6 + <%= hidden_field_tag('environment[enabled_features][]', '') %>
  7 + <td><%= _('Only allow login with creation of new account') %></td>
  8 + <td><%= check_box_tag "environment[enabled_features][]","" ,"" %></td>
  9 + </tr>
  10 + </table>
  11 +
  12 + <div>
  13 + <%= button_bar do %>
  14 + <%= submit_button('save', _('Save changes')) %>
  15 + <%= button :back, _('Back to plugins panel'), :controller => 'plugins', :action => 'index' %>
  16 + <% end %>
  17 + </div>
  18 +<% end %>
  19 +
2 20 <h3><%= _('Providers') %></h3>
3 21 <%= button :add, _('New'), {:action => 'new'} %>
4 22 <table>
... ...