Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
O
openid_connect
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Custom Issue Tracker
Custom Issue Tracker
Labels
Merge Requests
7
Merge Requests
7
Requirements
Requirements
List
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Analytics
Analytics
Code Review
Insights
Issue
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
project
openid_connect
Commits
a58ea3c5
Commit
a58ea3c5
authored
May 23, 2015
by
pjcdawkins
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue
#2493939
: allow admins to view other users' connected accounts
parent
cf4f656b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
4 deletions
+11
-4
includes/openid_connect.forms.inc
includes/openid_connect.forms.inc
+8
-4
openid_connect.module
openid_connect.module
+3
-0
No files found.
includes/openid_connect.forms.inc
View file @
a58ea3c5
...
...
@@ -49,19 +49,21 @@ function openid_connect_connect_form($form, &$form_state, $account) {
$clients
=
openid_connect_get_plugins
(
TRUE
);
$read_only
=
$GLOBALS
[
'user'
]
->
uid
!=
$account
->
uid
;
$form
[
'help'
]
=
array
(
'#prefix'
=>
'<p class="description">'
,
'#suffix'
=>
'</p>'
,
);
if
(
$clients
)
{
$form
[
'help'
][
'#markup'
]
=
t
(
'You can connect your account with these external providers.'
);
}
else
{
if
(
empty
(
$clients
))
{
$form
[
'help'
][
'#markup'
]
=
t
(
'No external account providers are available.'
);
return
$form
;
}
elseif
(
$GLOBALS
[
'user'
]
->
uid
==
$account
->
uid
)
{
$form
[
'help'
][
'#markup'
]
=
t
(
'You can connect your account with these external providers.'
);
}
$connected_accounts
=
openid_connect_get_connected_accounts
(
$account
);
...
...
@@ -85,6 +87,7 @@ function openid_connect_connect_form($form, &$form_state, $account) {
'#type'
=>
'submit'
,
'#value'
=>
t
(
'Disconnect from !client_title'
,
array
(
'!client_title'
=>
$client
[
'title'
])),
'#name'
=>
'disconnect__'
.
$client
[
'name'
],
'#access'
=>
!
$read_only
,
);
}
else
{
...
...
@@ -93,6 +96,7 @@ function openid_connect_connect_form($form, &$form_state, $account) {
'#type'
=>
'submit'
,
'#value'
=>
t
(
'Connect with !client_title'
,
array
(
'!client_title'
=>
$client
[
'title'
])),
'#name'
=>
'connect__'
.
$client
[
'name'
],
'#access'
=>
!
$read_only
,
);
}
}
...
...
openid_connect.module
View file @
a58ea3c5
...
...
@@ -209,6 +209,9 @@ function openid_connect_redirect_access() {
*/
function
openid_connect_connected_accounts_access
(
$account
)
{
global
$user
;
if
(
user_access
(
'administer users'
))
{
return
TRUE
;
}
return
$user
->
uid
&&
$user
->
uid
===
$account
->
uid
&&
user_access
(
'manage own openid_connect accounts'
);
}
...
...
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