Minor : fit coding guideline

1.9.x
Kevin LEVRON 12 years ago
parent 1f8fb85d54
commit abbe760c11
  1. 6
      main/auth/cas/authcas.php
  2. 5
      main/inc/local.inc.php

@ -172,14 +172,14 @@ function cas_logout($uinfo=null, $location=null)
{
global $cas_auth_ver, $cas_auth_server, $cas_auth_port, $cas_auth_uri;
global $PHPCAS_CLIENT;
if (!is_object($PHPCAS_CLIENT))
{
if (!is_object($PHPCAS_CLIENT)) {
phpCAS::client($cas_auth_ver, $cas_auth_server, $cas_auth_port, $cas_auth_uri);
phpCAS::setNoCasServerValidation();
}
if (!isset($location))
if (!isset($location)) {
$location = api_get_path(WEB_PATH);
}
phpCAS::logoutWithRedirectService($location);
}

@ -343,10 +343,11 @@ if (!empty($_SESSION['_user']['user_id']) && !($login || $logout)) {
// Fix cas redirection loop
// https://support.chamilo.org/issues/6124
$location = api_get_path(WEB_PATH).'index.php?loginFailed=1&error=access_url_inactive';
if ($cas_login)
if ($cas_login) {
cas_logout(null, $location);
else
} else {
header('Location: '.$location);
}
exit;
}
} else { //Only admins of the "main" (first) Chamilo portal can login wherever they want

Loading…
Cancel
Save