]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
checking that PAM handlers have been registered for the policy being tested (hellekin)
authorcash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>
Thu, 14 Apr 2011 00:10:03 +0000 (00:10 +0000)
committercash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>
Thu, 14 Apr 2011 00:10:03 +0000 (00:10 +0000)
git-svn-id: http://code.elgg.org/elgg/trunk@8988 36083f99-b078-4883-b0ff-0f9b5a30f544

engine/classes/ElggPAM.php

index 37436fba3d841c8d8b632e7c6d6ce397549630a8..0681a909be94782c66b64f2a7b0191b301281454 100644 (file)
@@ -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) {