Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
M
mediawiki-shibboleth-authentication
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Marco Malavolti
mediawiki-shibboleth-authentication
Commits
e283739f
Commit
e283739f
authored
9 years ago
by
Francesco Malvezzi
Browse files
Options
Downloads
Patches
Plain Diff
Added $shib_group_delete flag
parent
64c18312
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
README.md
+9
-0
9 additions, 0 deletions
README.md
ShibAuthPlugin.php
+7
-4
7 additions, 4 deletions
ShibAuthPlugin.php
with
16 additions
and
4 deletions
README.md
+
9
−
0
View file @
e283739f
...
@@ -38,6 +38,15 @@ $shib_email = isset($_SERVER['HTTP_EMAIL']) ? $_SERVER['HTTP_EMAIL'] : null;
...
@@ -38,6 +38,15 @@ $shib_email = isset($_SERVER['HTTP_EMAIL']) ? $_SERVER['HTTP_EMAIL'] : null;
$shib_groups = isset($_SERVER['isMemberOf']) ? $_SERVER['isMemberOf'] : null;
$shib_groups = isset($_SERVER['isMemberOf']) ? $_SERVER['isMemberOf'] : null;
$shib_group_prefix = "wiki";
$shib_group_prefix = "wiki";
// Should pre-existing groups be deleted?
// If groups are fetched only from Shibboleth it should be true
// if memberships are granted from mediawiki User rights management
// page, it should be false
// PLEASE NOTE: with $shib_group_delete = false, in order to revoke
// a membership it should be deleted both from Shibboleth and
// User rights management page!
$shib_group_delete = false;
// The ShibUpdateUser hook is executed on login.
// The ShibUpdateUser hook is executed on login.
// It has two arguments:
// It has two arguments:
// - $existing: True if this is an existing user, false if it is a new user being added
// - $existing: True if this is an existing user, false if it is a new user being added
...
...
This diff is collapsed.
Click to expand it.
ShibAuthPlugin.php
+
7
−
4
View file @
e283739f
...
@@ -469,11 +469,14 @@ function ShibUserLoadFromSession($user, &$result)
...
@@ -469,11 +469,14 @@ function ShibUserLoadFromSession($user, &$result)
function
ShibAddGroups
(
$user
)
{
function
ShibAddGroups
(
$user
)
{
global
$shib_groups
;
global
$shib_groups
;
global
$shib_group_prefix
;
global
$shib_group_prefix
;
global
$shib_group_delete
;
$oldGroups
=
$user
->
getGroups
();
if
(
isset
(
$shib_group_delete
)
&&
$shib_group_delete
)
{
foreach
(
$oldGroups
as
$group
)
{
$oldGroups
=
$user
->
getGroups
();
$user
->
removeGroup
(
$group
);
foreach
(
$oldGroups
as
$group
)
{
}
$user
->
removeGroup
(
$group
);
}
}
if
(
isset
(
$shib_groups
))
{
if
(
isset
(
$shib_groups
))
{
foreach
(
explode
(
';'
,
$shib_groups
)
as
$group
)
{
foreach
(
explode
(
';'
,
$shib_groups
)
as
$group
)
{
...
...
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