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
0
Merge Requests
0
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
Léo-Paul Géneau
gitlab-ce
Commits
fa4150d4
Commit
fa4150d4
authored
Sep 12, 2012
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cleanup after omniauth
parent
486de8c3
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
49 additions
and
47 deletions
+49
-47
app/assets/stylesheets/auth_methods.scss
app/assets/stylesheets/auth_methods.scss
+0
-10
app/assets/stylesheets/gitlab_bootstrap/blocks.scss
app/assets/stylesheets/gitlab_bootstrap/blocks.scss
+4
-0
app/assets/stylesheets/main.scss
app/assets/stylesheets/main.scss
+0
-1
app/controllers/omniauth_callbacks_controller.rb
app/controllers/omniauth_callbacks_controller.rb
+5
-6
app/helpers/application_helper.rb
app/helpers/application_helper.rb
+3
-2
app/views/devise/sessions/new.html.haml
app/views/devise/sessions/new.html.haml
+5
-4
app/views/profile/password.html.haml
app/views/profile/password.html.haml
+3
-3
app/views/profile/show.html.haml
app/views/profile/show.html.haml
+25
-19
config/gitlab.yml.example
config/gitlab.yml.example
+4
-2
No files found.
app/assets/stylesheets/auth_methods.scss
deleted
100644 → 0
View file @
486de8c3
.auth_methods
{
ul
{
margin
:
0
;
text-align
:center
;
padding
:
5px
;
li
{
display
:
inline
;
}
}
}
app/assets/stylesheets/gitlab_bootstrap/blocks.scss
View file @
fa4150d4
...
...
@@ -142,4 +142,8 @@
border
:none
;
}
}
.ui-box-body
{
padding
:
10px
;
}
}
app/assets/stylesheets/main.scss
View file @
fa4150d4
...
...
@@ -134,7 +134,6 @@ $hover: #fdf5d9;
* TODO: clean it
*/
@import
"common.scss"
;
@import
"auth_methods.scss"
;
/**
* Styles related to specific part of app
...
...
app/controllers/omniauth_callbacks_controller.rb
View file @
fa4150d4
class
OmniauthCallbacksController
<
Devise
::
OmniauthCallbacksController
Gitlab
.
config
.
omniauth_providers
.
each
do
|
provider
|
define_method
provider
[
'name'
]
do
handle_omniauth
end
end
# Extend the standard message generation to accept our custom exception
def
failure_message
...
...
@@ -19,12 +24,6 @@ class OmniauthCallbacksController < Devise::OmniauthCallbacksController
sign_in_and_redirect
@user
end
Settings
.
omniauth_providers
.
each
do
|
provider
|
define_method
provider
[
'name'
]
do
handle_omniauth
end
end
private
def
handle_omniauth
...
...
app/helpers/application_helper.rb
View file @
fa4150d4
...
...
@@ -137,7 +137,8 @@ module ApplicationHelper
end
def
authbutton
(
provider
,
size
=
64
)
image_tag
(
"authbuttons/
#{
provider
.
to_s
.
split
(
'_'
).
first
}
_
#{
size
}
.png"
,
alt:
"Sign in with
#{
provider
.
to_s
.
titleize
}
"
)
file_name
=
"
#{
provider
.
to_s
.
split
(
'_'
).
first
}
_
#{
size
}
.png"
image_tag
(
"authbuttons/
#{
file_name
}
"
,
alt:
"Sign in with
#{
provider
.
to_s
.
titleize
}
"
)
end
end
app/views/devise/sessions/new.html.haml
View file @
fa4150d4
...
...
@@ -15,7 +15,8 @@
.right
=
render
:partial
=>
"devise/shared/links"
-
if
devise_mapping
.
omniauthable?
-
resource_class
.
omniauth_providers
.
each
do
|
provider
|
%hr
/
=
link_to
"Sign in with
#{
provider
.
to_s
.
titleize
}
"
,
omniauth_authorize_path
(
resource_name
,
provider
),
:class
=>
"btn primary"
%br
/
%hr
/
%ul
.unstyled
-
resource_class
.
omniauth_providers
.
each
do
|
provider
|
%li
=
link_to
authbutton
(
provider
,
32
),
omniauth_authorize_path
(
resource_name
,
provider
)
app/views/profile/password.html.haml
View file @
fa4150d4
...
...
@@ -19,11 +19,11 @@
=
f
.
label
:password_confirmation
.input
=
f
.
password_field
:password_confirmation
-
if
Settings
.
omniauth
.
enabled
-
if
Gitlab
.
config
.
omniauth_enabled?
.span5.right
.a
uth_methods.a
lert.alert-info
.alert.alert-info
%strong
Tip: Use one of the following sites to login
%ul
%ul
.unstyled
-
User
.
omniauth_providers
.
each
do
|
provider
|
%li
=
link_to
authbutton
(
provider
),
|
omniauth_authorize_path
(
User
,
provider
)
|
...
...
app/views/profile/show.html.haml
View file @
fa4150d4
...
...
@@ -50,28 +50,34 @@
%strong
Tip:
You can change your avatar at gravatar.com
-
if
Settings
.
omniauth
.
enabled
&&
@user
.
provider?
%h4
Omniauth Providers:
=
link_to
"Change"
,
profile_password_path
,
class:
"btn small right"
You can login through
#{
@user
.
provider
.
titleize
}
!
=
authbutton
(
@user
.
provider
,
32
)
-
@user
.
provider
=
'twitter'
-
if
Gitlab
.
config
.
omniauth_enabled?
&&
@user
.
provider?
.ui-box
.ui-box-body
%h4
Omniauth Providers:
=
link_to
"Change"
,
profile_password_path
,
class:
"btn small right"
You can login through
#{
@user
.
provider
.
titleize
}
!
=
authbutton
(
@user
.
provider
,
32
)
%h4
Personal projects:
%small
.right
%span
=
current_user
.
my_own_projects
.
count
of
%span
=
current_user
.
projects_limit
.progress
.bar
{
style:
"width: #{current_user.projects_limit_percent}%;"
}
.ui-box
.ui-box-body
%h4
Personal projects:
%small
.right
%span
=
current_user
.
my_own_projects
.
count
of
%span
=
current_user
.
projects_limit
.progress
.bar
{
style:
"width: #{current_user.projects_limit_percent}%;"
}
%h4
SSH public keys:
%small
.right
%span
=
link_to
current_user
.
keys
.
count
,
keys_path
.ui-box
.ui-box-body
%h4
SSH public keys:
%strong
.right
=
link_to
current_user
.
keys
.
count
,
keys_path
=
link_to
"Add Public Key"
,
new_key_path
,
class:
"btn small right
"
=
link_to
"Add Public Key"
,
new_key_path
,
class:
"btn small
"
.form-actions
=
f
.
submit
'Save'
,
class:
"btn save-btn"
config/gitlab.yml.example
View file @
fa4150d4
...
...
@@ -43,8 +43,6 @@ ldap:
omniauth:
enabled: false
allow_single_sign_on: false
block_auto_created_users: true
providers:
# - { name: 'google_oauth2', app_id: 'YOUR APP ID',
# app_secret: 'YOUR APP SECRET',
...
...
@@ -53,6 +51,10 @@ omniauth:
# app_secret: 'YOUR APP SECRET'}
# - { name: 'github', app_id: 'YOUR APP ID',
# app_secret: 'YOUR APP SECRET' }
# IMPORTANT!
# It allows user to login without having user account
allow_single_sign_on: false
block_auto_created_users: true
#
...
...
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