Commit a0e8292a7d090e451e8681892394b41a18a7886c
1 parent
b062ae95
Exists in
master
Get database information from gitlab.yml
Showing
1 changed file
with
7 additions
and
2 deletions
Show diff stats
lib/omniauth/strategies/env.rb
... | ... | @@ -36,13 +36,18 @@ module OmniAuth |
36 | 36 | end |
37 | 37 | |
38 | 38 | uid { @uid } |
39 | - | |
39 | + | |
40 | 40 | info { @user_data } |
41 | 41 | |
42 | 42 | private |
43 | 43 | |
44 | 44 | def fill_ldap_info |
45 | - conn = PG::Connection.open(:dbname => 'colab', :host => 'localhost', :user => 'colab', :password => 'colab') | |
45 | + conn = PG::Connection.open( | |
46 | + :dbname => Gitlab.config.env['database_name'], | |
47 | + :host => Gitlab.config.env['host'], | |
48 | + :user => Gitlab.config.env['user'], | |
49 | + :password => Gitlab.config.env['password'], | |
50 | + ) | |
46 | 51 | res = conn.exec("select email, first_name from accounts_user where username='#{@uid}';") |
47 | 52 | @user_data[:email] = res[0]['email'] |
48 | 53 | @user_data[:name] = res[0]['first_name'] | ... | ... |