Extension talk:CASAuthentication

Hello,

I've had some difficulties having your extension redirect to our cas server so I changed a condition. Moreover, we previously used ldap plugin as auth backend and would prefer to keep it active as backend (if our cas server crashed, we would need the documentation in the wiki ;-)

Here's a small patch about this :

19d18 < 33c32 < $wgHooks['UserLoginForm'][] = 'CASOverrideLoginPage'; --- > #$wgHooks['UserLoginForm'][] = 'CASOverrideLoginPage'; 90,93c89,91 < <    if (isset($_REQUEST['title'])) { <        if ($_REQUEST['title'] == 'Special:UserLogin') { <            # Initialise common code --- > >     if ( $_SESSION['wsUserName'] == NULL && $_REQUEST['title'] != 'Special:Connexion') { > 102a101 > 107c106 < --- > 132c131 <                      $user = $u; --- >          $user = $u; 134,136c133,135 <         } else     if ($_REQUEST['title'] == 'Special:Userlogout') { <            phpCAS::logout; <        } --- > #        } else     if ($_REQUEST['title'] == 'Special:Userlogout') { > #           phpCAS::logout; > #      }

Regards,

Mikael Kermorgant

Confusion Regarding Require Statements
I think you need to be more specific regarding the two conflicting require_once statements:

require_once( $IP."/extensions/CASAuth/CASAuth.php" );

vs.

require_once( $IP."/extensions/CASAuthentication/CASAuth.php" );

Also... what is this supposed to mean?

$_phpCasPath = "$IP/extensions/CASAuth/CAS";

Log-out problems
I found that log-outs were not fully successful as they left MediaWiki with a still-intact session after phpCAS::logout was called. Making the following change to the extension causes MediaWiki to go through its full logout process and then call the casLogout function via its UserLogoutComplete hook.

143,147c143,145 <        } else if ($_REQUEST['title'] == $lg->specialPage('Userlogout')) { <            //needed to logout <            phpCAS::client($_phpCASVersion,$_phpCASURL,$_phpCASPort,$_phpCASURLsub); <            phpCAS::logout; <        } --- >         } else if ($_REQUEST['title'] == $lg->specialPage('Userlogout')) { >            $user->logout; >        }

--Adamfranco 18:59, 6 May 2009 (UTC)