Commit 628cf369 authored by o@immerda.ch's avatar o@immerda.ch
Browse files

support onion and fix lang selection on redirect

parent 6bdb3985
......@@ -56,6 +56,7 @@ class ApplicationController < ActionController::Base
def authorize
if !current_user
set_locale
page = request.env['PATH_INFO']
if page != '/'
redirect_to "/login?p=#{page}"
......
......@@ -135,4 +135,13 @@ class SessionsController < ApplicationController
@news_frame = news_frame
end
end
def webmail_url
if request.host =~ /ysp4gfuhnmj6b4mb\.onion/
"https://webmail.ysp4gfuhnmj6b4mb.onion/"
else
"https://webmail.immerda.ch/"
end
end
helper_method :webmail_url
end
......@@ -10,7 +10,7 @@
<%= t(:logging_into, target: t("handoff.#{@handoff}")) %>
<% if @handoff == 'webmail' %>
<div style="display:none">
<%= form_tag("https://webmail.immerda.ch/login.php", method: "post") do %>
<%= form_tag(webmail_url+"/login.php", method: "post") do %>
<%= hidden_field('', :horde_user, :value => @user) %>
<%= hidden_field('', :horde_pass, :value => @pw) %>
<%= hidden_field('', :login_post, :value => 1) %>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment