Merged revisions 47679 via svnmerge from

svn://svn.silverstripe.com/silverstripe/modules/sapphire/branches/2.2.0-mesq

........
  r47679 | ischommer | 2008-01-07 16:38:49 +1300 (Mon, 07 Jan 2008) | 1 line
  
  added unregister_authenticator() and on_unregister()
........


git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@52401 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Ingo Schommer 2008-04-09 11:14:30 +00:00
parent 1c929747ce
commit ddda1dcbb8

View File

@ -96,6 +96,18 @@ abstract class Authenticator extends Object {
return true;
}
/**
* Remove a previously registered authenticator
*
* @param string $authenticator Name of the authenticator class to register
* @return bool Returns TRUE on success, FALSE otherwise.
*/
public static function unregister_authenticator($authenticator) {
if(call_user_func(array($authenticator, 'on_unregister')) === true) {
unset(self::$authenticators[$authenticator]);
};
}
/**
@ -122,7 +134,7 @@ abstract class Authenticator extends Object {
unset(self::$authenticators[$key]);
array_unshift(self::$authenticators, self::$default_authenticator);
}
return self::$authenticators;
}
@ -159,6 +171,15 @@ abstract class Authenticator extends Object {
protected static function on_register() {
return true;
}
/**
* Callback function that is called when an authenticator is removed.
*
* @return bool
*/
protected static function on_unregister() {
return true;
}
}