Skip to content

Commit ab217e4

Browse files
committed
use the filter for saml_metadata
1 parent 45979e0 commit ab217e4

2 files changed

Lines changed: 6 additions & 4 deletions

File tree

onelogin-saml-sso/onelogin_saml.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ function disable_password_reset() { return false; }
3939
$action = isset($_REQUEST['action']) ? $_REQUEST['action'] : 'login';
4040

4141
// Handle SLO
42-
if (isset($_COOKIE['saml_login']) && get_option('onelogin_saml_slo')) {
42+
if (isset($_COOKIE['saml_login']) && get_option('onelogin_saml_slo')) {
4343
add_action('init', 'saml_slo', 1);
4444
}
4545

@@ -48,7 +48,8 @@ function disable_password_reset() { return false; }
4848
add_action('init', 'saml_sso', 1);
4949
} else {
5050
$execute_sso = false;
51-
$saml_actions = isset($_GET['saml_metadata']) || (strpos($_SERVER['SCRIPT_NAME'], 'alternative_acs.php') !== FALSE);
51+
$saml_metadata = apply_filters( 'onelogin_saml_metadata', 'saml_metadata' );
52+
$saml_actions = isset($_GET[ $saml_metadata ]) || (strpos($_SERVER['SCRIPT_NAME'], 'alternative_acs.php') !== FALSE);
5253

5354
$wp_login_page = (strpos($_SERVER['SCRIPT_NAME'], 'wp-login.php') !== FALSE) && $action == 'login' && !isset($_GET['loggedout']);
5455

@@ -69,7 +70,7 @@ function disable_password_reset() { return false; }
6970
} else if ($local_wp_actions) {
7071
$prevent_local_login = get_option('onelogin_saml_customize_action_prevent_local_login', false);
7172

72-
if (($want_to_local_login && $prevent_local_login) || ($want_to_reset && $prevent_reset_password)) {
73+
if (($want_to_local_login && $prevent_local_login) || ($want_to_reset && $prevent_reset_password)) {
7374
$execute_sso = True;
7475
}
7576
}

onelogin-saml-sso/php/configuration.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,15 @@
1313

1414
function onelogin_saml_configuration_render() {
1515
$title = __("SSO/SAML Settings", 'onelogin-saml-sso');
16+
$saml_metadata = apply_filters( 'onelogin_saml_metadata', 'saml_metadata' );
1617
?>
1718
<div class="wrap">
1819
<?php screen_icon(); ?>
1920
<div class="alignleft">
2021
<a href="http://www.onelogin.com"><img src="<?php echo plugins_url('onelogin.png', dirname(__FILE__));?>"></a>
2122
</div>
2223
<div class="alignright">
23-
<a href="<?php echo get_site_url().'/wp-login.php?saml_metadata'; ?>" target="blank"><?php echo __("Go to the metadata of this SP", 'onelogin-saml-sso');?></a><br>
24+
<a href="<?php echo get_site_url( null, '/wp-login.php?' . $saml_metadata ); ?>" target="blank"><?php echo __("Go to the metadata of this SP", 'onelogin-saml-sso');?></a><br>
2425
<a href="<?php echo get_site_url().'/wp-login.php?saml_validate_config'; ?>" target="blank"><?php echo __("Once configured, validate here your OneLogin SSO/SAML Settings", 'onelogin-saml-sso');?></a>
2526
</div>
2627
<div style="clear:both"></div>

0 commit comments

Comments
 (0)