Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
93bbc1f9
Commit
93bbc1f9
authored
Oct 18, 2016
by
Rémy Coutable
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix sign-in box and Kerberos login
Signed-off-by:
Rémy Coutable
<
remy@rymai.me
>
parent
d572f492
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
42 additions
and
57 deletions
+42
-57
app/assets/stylesheets/pages/login.scss
app/assets/stylesheets/pages/login.scss
+6
-0
app/views/devise/sessions/_new_crowd.html.haml
app/views/devise/sessions/_new_crowd.html.haml
+3
-3
app/views/devise/sessions/_new_kerberos.html.haml
app/views/devise/sessions/_new_kerberos.html.haml
+8
-5
app/views/devise/sessions/_new_ldap.html.haml
app/views/devise/sessions/_new_ldap.html.haml
+2
-2
app/views/devise/shared/_signin_box.html.haml
app/views/devise/shared/_signin_box.html.haml
+21
-45
spec/views/devise/shared/_signin_box.html.haml_spec.rb
spec/views/devise/shared/_signin_box.html.haml_spec.rb
+2
-2
No files found.
app/assets/stylesheets/pages/login.scss
View file @
93bbc1f9
...
...
@@ -131,8 +131,14 @@
flex
:
1
;
text-align
:
center
;
&
:first-of-type
{
border-top-left-radius
:
2px
;
}
&
:last-of-type
{
border-left
:
1px
solid
$border-color
;
border-top-left-radius
:
$border-radius-default
;
border-top-right-radius
:
$border-radius-default
;
}
&
:not
(
.active
)
{
...
...
app/views/devise/sessions/_new_crowd.html.haml
View file @
93bbc1f9
=
form_tag
(
omniauth_authorize_path
(
:user
,
:crowd
),
id:
'new_crowd_user'
,
class:
'show-gl-field-errors'
)
do
.form-group
=
label_tag
'Username or email'
,
for: :username
=
text_field_tag
:username
,
nil
,
{
class:
"form-control top"
,
title:
"This field is required"
,
autofocus:
"autofocus"
,
required:
true
}
=
label_tag
:username
,
'Username or email'
=
text_field_tag
:username
,
nil
,
{
class:
"form-control top"
,
title:
"This field is required"
,
autofocus:
"autofocus"
,
required:
true
}
.form-group
=
label_tag
:password
=
password_field_tag
:password
,
nil
,
{
class:
"form-control bottom"
,
title:
"This field is required."
,
required:
true
}
...
...
@@ -10,4 +10,4 @@
%label
{
for:
"remember_me"
}
=
check_box_tag
:remember_me
,
'1'
,
false
,
id:
'remember_me'
%span
Remember me
=
button
_tag
"Sign in"
,
class:
"btn-save btn"
=
submit
_tag
"Sign in"
,
class:
"btn-save btn"
app/views/devise/sessions/_new_kerberos.html.haml
View file @
93bbc1f9
=
form_tag
(
user_omniauth_callback_path
(
provider
),
id:
'new_kerberos_user'
)
do
=
text_field_tag
:username
,
nil
,
{
class:
"form-control top"
,
placeholder:
"Kerberos Login"
,
autofocus:
"autofocus"
}
=
password_field_tag
:password
,
nil
,
{
class:
"form-control bottom"
,
placeholder:
"Password"
}
%br
/
=
button_tag
"Kerberos Sign in"
,
class:
"btn-save btn"
\ No newline at end of file
=
form_tag
(
omniauth_callback_path
(
:user
,
:kerberos
),
id:
'new_kerberos_user'
,
class:
'show-gl-field-errors'
)
do
.form-group
=
label_tag
:username
,
'Username or email'
=
text_field_tag
:username
,
nil
,
{
class:
"form-control top"
,
placeholder:
"Kerberos Login"
,
autofocus:
"autofocus"
}
.form-group
=
label_tag
:password
=
password_field_tag
:password
,
nil
,
{
class:
"form-control bottom"
,
placeholder:
"Password"
}
=
submit_tag
"Kerberos Sign in"
,
class:
"btn-save btn"
app/views/devise/sessions/_new_ldap.html.haml
View file @
93bbc1f9
=
form_tag
(
omniauth_callback_path
(
:user
,
server
[
'provider_name'
]),
id:
'new_ldap_user'
,
class:
"show-gl-field-errors"
)
do
.form-group
=
label_tag
"
#{
server
[
'label'
]
}
Login"
,
for: :username
=
label_tag
:username
,
"
#{
server
[
'label'
]
}
Login"
=
text_field_tag
:username
,
nil
,
{
class:
"form-control top"
,
title:
"This field is required."
,
autofocus:
"autofocus"
,
required:
true
}
.form-group
=
label_tag
:password
...
...
@@ -10,4 +10,4 @@
%label
{
for:
"remember_me"
}
=
check_box_tag
:remember_me
,
'1'
,
false
,
id:
'remember_me'
%span
Remember me
=
button
_tag
"Sign in"
,
class:
"btn-save btn"
=
submit
_tag
"Sign in"
,
class:
"btn-save btn"
app/views/devise/shared/_signin_box.html.haml
View file @
93bbc1f9
#login-pane
.login-box
{
role:
'tabpanel'
,
class:
'tab-pane active'
}
.login-body
-
if
form_based_providers
.
any?
<
<<<<<<
HEAD
%ul
.nav-links
-
if
kerberos_enabled?
%li
{
class:
(
:active
unless
crowd_enabled?
||
ldap_enabled?
)}
=
link_to
"Kerberos"
,
"#tab-kerberos"
,
'data-toggle'
=>
'tab'
-
if
crowd_enabled?
%li
.active
=
link_to
"Crowd"
,
"#tab-crowd"
,
'data-toggle'
=>
'tab'
-
if
ldap_enabled?
-
@ldap_servers
.
each_with_index
do
|
server
,
i
|
%li
{
class:
(
:active
if
i
.
zero?
&&
!
crowd_enabled?
)}
=
link_to
server
[
'label'
],
"#tab-
#{
server
[
'provider_name'
]
}
"
,
'data-toggle'
=>
'tab'
-
if
signin_enabled?
%li
=
link_to
'Standard'
,
'#tab-signin'
,
'data-toggle'
=>
'tab'
.tab-content
-
if
kerberos_enabled?
%div
#tab-kerberos
.tab-pane
{
class:
(
:active
unless
crowd_enabled?
||
ldap_enabled?
)}
=
render
'devise/sessions/new_kerberos'
,
provider: :kerberos
-
if
crowd_enabled?
%div
.tab-pane.active
{
id:
"tab-crowd"
}
=
render
'devise/sessions/new_crowd'
-
if
ldap_enabled?
-
@ldap_servers
.
each_with_index
do
|
server
,
i
|
%div
.tab-pane
{
id:
"tab-#{server['provider_name']}"
,
class:
(
:active
if
i
.
zero?
&&
!
crowd_enabled?
)}
=
render
'devise/sessions/new_ldap'
,
server:
server
-
if
signin_enabled?
%div
#tab-signin
.tab-pane
=
render
'devise/sessions/new_base'
==
=====
-
if
crowd_enabled?
%div
.tab-pane.active
{
id:
"tab-crowd"
}
=
render
'devise/sessions/new_crowd'
-
@ldap_servers
.
each_with_index
do
|
server
,
i
|
%div
.tab-pane
{
id:
"tab-#{server['provider_name']}"
,
class:
(
:active
if
i
.
zero?
&&
!
crowd_enabled?
)}
=
render
'devise/sessions/new_ldap'
,
server:
server
-
if
signin_enabled?
%div
#tab-signin
.tab-pane
=
render
'devise/sessions/new_base'
>
>>>>>> ce/master
-
if
form_based_providers
.
any?
-
if
crowd_enabled?
.login-box.tab-pane.active
{
id:
"crowd"
,
role:
'tabpanel'
,
class:
'tab-pane'
}
.login-body
=
render
'devise/sessions/new_crowd'
-
elsif
signin_enabled?
=
render
'devise/sessions/new_base'
-
if
kerberos_enabled?
.login-box.tab-pane
{
id:
"kerberos"
,
role:
'tabpanel'
,
class:
(
:active
unless
crowd_enabled?
||
ldap_enabled?
)}
.login-body
=
render
'devise/sessions/new_kerberos'
-
@ldap_servers
.
each_with_index
do
|
server
,
i
|
.login-box.tab-pane
{
id:
"#{server['provider_name']}"
,
role:
'tabpanel'
,
class:
(
:active
if
i
.
zero?
&&
!
crowd_enabled?
)}
.login-body
=
render
'devise/sessions/new_ldap'
,
server:
server
-
if
signin_enabled?
.login-box.tab-pane
{
id:
'ldap-standard'
,
role:
'tabpanel'
}
.login-body
=
render
'devise/sessions/new_base'
-
elsif
signin_enabled?
=
render
'devise/sessions/new_base'
spec/views/devise/shared/_signin_box.html.haml_spec.rb
View file @
93bbc1f9
...
...
@@ -12,13 +12,13 @@ describe 'devise/shared/_signin_box' do
render
expect
(
rendered
).
to
have_selector
(
'#
tab-
crowd form'
)
expect
(
rendered
).
to
have_selector
(
'#crowd form'
)
end
it
'is not shown when Crowd is disabled'
do
render
expect
(
rendered
).
not_to
have_selector
(
'#
tab-
crowd'
)
expect
(
rendered
).
not_to
have_selector
(
'#crowd'
)
end
end
...
...
Write
Preview
Markdown
is supported
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