diff options
author | cash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2011-04-14 00:10:03 +0000 |
---|---|---|
committer | cash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2011-04-14 00:10:03 +0000 |
commit | f8ef86cc4f16f5280ff3475715bc65d0e796cbeb (patch) | |
tree | fa6f11c8e3d151a0aaf847ff85d33ccb1f90550d | |
parent | 95a952861ec1d739dfde43ab6d08f466b2aacb0e (diff) | |
download | elgg-f8ef86cc4f16f5280ff3475715bc65d0e796cbeb.tar.gz elgg-f8ef86cc4f16f5280ff3475715bc65d0e796cbeb.tar.bz2 |
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
-rw-r--r-- | engine/classes/ElggPAM.php | 7 |
1 files changed, 6 insertions, 1 deletions
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) { |