Manager: get current vhost and IDP name to save vhost and IDP configuration
This commit is contained in:
parent
099c846d42
commit
01cb9f20ce
|
@ -12,7 +12,6 @@ use MIME::Base64;
|
|||
use JSON;
|
||||
use LWP::Simple;
|
||||
|
||||
# TODO
|
||||
use Data::Dumper;
|
||||
use URI::Escape;
|
||||
use Lemonldap::NG::Common::Safelib; #link protected safe Safe object
|
||||
|
@ -33,6 +32,10 @@ sub confUpload {
|
|||
$$rdata =~ s/<img.*?>//g;
|
||||
$$rdata =~ s/<li class="line".*?<\/li>//g;
|
||||
|
||||
# Variables to store current vhost and IDP name
|
||||
my $vhostname;
|
||||
my $idpname;
|
||||
|
||||
# 1. ANALYSE DATAS
|
||||
|
||||
# 1.1 Apply XSLT stylesheet to returned datas
|
||||
|
@ -72,6 +75,20 @@ sub confUpload {
|
|||
$NK = 1 if ($1);
|
||||
$id =~ s/\r//g;
|
||||
$id =~ s/^\///;
|
||||
|
||||
# Get Virtual Host name
|
||||
if ( $id =~ /locationRules\/([^\/]*)?$/ ) {
|
||||
$self->lmLog( "Entering Virtual Host $name", 'debug' );
|
||||
$vhostname = $name;
|
||||
}
|
||||
|
||||
# Get SAML IDP name
|
||||
if ( $id =~ /samlIDPMetaDataExportedAttributes\/([^\/]*)?$/ ) {
|
||||
$self->lmLog( "Entering IDP $name", 'debug' );
|
||||
$idpname = $name;
|
||||
}
|
||||
|
||||
# Manage new keys
|
||||
if ($NK) {
|
||||
|
||||
# Special case: avoid bug with node created from parent node
|
||||
|
@ -101,6 +118,14 @@ s/^samlIDPMetaDataExportedAttributes\/([^\/]*)?.*/samlIDPMetaDataExportedAttribu
|
|||
}
|
||||
}
|
||||
|
||||
# Set current Virtual Host name
|
||||
$id =~
|
||||
s/^(exportedHeaders|locationRules)\/([^\/]*)?\/(.*)$/$1\/$vhostname\/$3/;
|
||||
|
||||
# Set current SAML IDP name
|
||||
$id =~
|
||||
s/^(samlIDPMetaDataXML|samlIDPMetaDataExportedAttributes|samlIDPMetaDataOptions)\/([^\/]*)?\/(.*)$/$1\/$idpname\/$3/;
|
||||
|
||||
$self->lmLog( "id transformed into $id", 'debug' );
|
||||
|
||||
next
|
||||
|
|
Loading…
Reference in New Issue
Block a user