fixed sso authentication

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

@ -154,9 +154,12 @@ class sso {
api_session_register('_user');
event_login();
// 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);
exit;
exit;
}
} else {
// user account expired

@ -454,10 +454,12 @@ if (!empty($_SESSION['_user']['user_id']) && ! ($login || $logout)) {
// Redirect to master server
$osso->ask_master();
} 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
//if the user exists (delegated to the sso class)
$osso->check_user();
$osso->check_user();
} else {
//Request comes from unknown source
$loginFailed = true;

Loading…
Cancel
Save