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
83a3facb
Commit
83a3facb
authored
Oct 10, 2014
by
Jan-Willem van der Meer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add provider to LDAP group links
parent
3702eb54
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
35 additions
and
3 deletions
+35
-3
app/controllers/groups/ldap_group_links_controller.rb
app/controllers/groups/ldap_group_links_controller.rb
+1
-1
app/models/ldap_group_link.rb
app/models/ldap_group_link.rb
+13
-0
app/views/ldap_group_links/_form.html.haml
app/views/ldap_group_links/_form.html.haml
+9
-0
app/views/ldap_group_links/_ldap_group_link.html.haml
app/views/ldap_group_links/_ldap_group_link.html.haml
+1
-1
db/migrate/20141010132608_add_provider_to_ldap_group_links.rb
...igrate/20141010132608_add_provider_to_ldap_group_links.rb
+5
-0
db/schema.rb
db/schema.rb
+2
-1
lib/gitlab/ldap/config.rb
lib/gitlab/ldap/config.rb
+4
-0
No files found.
app/controllers/groups/ldap_group_links_controller.rb
View file @
83a3facb
...
...
@@ -36,6 +36,6 @@ class Groups::LdapGroupLinksController < ApplicationController
end
def
ldap_group_link_params
params
.
require
(
:ldap_group_link
).
permit
(
:cn
,
:group_access
)
params
.
require
(
:ldap_group_link
).
permit
(
:cn
,
:group_access
,
:provider
)
end
end
app/models/ldap_group_link.rb
View file @
83a3facb
...
...
@@ -9,4 +9,17 @@ class LdapGroupLink < ActiveRecord::Base
def
access_field
group_access
end
def
config
Gitlab
::
LDAP
::
Config
.
new
(
provider
)
end
# default to the first LDAP server
def
provider
read_attribute
(
:provider
)
||
Gitlab
::
LDAP
::
Config
.
providers
.
first
end
def
provider_label
config
.
label
end
end
app/views/ldap_group_links/_form.html.haml
View file @
83a3facb
...
...
@@ -3,6 +3,15 @@
%fieldset
%legend
%div
.form-holder
.form-group.clearfix
=
f
.
label
:cn
,
class:
'control-label'
do
LDAP Server
.col-sm-10
-
Gitlab
::
LDAP
::
Config
.
servers
.
each
do
|
server
|
.radio-inline
=
f
.
radio_button
:provider
,
server
.
provider_name
=
server
.
label
.form-group.clearfix
=
f
.
label
:cn
,
class:
'control-label'
do
LDAP Group cn
...
...
app/views/ldap_group_links/_ldap_group_link.html.haml
View file @
83a3facb
%li
=
ldap_group_link
.
cn
%small
.light
==
as
#{
ldap_group_link
.
human_access
}
%small
.light
==
as
#{
ldap_group_link
.
human_access
}
on
#{
ldap_group_link
.
provider_label
}
.pull-right
=
link_to
group_ldap_group_link_path
(
group
,
ldap_group_link
),
method: :delete
,
class:
'btn btn-danger btn-small'
do
=
fa_icon
(
'unlink'
,
text:
'unlink'
)
db/migrate/20141010132608_add_provider_to_ldap_group_links.rb
0 → 100644
View file @
83a3facb
class
AddProviderToLdapGroupLinks
<
ActiveRecord
::
Migration
def
change
add_column
:ldap_group_links
,
:provider
,
:string
end
end
db/schema.rb
View file @
83a3facb
...
...
@@ -11,7 +11,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord
::
Schema
.
define
(
version:
2014
0914173417
)
do
ActiveRecord
::
Schema
.
define
(
version:
2014
1010132608
)
do
# These are extensions that must be enabled in order to support this database
enable_extension
"plpgsql"
...
...
@@ -155,6 +155,7 @@ ActiveRecord::Schema.define(version: 20140914173417) do
t
.
integer
"group_id"
,
null:
false
t
.
datetime
"created_at"
t
.
datetime
"updated_at"
t
.
string
"provider"
end
create_table
"members"
,
force:
true
do
|
t
|
...
...
lib/gitlab/ldap/config.rb
View file @
83a3facb
...
...
@@ -44,6 +44,10 @@ module Gitlab
options
[
'uid'
]
end
def
label
options
[
'label'
]
end
def
sync_ssh_keys?
sync_ssh_keys
.
present?
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