BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
757c7a52
Commit
757c7a52
authored
Dec 15, 2012
by
Riyad Preukschas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix gravatar and ldap config
parent
19eb6374
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
14 additions
and
16 deletions
+14
-16
application_helper.rb
app/helpers/application_helper.rb
+1
-1
show.html.haml
app/views/profiles/show.html.haml
+1
-1
devise.rb
config/initializers/devise.rb
+10
-12
application_helper_spec.rb
spec/helpers/application_helper_spec.rb
+2
-2
No files found.
app/helpers/application_helper.rb
View file @
757c7a52
...
...
@@ -34,7 +34,7 @@ module ApplicationHelper
def
gravatar_icon
(
user_email
=
''
,
size
=
nil
)
size
=
40
if
size
.
nil?
||
size
<=
0
if
Gitlab
.
config
.
disable_gravatar?
||
user_email
.
blank?
if
!
Gitlab
.
config
.
gravatar
.
enabled
||
user_email
.
blank?
'no_avatar.png'
else
gravatar_url
=
request
.
ssl?
?
Gitlab
.
config
.
gravatar
.
ssl_url
:
Gitlab
.
config
.
gravatar
.
plain_url
...
...
app/views/profiles/show.html.haml
View file @
757c7a52
...
...
@@ -33,7 +33,7 @@
%ul
%li
%p
You can change your password on Account page
-
unless
Gitlab
.
config
.
disable_gravatar?
-
if
Gitlab
.
config
.
gravatar
.
enabled
%li
%p
You can change your avatar at
#{
link_to
"gravatar.com"
,
"http://gravatar.com"
}
...
...
config/initializers/devise.rb
View file @
757c7a52
...
...
@@ -205,20 +205,18 @@ Devise.setup do |config|
# manager.default_strategies(:scope => :user).unshift :some_external_strategy
# end
gl
=
Gitlab
.
config
if
gl
.
ldap_enabled?
if
Gitlab
.
config
.
ldap
.
enabled
config
.
omniauth
:ldap
,
:host
=>
gl
.
ldap
[
'host'
],
:base
=>
gl
.
ldap
[
'base'
],
:uid
=>
gl
.
ldap
[
'uid'
],
:port
=>
gl
.
ldap
[
'port'
],
:method
=>
gl
.
ldap
[
'method'
],
:bind_dn
=>
gl
.
ldap
[
'bind_dn'
],
:password
=>
gl
.
ldap
[
'password'
]
:host
=>
Gitlab
.
config
.
ldap
[
'host'
],
:base
=>
Gitlab
.
config
.
ldap
[
'base'
],
:uid
=>
Gitlab
.
config
.
ldap
[
'uid'
],
:port
=>
Gitlab
.
config
.
ldap
[
'port'
],
:method
=>
Gitlab
.
config
.
ldap
[
'method'
],
:bind_dn
=>
Gitlab
.
config
.
ldap
[
'bind_dn'
],
:password
=>
Gitlab
.
config
.
ldap
[
'password'
]
end
gl
.
omniauth_providers
.
each
do
|
gl_
provider
|
config
.
omniauth
gl_provider
[
'name'
].
to_sym
,
gl_provider
[
'app_id'
],
gl_
provider
[
'app_secret'
]
Gitlab
.
config
.
omniauth
.
providers
.
each
do
|
provider
|
config
.
omniauth
provider
[
'name'
].
to_sym
,
provider
[
'app_id'
],
provider
[
'app_secret'
]
end
end
spec/helpers/application_helper_spec.rb
View file @
757c7a52
...
...
@@ -43,7 +43,7 @@ describe ApplicationHelper do
let
(
:user_email
)
{
'user@email.com'
}
it
"should return a generic avatar path when Gravatar is disabled"
do
Gitlab
.
config
.
stub
(
:disable_gravatar?
).
and_return
(
tru
e
)
Gitlab
.
config
.
gravatar
.
stub
(
:enabled
).
and_return
(
fals
e
)
gravatar_icon
(
user_email
).
should
==
'no_avatar.png'
end
...
...
@@ -63,7 +63,7 @@ describe ApplicationHelper do
it
"should return custom gravatar path when gravatar_url is set"
do
stub!
(
:request
).
and_return
(
double
(
:ssl?
=>
false
))
Gitlab
.
config
.
stub
(
:gravatar
_url
).
and_return
(
'http://example.local/?s=%{size}&hash=%{hash}'
)
Gitlab
.
config
.
gravatar
.
stub
(
:plain
_url
).
and_return
(
'http://example.local/?s=%{size}&hash=%{hash}'
)
gravatar_icon
(
user_email
,
20
).
should
==
'http://example.local/?s=20&hash=b58c6f14d292556214bd64909bcdb118'
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