Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
birger
users
Commits
628cf369
Commit
628cf369
authored
Sep 02, 2018
by
o@immerda.ch
Browse files
support onion and fix lang selection on redirect
parent
6bdb3985
Changes
3
Hide whitespace changes
Inline
Side-by-side
app/controllers/application_controller.rb
View file @
628cf369
...
...
@@ -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
}
"
...
...
app/controllers/sessions_controller.rb
View file @
628cf369
...
...
@@ -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
app/views/sessions/handoff.html.erb
View file @
628cf369
...
...
@@ -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
)
%>
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment