diff --git a/security/Authenticator.php b/security/Authenticator.php index f95f5cc29..a643c38bc 100644 --- a/security/Authenticator.php +++ b/security/Authenticator.php @@ -66,6 +66,8 @@ abstract class Authenticator extends Object { * {@link Authenticator}. * Every authenticator can be registered only once. * + * @param string $authenticator Name of the authenticator class to + * register * @return bool Returns TRUE on success, FALSE otherwise. */ public static function register_authenticator($authenticator) { @@ -89,6 +91,18 @@ abstract class Authenticator extends Object { } + /** + * Check if a given authenticator is registered + * + * @param string $authenticator Name of the authenticator class to check + * @return bool Returns TRUE if the authenticator is registered, FALSE + * otherwise. + */ + public static function is_registered($authenticator) { + return in_array($authenticator, self::$authenticators); + } + + /** * Get all registered authenticators *