Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
ldap-3258620
Manage
Activity
Members
Labels
Plan
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Issue forks
ldap-3258620
Commits
9323ead0
Commit
9323ead0
authored
11 years ago
by
John Barclay
Browse files
Options
Downloads
Patches
Plain Diff
reshuffling of some functions in ldap_authorization_og.module
parent
98ea98e3
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
ldap_authorization/ldap_authorization_og/ldap_authorization_og.module
+9
-13
9 additions, 13 deletions
...zation/ldap_authorization_og/ldap_authorization_og.module
with
9 additions
and
13 deletions
ldap_authorization/ldap_authorization_og/ldap_authorization_og.module
+
9
−
13
View file @
9323ead0
...
...
@@ -186,7 +186,7 @@ function ldap_authorization_og1_has_role($gid, $uid, $rid) {
}
/** avoid excessive calls to og_roles() **/
function
ldap_authoriztion_og1_roles
(
$reset
=
false
)
{
function
ldap_authoriz
a
tion_og1_roles
(
$reset
=
false
)
{
static
$roles
;
if
(
$reset
||
!
is_array
(
$roles
))
{
$roles
=
og_roles
();
...
...
@@ -195,7 +195,7 @@ function ldap_authoriztion_og1_roles($reset = false) {
}
function
ldap_authorization_og1_role_name_to_role_id
(
$role_name
)
{
$roles
=
ldap_authoriztion_og1_roles
();
$roles
=
ldap_authoriz
a
tion_og1_roles
();
return
array_search
(
$role_name
,
$roles
);
//empty($roles[$role_name]) ? FALSE : $roles[$role_name];
}
...
...
@@ -231,17 +231,7 @@ function ldap_authorization_og2_has_role($group_type, $gid, $uid, $role_name) {
return
(
is_array
(
$roles
)
&&
in_array
(
$role_name
,
array_values
(
$roles
)));
}
/**
* Derive og role id from role name
*
* @param string $role_name as og role name
* @return int og role id
*/
function
ldap_authorization_og2_rid_from_role_name
(
$entity_type
,
$bundle
,
$gid
,
$role_name
)
{
$roles
=
og_roles
(
$entity_type
,
$bundle
,
0
,
FALSE
,
TRUE
);
$roles_flipped
=
array_flip
(
$roles
);
return
(
empty
(
$roles_flipped
[
$role_name
]))
?
NULL
:
$roles_flipped
[
$role_name
];
}
/**
* Derive og role id from role name
...
...
@@ -249,6 +239,7 @@ function ldap_authorization_og2_rid_from_role_name($entity_type, $bundle, $gid,
* @param string $role_name as og role name
* @return int og role id
*/
function
ldap_authorization_og_rid_from_role_name
(
$role_name
)
{
$roles
=
og_roles
(
0
);
$rids
=
array_flip
(
$roles
);
...
...
@@ -260,6 +251,11 @@ function ldap_authorization_og1_role_name_from_rid($rid) {
return
isset
(
$roles
[
$rid
])
?
$roles
[
$rid
]
:
FALSE
;
}
function
ldap_authorization_og2_rid_from_role_name
(
$entity_type
,
$bundle
,
$gid
,
$role_name
)
{
$roles
=
og_roles
(
$entity_type
,
$bundle
,
0
,
FALSE
,
TRUE
);
$roles_flipped
=
array_flip
(
$roles
);
return
(
empty
(
$roles_flipped
[
$role_name
]))
?
NULL
:
$roles_flipped
[
$role_name
];
}
function
ldap_authorization_og_get_all_group_entities
()
{
$entities
=
array
();
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment