From c03a60c236aec413d7c7a2fbb718e17516def230 Mon Sep 17 00:00:00 2001 From: Andreas Stephanides Date: Sat, 26 May 2018 08:43:49 +0200 Subject: [PATCH 1/3] developer login added --- config/initializers/devise.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/config/initializers/devise.rb b/config/initializers/devise.rb index af9af25..e2c8198 100755 --- a/config/initializers/devise.rb +++ b/config/initializers/devise.rb @@ -236,6 +236,8 @@ Devise.setup do |config| :bind_dn =>secrets["ldap"]['bind'], :password => secrets["ldap"]['password'] + config.omniauth :developer if Rails.env.development? + # ==> Warden configuration<< # If you want to use other strategies, that are not supported by Devise, or # change the failure app, you can configure them inside the config.warden block. From 52fcabf2dcd0f939b7a3cf3e1fb7eeb8301e4d5b Mon Sep 17 00:00:00 2001 From: Andreas Stephanides Date: Sat, 26 May 2018 08:43:25 +0200 Subject: [PATCH 2/3] fix login menu --- app/views/layouts/menu.html.erb | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/app/views/layouts/menu.html.erb b/app/views/layouts/menu.html.erb index e3ac8d5..5373f70 100644 --- a/app/views/layouts/menu.html.erb +++ b/app/views/layouts/menu.html.erb @@ -43,9 +43,20 @@
  • <%= link_to image_tag("/flaggen/png/gb.png") + " English" ,switch_locale_url(:en)%>
  • -
  • - <%= link_to ffi1_icon("academic") + I18n.t('home.login'), user_omniauth_authorize_path(:ldap) %> - <%# render 'layouts/login' %> +
  • +
  • + <% if not user_signed_in? %> + <% if Rails.env.development? %> + <%# link_to I18n.t('home.login'), user_omniauth_authorize_path(:developer) %> + <%= render 'layouts/login' %> + + <% else %> + <%= link_to ffi1_icon("academic") + I18n.t('home.login'), user_omniauth_authorize_path(:ldap) %> + <% end %> + <% else %> + <%= render 'layouts/login' %> + <% end %> +