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
c19f56bf
Commit
c19f56bf
authored
Jul 06, 2011
by
haemmer
Browse files
Implemented #849
parent
81f96da8
Changes
1
Hide whitespace changes
Inline
Side-by-side
functions.php
View file @
c19f56bf
...
...
@@ -188,25 +188,26 @@ function getDomainNameFromURIHint(){
global
$IDProviders
;
$
h
ostname
=
gethostbyaddr
(
$_SERVER
[
'REMOTE_ADDR'
]);
if
(
$
h
ostname
==
$_SERVER
[
'REMOTE_ADDR'
]){
$
clientH
ostname
=
gethostbyaddr
(
$_SERVER
[
'REMOTE_ADDR'
]);
if
(
$
clientH
ostname
==
$_SERVER
[
'REMOTE_ADDR'
]){
return
'-'
;
}
// Do we still have something
$domainname
=
getDomainNameFromURI
(
$hostname
);
if
(
$domainname
!=
''
){
// Find a matching IdP SSO, must be matching the IdP urn
// or at least the last part of the urn
foreach
(
$IDProviders
as
$key
=>
$value
){
if
(
preg_match
(
'/'
.
$domainname
.
'$/'
,
$key
)){
return
$key
;
}
}
}
else
{
// Get domain name from client host name
$clientDomainName
=
getDomainNameFromURI
(
$clientHostname
);
if
(
$clientDomainName
==
''
){
return
'-'
;
}
// Return first matching IdP entityID that contains the client domain name
foreach
(
$IDProviders
as
$key
=>
$value
){
if
(
preg_match
(
'/'
.
$clientDomainName
.
'/'
,
$key
)){
return
$key
;
}
}
// No matching entityID was found
return
'-'
;
}
/******************************************************************************/
...
...
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