Added new parameter to configure the saml path in authentication setup

(cherry picked from commit 63b19a6a54)
This commit is contained in:
Arturo Gonzalez 2016-09-08 17:36:56 +02:00
parent 7bf1b7c0f2
commit 1d914c4b5b
2 changed files with 10 additions and 2 deletions

View File

@ -357,6 +357,8 @@ function config_update_config () {
$error_update[] = __('User');
if (!config_update_value ('rintegria_pass', io_input_password(get_parameter ('rintegria_pass'))))
$error_update[] = __('Password');
if (!config_update_value ('saml_path', get_parameter ('saml_path')))
$error_update[] = __('Saml path');
if (!config_update_value ('double_auth_enabled', get_parameter ('double_auth_enabled')))
$error_update[] = __('Double authentication');
if (!config_update_value ('session_timeout', get_parameter ('session_timeout')))
@ -1260,6 +1262,10 @@ function config_process_config () {
config_update_value ( 'rintegria_pass', '');
}
if (!isset ($config['saml_path'])) {
config_update_value ('saml_path', '/opt/');
}
if (!isset ($config['integria_enabled'])) {
config_update_value ( 'integria_enabled', '0');
}

View File

@ -297,10 +297,12 @@ if (! isset ($config['id_user'])) {
}
else if (($config['auth'] == 'saml') && ($login_button_saml)) {
include_once(ENTERPRISE_DIR . "/include/auth/saml.php");
$saml_user_id = saml_process_user_login();
$nick_in_db = $saml_user_id;
if (!$nick_in_db) {
require_once('/opt/simplesamlphp/lib/_autoload.php');
require_once($config['saml_path'] . 'simplesamlphp/lib/_autoload.php');
$as = new SimpleSAML_Auth_Simple('PandoraFMS');
$as->logout();
}
@ -517,7 +519,7 @@ if (isset ($_GET["bye"])) {
unset($_SESSION['id_usuario']);
unset($iduser);
if ($config['auth'] == 'saml') {
require_once('/opt/simplesamlphp/lib/_autoload.php');
require_once($config['saml_path'] . 'simplesamlphp/lib/_autoload.php');
$as = new SimpleSAML_Auth_Simple('PandoraFMS');
$as->logout();
}