mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
ENHANCEMENT added Authenticator::$default_authenticator to enable modifying the tab-order
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@44381 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
8b1ef652d7
commit
66ecc4e75e
@ -26,6 +26,7 @@ set_include_path(get_include_path() . PATH_SEPARATOR . $path);
|
||||
* Register the {@link OpenIDAuthenticator OpenID authenticator}
|
||||
*/
|
||||
Authenticator::register_authenticator('MemberAuthenticator');
|
||||
Authenticator::set_default_authenticator('MemberAuthenticator');
|
||||
|
||||
/**
|
||||
* Define a default language different than english
|
||||
|
@ -1,13 +1,4 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Authenticator base class
|
||||
*
|
||||
* @author Markus Lanthaler <markus@silverstripe.com>
|
||||
*/
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Abstract base class for an authentication method
|
||||
*
|
||||
@ -24,6 +15,14 @@ abstract class Authenticator extends Object {
|
||||
* @var array
|
||||
*/
|
||||
private static $authenticators = array();
|
||||
|
||||
/**
|
||||
* Used to influence the order of authenticators on the login-screen
|
||||
* (default shows first).
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
private static $default_authenticator = '';
|
||||
|
||||
|
||||
/**
|
||||
@ -110,8 +109,32 @@ abstract class Authenticator extends Object {
|
||||
* authenticators.
|
||||
*/
|
||||
public static function get_authenticators() {
|
||||
// put default authenticator first (mainly for tab-order on loginform)
|
||||
if($key = array_search(self::$default_authenticator,self::$authenticators)) {
|
||||
unset(self::$authenticators[$key]);
|
||||
array_unshift(self::$authenticators, self::$default_authenticator);
|
||||
}
|
||||
|
||||
return self::$authenticators;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set a default authenticator (shows first in tabs)
|
||||
*
|
||||
* @param string
|
||||
*/
|
||||
public static function set_default_authenticator($authenticator) {
|
||||
self::$default_authenticator = $authenticator;
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public static function get_default_authenticator() {
|
||||
return self::$default_authenticator;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user