diff -r 5bb565ccfed7 auth/cas/auth.php --- a/auth/cas/auth.php Fri May 14 15:46:55 2010 +0200 +++ b/auth/cas/auth.php Fri May 14 16:41:12 2010 +0200 @@ -88,68 +88,69 @@ class auth_plugin_cas extends auth_plugi * for other authentication */ function loginpage_hook() { - global $frm; - global $CFG; - global $SESSION; + global $frm; + global $CFG; + global $SESSION; - $site = get_site(); - $CASform = get_string("CASform","auth"); - $username = optional_param("username"); + $site = get_site(); + $CASform = get_string("CASform","auth"); + $username = optional_param("username"); - if (!empty($username)) { - if (strstr($SESSION->wantsurl,'ticket') || strstr($SESSION->wantsurl,'NOCAS')) - unset($SESSION->wantsurl); - return; + if (!empty($username)) { + if (strstr($SESSION->wantsurl,'ticket') || strstr($SESSION->wantsurl,'NOCAS')) { + unset($SESSION->wantsurl); + return; + } } + // Test if needed parameters are there + if (empty($this->config->hostname)) { + return; + } - - // Test si cas activ� et param�tres non remplis - if (empty($this->config->hostname)) { - return; - } + // Connection to CAS server + $this->connectCAS(); -// 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="passwdCas"; + return; + } - // Gestion de la connection CAS si acc�s direct d'un ent ou autre - if (phpCAS::checkAuthentication()) { - $frm->username=phpCAS::getUser(); -// if (phpCAS::getUser()=='esup9992') -// $frm->username='erhar0062'; - $frm->password="passwdCas"; - return; - } + if ($_GET["loginguest"]== true) { + $frm->username="guest"; + $frm->password="guest"; + return; + } - if ($_GET["loginguest"]== true) { - $frm->username="guest"; - $frm->password="guest"; - return; - } - - if ($this->config->multiauth) { - $authCAS = optional_param("authCAS"); - if ($authCAS=="NOCAS") - return; + if ($this->config->multiauth) { + $authCAS = optional_param("authCAS"); + if ($authCAS=="NOCAS") { + return; + } -// 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"])) { - $navlinks = array(); - $navlinks[] = array('name' => $CASform, 'link' => null, 'type' => 'misc'); - $navigation = build_navigation($navlinks); + // 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"])) { + $navlinks = array(); + $navlinks[] = array('name' => $CASform, 'link' => null, 'type' => 'misc'); + $navigation = build_navigation($navlinks); - print_header("$site->fullname: $CASform", $site->fullname, $navigation); - include($CFG->dirroot."/auth/cas/cas_form.html"); - print_footer(); - exit(); - } - } -// CAS authentication - if (!phpCAS::isAuthenticated()) - {phpCAS::forceAuthentication();} -} + print_header("$site->fullname: $CASform", $site->fullname, $navigation); + include($CFG->dirroot."/auth/cas/cas_form.html"); + print_footer(); + exit(); + } + } + + // CAS authentication + if (!phpCAS::isAuthenticated()) { + phpCAS::forceAuthentication(); + } + } + /** * logout from the cas *