Commit 91af1f63 authored by Yadd's avatar Yadd
Browse files

Move SAML HTML fragments to tpl (#1302)

parent 7e29c51c
...@@ -284,6 +284,9 @@ site/templates/bootstrap/redirect.tpl ...@@ -284,6 +284,9 @@ site/templates/bootstrap/redirect.tpl
site/templates/bootstrap/register.tpl site/templates/bootstrap/register.tpl
site/templates/bootstrap/removeOther.tpl site/templates/bootstrap/removeOther.tpl
site/templates/bootstrap/samlRedirectToIdp.tpl site/templates/bootstrap/samlRedirectToIdp.tpl
site/templates/bootstrap/samlSpLogout.tpl
site/templates/bootstrap/samlSpsLogout.tpl
site/templates/bootstrap/samlSpSoapLogout.tpl
site/templates/bootstrap/sessionArray.tpl site/templates/bootstrap/sessionArray.tpl
site/templates/bootstrap/simpleInfo.tpl site/templates/bootstrap/simpleInfo.tpl
site/templates/bootstrap/sslform.tpl site/templates/bootstrap/sslform.tpl
......
...@@ -2517,12 +2517,14 @@ sub sendLogoutRequestToProvider { ...@@ -2517,12 +2517,14 @@ sub sendLogoutRequestToProvider {
# Redirect user to response URL # Redirect user to response URL
my $slo_url = $logout->msg_url; my $slo_url = $logout->msg_url;
$info .= # Create iFrame
qq'<tr><td><iframe src="$slo_url" alt="" marginwidth="0"' $info .= $self->loadTemplate(
. ' marginheight="0" scrolling="no" class="noborder"' 'samlSpLogout',
. ' width="10px" height="10px" frameborder="0">' params => {
. qq'</iframe></td><td>$providerName</td></tr>'; url => $slo_url,
name => $providerName,
}
);
} }
# HTTP-POST # HTTP-POST
...@@ -2548,12 +2550,13 @@ sub sendLogoutRequestToProvider { ...@@ -2548,12 +2550,13 @@ sub sendLogoutRequestToProvider {
my $slo_url = $portal . '/saml/relaySingleLogoutPOST?relay=' . $relayID; my $slo_url = $portal . '/saml/relaySingleLogoutPOST?relay=' . $relayID;
# Create iFrame # Create iFrame
$info .= $info .= $self->loadTemplate(
qq'<tr><td><iframe src="$slo_url" alt="" marginwidth="0"' 'samlSpLogout',
. ' marginheight="0" scrolling="no" class="noborder"' params => {
. ' width="10px" height="10px" frameborder="0">' url => $slo_url,
. qq'</iframe></td><td>$providerName</td></tr>'; name => $providerName,
}
);
} }
# HTTP-SOAP # HTTP-SOAP
...@@ -2585,12 +2588,13 @@ sub sendLogoutRequestToProvider { ...@@ -2585,12 +2588,13 @@ sub sendLogoutRequestToProvider {
$portal . '/saml/relaySingleLogoutSOAP?relay=' . $relayID; $portal . '/saml/relaySingleLogoutSOAP?relay=' . $relayID;
# Display information to the user # Display information to the user
$info .= '<tr>' $info .= $self->loadTemplate(
. '<td><img src="' 'samlSpSoapLogout',
. $slo_url params => {
. '" width="10px" height="10px" />' . '</td>' . '<td>' imgUrl => $slo_url,
. $providerName . '</td>' . '</tr>'; name => $providerName,
}
);
} }
# Send the request directly # Send the request directly
...@@ -2654,18 +2658,11 @@ sub sendLogoutRequestToProviders { ...@@ -2654,18 +2658,11 @@ sub sendLogoutRequestToProviders {
my ( $self, $req, $logout, $relayState ) = @_; my ( $self, $req, $logout, $relayState ) = @_;
my $server = $self->lassoServer; my $server = $self->lassoServer;
my $providersCount = 0; my $providersCount = 0;
my $info = ''; my $content = '';
# Reset providerID into Lasso::Logout object # Reset providerID into Lasso::Logout object
$self->resetProviderIdIndex($logout); $self->resetProviderIdIndex($logout);
# Header of the block which will be displayed to the user, if needed.
#TODO: Replace this
$info .= '<h3>'
#. $self->msg(Lemonldap::NG::Portal::Simple::PM_SAML_SPLOGOUT) . '</h3>'
. '<table class="sloState">';
# Foreach SP found in session, get it from configuration, and send the # Foreach SP found in session, get it from configuration, and send the
# appropriate logout request (HTTP,POST,SOAP). # appropriate logout request (HTTP,POST,SOAP).
while ( my $providerID = $self->getNextProviderId($logout) ) { while ( my $providerID = $self->getNextProviderId($logout) ) {
...@@ -2682,16 +2679,17 @@ sub sendLogoutRequestToProviders { ...@@ -2682,16 +2679,17 @@ sub sendLogoutRequestToProviders {
# Add information if necessary # Add information if necessary
if ($rinfo) { if ($rinfo) {
$info .= $rinfo; $content .= $rinfo;
} }
} }
# End of information block to be displayed to the user.
$info .= '</table>';
# Print some information to the user. # Print some information to the user.
$req->info($info) if $providersCount; $req->info(
$self->loadTemplate(
'samlSpsLogout', params => { content => $content }
)
) if $providersCount;
return $providersCount; return $providersCount;
} }
......
...@@ -138,6 +138,7 @@ ...@@ -138,6 +138,7 @@
"logout":"تسجيل الخروج", "logout":"تسجيل الخروج",
"logoutConfirm":"هل تريد تسجيل الخروج؟", "logoutConfirm":"هل تريد تسجيل الخروج؟",
"logoutFromOtherApp":"تسجيل الخروج من التطبيقات الأخرى ...", "logoutFromOtherApp":"تسجيل الخروج من التطبيقات الأخرى ...",
"logoutFromSP":"Logout from service providers...",
"mail":"البريد", "mail":"البريد",
"mailSent2":"تم إرسال رسالة إلى عنوان بريدك الإلكتروني.", "mailSent2":"تم إرسال رسالة إلى عنوان بريدك الإلكتروني.",
"maintenanceMode":"هذا التطبيق في صيانة، يرجى محاولة الاتصال في وقت لاحق", "maintenanceMode":"هذا التطبيق في صيانة، يرجى محاولة الاتصال في وقت لاحق",
......
...@@ -138,6 +138,7 @@ ...@@ -138,6 +138,7 @@
"logout":"Logout", "logout":"Logout",
"logoutConfirm":"Do you want to logout?", "logoutConfirm":"Do you want to logout?",
"logoutFromOtherApp":"Logout from other applications...", "logoutFromOtherApp":"Logout from other applications...",
"logoutFromSP":"Logout from service providers...",
"mail":"Mail", "mail":"Mail",
"mailSent2":"A message has been sent to your mail address.", "mailSent2":"A message has been sent to your mail address.",
"maintenanceMode":"This application is in maintenance, please try to connect later", "maintenanceMode":"This application is in maintenance, please try to connect later",
......
...@@ -138,6 +138,7 @@ ...@@ -138,6 +138,7 @@
"logout":"Logout", "logout":"Logout",
"logoutConfirm":"Do you want to logout?", "logoutConfirm":"Do you want to logout?",
"logoutFromOtherApp":"Logout from other applications...", "logoutFromOtherApp":"Logout from other applications...",
"logoutFromSP":"Logout from service providers...",
"mail":"Mail", "mail":"Mail",
"mailSent2":"A message has been sent to your mail address.", "mailSent2":"A message has been sent to your mail address.",
"maintenanceMode":"This application is in maintenance, please try to connect later", "maintenanceMode":"This application is in maintenance, please try to connect later",
......
...@@ -138,6 +138,7 @@ ...@@ -138,6 +138,7 @@
"logout":"Logout", "logout":"Logout",
"logoutConfirm":"Do you want to logout?", "logoutConfirm":"Do you want to logout?",
"logoutFromOtherApp":"Logout from other applications...", "logoutFromOtherApp":"Logout from other applications...",
"logoutFromSP":"Logout from service providers...",
"mail":"Mail", "mail":"Mail",
"mailSent2":"A message has been sent to your mail address.", "mailSent2":"A message has been sent to your mail address.",
"maintenanceMode":"This application is in maintenance, please try to connect later", "maintenanceMode":"This application is in maintenance, please try to connect later",
......
...@@ -138,6 +138,7 @@ ...@@ -138,6 +138,7 @@
"logout":"Déconnexion", "logout":"Déconnexion",
"logoutConfirm":"Souhaitez-vous vous déconnecter ?", "logoutConfirm":"Souhaitez-vous vous déconnecter ?",
"logoutFromOtherApp":"Déconnexion des autres applications...", "logoutFromOtherApp":"Déconnexion des autres applications...",
"logoutFromSP":"Déconnexion des services...",
"mail":"Adresse mail", "mail":"Adresse mail",
"mailSent2":"Un message a été envoyé à votre adresse mail.", "mailSent2":"Un message a été envoyé à votre adresse mail.",
"maintenanceMode":"Cette application est en maintenance, merci de réessayer plus tard", "maintenanceMode":"Cette application est en maintenance, merci de réessayer plus tard",
......
...@@ -138,6 +138,7 @@ ...@@ -138,6 +138,7 @@
"logout":"Logout", "logout":"Logout",
"logoutConfirm":"Vuoi uscire?", "logoutConfirm":"Vuoi uscire?",
"logoutFromOtherApp":"Disconnetti da altre applicazioni ...", "logoutFromOtherApp":"Disconnetti da altre applicazioni ...",
"logoutFromSP":"Logout from service providers...",
"mail":"Mail", "mail":"Mail",
"mailSent2":"Vi é stato inviato un messaggio via mail", "mailSent2":"Vi é stato inviato un messaggio via mail",
"maintenanceMode":"Questa applicazione è in manutenzione, prova a connetterti più tardi", "maintenanceMode":"Questa applicazione è in manutenzione, prova a connetterti più tardi",
......
...@@ -138,6 +138,7 @@ ...@@ -138,6 +138,7 @@
"logout":"Logout", "logout":"Logout",
"logoutConfirm":"Do you want to logout?", "logoutConfirm":"Do you want to logout?",
"logoutFromOtherApp":"Logout from other applications...", "logoutFromOtherApp":"Logout from other applications...",
"logoutFromSP":"Logout from service providers...",
"mail":"Mail", "mail":"Mail",
"mailSent2":"A message has been sent to your mail address.", "mailSent2":"A message has been sent to your mail address.",
"maintenanceMode":"This application is in maintenance, please try to connect later", "maintenanceMode":"This application is in maintenance, please try to connect later",
......
...@@ -138,6 +138,7 @@ ...@@ -138,6 +138,7 @@
"logout":"Logout", "logout":"Logout",
"logoutConfirm":"Do you want to logout?", "logoutConfirm":"Do you want to logout?",
"logoutFromOtherApp":"Logout from other applications...", "logoutFromOtherApp":"Logout from other applications...",
"logoutFromSP":"Logout from service providers...",
"mail":"Mail", "mail":"Mail",
"mailSent2":"A message has been sent to your mail address.", "mailSent2":"A message has been sent to your mail address.",
"maintenanceMode":"This application is in maintenance, please try to connect later", "maintenanceMode":"This application is in maintenance, please try to connect later",
......
...@@ -138,6 +138,7 @@ ...@@ -138,6 +138,7 @@
"logout":"Logout", "logout":"Logout",
"logoutConfirm":"Do you want to logout?", "logoutConfirm":"Do you want to logout?",
"logoutFromOtherApp":"Logout from other applications...", "logoutFromOtherApp":"Logout from other applications...",
"logoutFromSP":"Logout from service providers...",
"mail":"Mail", "mail":"Mail",
"mailSent2":"A message has been sent to your mail address.", "mailSent2":"A message has been sent to your mail address.",
"maintenanceMode":"This application is in maintenance, please try to connect later", "maintenanceMode":"This application is in maintenance, please try to connect later",
......
...@@ -138,6 +138,7 @@ ...@@ -138,6 +138,7 @@
"logout":"Đăng xuất", "logout":"Đăng xuất",
"logoutConfirm":"Bạn có muốn đăng xuất?", "logoutConfirm":"Bạn có muốn đăng xuất?",
"logoutFromOtherApp":"Đăng xuất khỏi các ứng dụng khác ...", "logoutFromOtherApp":"Đăng xuất khỏi các ứng dụng khác ...",
"logoutFromSP":"Logout from service providers...",
"mail":"Thư", "mail":"Thư",
"mailSent2":"Một tin nhắn đã được gửi đến địa chỉ thư của bạn.", "mailSent2":"Một tin nhắn đã được gửi đến địa chỉ thư của bạn.",
"maintenanceMode":"Ứng dụng này đang trong quá trình bảo trì, hãy thử kết nối sau", "maintenanceMode":"Ứng dụng này đang trong quá trình bảo trì, hãy thử kết nối sau",
......
<tr>
<td>
<iframe src="<TMPL_VAR NAME="url">" alt="" marginwidth="0" marginheight="0" scrolling="no" class="noborder" width="10px" height="10px" frameborder="0"></iframe>
</td>
<td>
<TMPL_VAR NAME="name">
</td>
</tr>
<tr>
<td>
<img src="<TMPL_VAR NAME="imgUrl">" width="10px" height="10px" />
</td>
<td>
<TMPL_VAR NAME="name">
</td>
</tr>
<h3 trspan="logoutFromSP"></h3>
<table class="sloState">
<TMPL_VAR NAME="content">
</table>
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment