Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
simplesamlphp
Manage
Activity
Members
Labels
Plan
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Perun
Perun ProxyIdP
v1
simplesamlphp
Commits
bc1778dd
Unverified
Commit
bc1778dd
authored
7 years ago
by
Thijs Kinkhorst
Committed by
GitHub
7 years ago
Browse files
Options
Downloads
Plain Diff
Merge pull request #859 from m0ark/metarefresh-types-fix
Fix metarefresh loading by type
parents
54fc58f7
8b3969d9
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
modules/metarefresh/lib/MetaLoader.php
+19
-20
19 additions, 20 deletions
modules/metarefresh/lib/MetaLoader.php
with
19 additions
and
20 deletions
modules/metarefresh/lib/MetaLoader.php
+
19
−
20
View file @
bc1778dd
...
...
@@ -166,13 +166,23 @@ class sspmod_metarefresh_MetaLoader
$template
=
$source
[
'template'
];
}
$this
->
addMetadata
(
$source
[
'src'
],
$entity
->
getMetadata1xSP
(),
'shib13-sp-remote'
,
$template
);
$this
->
addMetadata
(
$source
[
'src'
],
$entity
->
getMetadata1xIdP
(),
'shib13-idp-remote'
,
$template
);
$this
->
addMetadata
(
$source
[
'src'
],
$entity
->
getMetadata20SP
(),
'saml20-sp-remote'
,
$template
);
$this
->
addMetadata
(
$source
[
'src'
],
$entity
->
getMetadata20IdP
(),
'saml20-idp-remote'
,
$template
);
$attributeAuthorities
=
$entity
->
getAttributeAuthorities
();
if
(
!
empty
(
$attributeAuthorities
))
{
$this
->
addMetadata
(
$source
[
'src'
],
$attributeAuthorities
[
0
],
'attributeauthority-remote'
,
$template
);
if
(
in_array
(
'shib13-sp-remote'
,
$this
->
types
))
{
$this
->
addMetadata
(
$source
[
'src'
],
$entity
->
getMetadata1xSP
(),
'shib13-sp-remote'
,
$template
);
}
if
(
in_array
(
'shib13-idp-remote'
,
$this
->
types
))
{
$this
->
addMetadata
(
$source
[
'src'
],
$entity
->
getMetadata1xIdP
(),
'shib13-idp-remote'
,
$template
);
}
if
(
in_array
(
'saml20-sp-remote'
,
$this
->
types
))
{
$this
->
addMetadata
(
$source
[
'src'
],
$entity
->
getMetadata20SP
(),
'saml20-sp-remote'
,
$template
);
}
if
(
in_array
(
'saml20-idp-remote'
,
$this
->
types
))
{
$this
->
addMetadata
(
$source
[
'src'
],
$entity
->
getMetadata20IdP
(),
'saml20-idp-remote'
,
$template
);
}
if
(
in_array
(
'attributeauthority-remote'
,
$this
->
types
))
{
$attributeAuthorities
=
$entity
->
getAttributeAuthorities
();
if
(
!
empty
(
$attributeAuthorities
))
{
$this
->
addMetadata
(
$source
[
'src'
],
$attributeAuthorities
[
0
],
'attributeauthority-remote'
,
$template
);
}
}
}
...
...
@@ -192,7 +202,6 @@ class sspmod_metarefresh_MetaLoader
if
(
isset
(
$source
[
'conditionalGET'
])
&&
$source
[
'conditionalGET'
])
{
if
(
array_key_exists
(
$source
[
'src'
],
$this
->
state
))
{
$sourceState
=
$this
->
state
[
$source
[
'src'
]];
if
(
isset
(
$sourceState
[
'last-modified'
]))
{
...
...
@@ -245,13 +254,11 @@ class sspmod_metarefresh_MetaLoader
if
(
!
empty
(
$this
->
state
[
$source
[
'src'
]]))
{
// Timestamp when this src was requested.
$this
->
state
[
$source
[
'src'
]][
'requested_at'
]
=
$this
->
getTime
();
$this
->
changed
=
true
;
}
}
}
/**
* Parse XML metadata and return entities
*/
...
...
@@ -296,7 +303,6 @@ class sspmod_metarefresh_MetaLoader
echo
'/* The following data should be added to metadata/'
.
$category
.
'.php. */'
.
"
\n
"
;
foreach
(
$elements
as
$m
)
{
$filename
=
$m
[
'filename'
];
$entityID
=
$m
[
'metadata'
][
'entityid'
];
...
...
@@ -306,7 +312,6 @@ class sspmod_metarefresh_MetaLoader
echo
'$metadata[\''
.
addslashes
(
$entityID
)
.
'\'] = '
.
var_export
(
$m
[
'metadata'
],
true
)
.
';'
.
"
\n
"
;
}
echo
"
\n
"
;
echo
'/* End of data which should be added to metadata/'
.
$category
.
'.php. */'
.
"
\n
"
;
echo
"
\n
"
;
...
...
@@ -339,10 +344,8 @@ class sspmod_metarefresh_MetaLoader
// If expire is defined in constructor...
if
(
!
empty
(
$this
->
expire
))
{
// If expire is already in metadata
if
(
array_key_exists
(
'expire'
,
$metadata
))
{
// Override metadata expire with more restrictive global config-
if
(
$this
->
expire
<
$metadata
[
'expire'
])
{
$metadata
[
'expire'
]
=
$this
->
expire
;
...
...
@@ -353,9 +356,6 @@ class sspmod_metarefresh_MetaLoader
$metadata
[
'expire'
]
=
$this
->
expire
;
}
}
$this
->
metadata
[
$type
][]
=
array
(
'filename'
=>
$filename
,
'metadata'
=>
$metadata
);
}
...
...
@@ -379,8 +379,7 @@ class sspmod_metarefresh_MetaLoader
}
// $metadata, $attributemap, $prefix, $suffix
$arp
=
new
sspmod_metarefresh_ARP
(
$md
,
$arp
=
new
sspmod_metarefresh_ARP
(
$md
,
$config
->
getValue
(
'attributemap'
,
''
),
$config
->
getValue
(
'prefix'
,
''
),
$config
->
getValue
(
'suffix'
,
''
)
...
...
@@ -444,7 +443,7 @@ class sspmod_metarefresh_MetaLoader
/**
* Save metadata for loading with the 'serialize' metadata loader.
*
* @param string $outputDir The directory we should save the metadata to.
* @param string $outputDir
The directory we should save the metadata to.
*/
public
function
writeMetadataSerialize
(
$outputDir
)
{
...
...
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