fixed sso authentication

skala
Christian Fasanando 15 years ago
parent 9790d83c10
commit c6eaa11890
  1. 5
      main/auth/sso/sso.class.php
  2. 4
      main/inc/local.inc.php

@ -154,7 +154,10 @@ class sso {
api_session_register('_user'); api_session_register('_user');
event_login(); event_login();
// Redirect to homepage // Redirect to homepage
$sso_target = isset($sso['target']) ? $sso['target'] : api_get_path(WEB_PATH) .'.index.php'; $protocol = api_get_setting('sso_authentication_protocol');
$master_url = api_get_setting('sso_authentication_domain');
$target = $protocol.$master_url;
$sso_target = isset($target) ? $target : api_get_path(WEB_PATH) .'.index.php';
header('Location: '. $sso_target); header('Location: '. $sso_target);
exit; exit;
} }

@ -454,7 +454,9 @@ if (!empty($_SESSION['_user']['user_id']) && ! ($login || $logout)) {
// Redirect to master server // Redirect to master server
$osso->ask_master(); $osso->ask_master();
} elseif (isset($_GET['sso_cookie'])) { } elseif (isset($_GET['sso_cookie'])) {
if (isset($_GET['sso_referer']) ? $_GET['sso_referer'] === $master['protocol']. $master_url : FALSE) { $protocol = api_get_setting('sso_authentication_protocol');
$master_url = api_get_setting('sso_authentication_domain').api_get_setting('sso_authentication_auth_uri');
if (isset($_GET['sso_referer']) ? $_GET['sso_referer'] === $protocol.$master_url : FALSE) {
//make all the process of checking //make all the process of checking
//if the user exists (delegated to the sso class) //if the user exists (delegated to the sso class)
$osso->check_user(); $osso->check_user();

Loading…
Cancel
Save