Add 'takeOverLogin' parameter for a real SSO feel

This commit is contained in:
Craig Andrews 2010-01-04 14:43:05 -05:00
parent bcddcb38ce
commit c0e4d7bfa2
2 changed files with 14 additions and 1 deletions

View File

@ -40,6 +40,7 @@ class CasAuthenticationPlugin extends AuthenticationPlugin
public $server;
public $port = 443;
public $path = '';
public $takeOverLogin = false;
function checkPassword($username, $password)
{
@ -62,6 +63,14 @@ class CasAuthenticationPlugin extends AuthenticationPlugin
}
}
function onArgsInitialize(&$args)
{
if($this->takeOverLogin && $args['action'] == 'login')
{
$args['action'] = 'caslogin';
}
}
function onStartInitializeRouter($m)
{
$m->connect('main/cas', array('action' => 'caslogin'));

View File

@ -21,6 +21,9 @@ password_changeable*: must be set to false. This plugin does not support changin
server*: CAS server to authentication against
port (443): Port the CAS server listens on. Almost always 443
path (): Path on the server to CAS. Usually blank.
takeOverLogin (false): Take over the main login action. If takeOverLogin is
set, anytime the standard username/password login form would be shown,
a CAS login will be done instead.
* required
default values are in (parenthesis)
@ -33,6 +36,7 @@ addPlugin('casAuthentication', array(
'autoregistration'=>true,
'server'=>'sso-cas.univ-rennes1.fr',
'port'=>443,
'path'=>''
'path'=>'',
'takeOverLogin'=>true
));