From f8ef86cc4f16f5280ff3475715bc65d0e796cbeb Mon Sep 17 00:00:00 2001 From: cash Date: Thu, 14 Apr 2011 00:10:03 +0000 Subject: checking that PAM handlers have been registered for the policy being tested (hellekin) git-svn-id: http://code.elgg.org/elgg/trunk@8988 36083f99-b078-4883-b0ff-0f9b5a30f544 --- engine/classes/ElggPAM.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'engine') diff --git a/engine/classes/ElggPAM.php b/engine/classes/ElggPAM.php index 37436fba3..0681a909b 100644 --- a/engine/classes/ElggPAM.php +++ b/engine/classes/ElggPAM.php @@ -41,9 +41,14 @@ class ElggPAM { * @param array $credentials Credentials array dependant on policy type * @return bool */ - public function authenticate($credentials) { + public function authenticate($credentials = array()) { global $_PAM_HANDLERS; + if (!isset($_PAM_HANDLERS[$this->policy]) || + !is_array($_PAM_HANDLERS[$this->policy])) { + return false; + } + $authenticated = false; foreach ($_PAM_HANDLERS[$this->policy] as $k => $v) { -- cgit v1.2.3