From 60b36477c52446f6003d702a7413fa791389ce25 Mon Sep 17 00:00:00 2001 From: Michael M Slusarz Date: Thu, 15 Oct 2009 05:37:58 -0600 Subject: [PATCH] Horde_Auth_Application improvements. Add getCredential(). Pass auth instance to application's transparent handler. --- framework/Auth/lib/Horde/Auth/Application.php | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/framework/Auth/lib/Horde/Auth/Application.php b/framework/Auth/lib/Horde/Auth/Application.php index 00e56e2bf..47798e97e 100644 --- a/framework/Auth/lib/Horde/Auth/Application.php +++ b/framework/Auth/lib/Horde/Auth/Application.php @@ -234,7 +234,8 @@ class Horde_Auth_Application extends Horde_Auth_Base } /** - * Attempt transparent authentication. + * Attempt transparent authentication. The application method is passed a + * single parameter: the current class instance. * * @return boolean Whether transparent login is supported. * @throws Horde_Auth_Exception @@ -250,7 +251,7 @@ class Horde_Auth_Application extends Horde_Auth_Base } $registry = Horde_Registry::singleton(); - return $registry->callAppMethod($this->_app, $this->_apiMethods['transparent'], array('noperms' => true)); + return $registry->callAppMethod($this->_app, $this->_apiMethods['transparent'], array('args' => array($this), 'noperms' => true)); } /** @@ -293,6 +294,28 @@ class Horde_Auth_Application extends Horde_Auth_Base } /** + * Provide method to get internal credential values. Necessary as the + * application API does not have direct access to the protected member + * variables of this class. + * + * @param mixed $name The credential name to get. If null, will return + * the entire credential list. + * + * @return mixed Return the credential information, or null if the. + * credential doesn't exist. + */ + public function getCredential($name = null) + { + if (is_null($name)) { + return $this->_credentials; + } + + return isset($this->_credentials[$name]) + ? $this->_credentials[$name] + : null; + } + + /** * Provide method to set internal credential values. Necessary as the * application API does not have direct access to the protected member * variables of this class. -- 2.11.0