Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
GIP RENATER
switch-wayf
Commits
b49ca596
Commit
b49ca596
authored
Aug 19, 2011
by
haemmer
Browse files
Adapted convertToShibDSStructure() to use new JSON format compatible with Shibboleth
parent
983e760e
Changes
1
Hide whitespace changes
Inline
Side-by-side
functions.php
View file @
b49ca596
...
...
@@ -84,11 +84,11 @@ function checkIDP($IDP, $showError = true){
return
false
;
}
else
{
$message
=
sprintf
(
getLocalString
(
'invalid_user_idp'
),
htmlentities
(
$IDP
))
.
"</p><p>
\n
<tt>"
;
foreach
(
$IDProviders
as
$key
=>
$value
){
if
(
isset
(
$value
[
'SSO'
])){
$message
.
=
$key
.
"<br>
\n
"
;
}
}
foreach
(
$IDProviders
as
$key
=>
$value
){
if
(
isset
(
$value
[
'SSO'
])){
$message
.
=
$key
.
"<br>
\n
"
;
}
}
$message
.
=
"</tt>
\n
"
;
printError
(
$message
);
...
...
@@ -594,7 +594,7 @@ function checkPathInfo($needle){
function
convertToShibDSStructure
(
$IDProviders
){
global
$federationName
;
$ShibDSIDProviders
[
'identityProviders'
]
=
array
();
$ShibDSIDProviders
=
array
();
foreach
(
$IDProviders
as
$key
=>
$value
){
...
...
@@ -610,13 +610,9 @@ function convertToShibDSStructure($IDProviders){
// Init and fill IdP data
$identityProvider
=
array
();
$identityProvider
[
'entityID'
]
=
$key
;
$identityProvider
[
'shibSSOEndpoint'
]
=
$value
[
'SSO'
];
$identityProvider
[
'displayNames'
][]
=
array
(
'lang'
=>
'en'
,
'name'
=>
$value
[
'Name'
]);
$identityProvider
[
'attributes'
][]
=
array
(
'name'
=>
'type'
,
'value'
=>
$value
[
'Type'
]
);
$identityProvider
[
'DisplayNames'
][]
=
array
(
'lang'
=>
'en'
,
'value'
=>
$value
[
'Name'
]);
// Add
d
isplayNames in other languages
// Add
D
isplayNames in other languages
foreach
(
$value
as
$lang
=>
$name
){
if
(
$lang
==
'Name'
...
...
@@ -630,28 +626,12 @@ function convertToShibDSStructure($IDProviders){
}
if
(
isset
(
$name
[
'Name'
])){
$identityProvider
[
'
d
isplayNames'
][]
=
array
(
'lang'
=>
$lang
,
'
nam
e'
=>
$name
[
'Name'
]);
$identityProvider
[
'
D
isplayNames'
][]
=
array
(
'lang'
=>
$lang
,
'
valu
e'
=>
$name
[
'Name'
]);
}
}
// Add kerberos realm
if
(
isset
(
$value
[
'Realm'
])){
$identityProvider
[
'attributes'
][]
=
array
(
'name'
=>
'kerberosRealm'
,
'value'
=>
$value
[
'Realm'
]
);
}
// Add IP ranges
if
(
isset
(
$value
[
'IP'
])){
$identityProvider
[
'attributes'
][]
=
array
(
'name'
=>
'IP'
,
'value'
=>
$value
[
'IP'
]
);
}
// Add data to ShibDSIDProviders
$ShibDSIDProviders
[
'identityProviders'
][
]
=
$identityProvider
;
$ShibDSIDProviders
[]
=
$identityProvider
;
}
return
$ShibDSIDProviders
;
...
...
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