From 209596cb6af65080f26ec40b27fdf76ed6110035 Mon Sep 17 00:00:00 2001 From: jgutierr25 Date: Tue, 5 Jun 2007 08:35:57 +0000 Subject: [PATCH] automatic authentication when direct access from another CAS application and multiauth --- auth/cas/auth.php | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/auth/cas/auth.php b/auth/cas/auth.php index 115e21a98e..3d59728096 100644 --- a/auth/cas/auth.php +++ b/auth/cas/auth.php @@ -92,8 +92,17 @@ class auth_plugin_cas extends auth_plugin_base { if (!empty($username)) { return; } + // Connection to CAS server $this->connectCAS(); + + // Gestion de la connection CAS si accès direct d'un ent ou autre + if (phpCAS::checkAuthentication()) { + $frm->username=phpCAS::getUser(); + $frm->password="cas"; + return; + } + if ($this->config->multiauth) { $authCAS = optional_param("authCAS"); if ($authCAS=="NOCAS") @@ -102,19 +111,16 @@ class auth_plugin_cas extends auth_plugin_base { // choice authentication form for multi-authentication // test pgtIou parameter for proxy mode (https connection // in background from CAS server to the php server) - if ($authCAS!="CAS" && !isset($_GET["pgtIou"])) - { + if ($authCAS!="CAS" && !isset($_GET["pgtIou"])) { print_header("$site->fullname: $CASform", $site->fullname, $CASform); include($CFG->dirroot."/auth/cas/cas_form.html"); print_footer(); exit(); - } + } } // CAS authentication if (!phpCAS::isAuthenticated()) {phpCAS::forceAuthentication();} - $frm->username=phpCAS::getUser(); - $frm->password="cas"; } /** * logout from the cas -- 2.39.5