aboutsummaryrefslogtreecommitdiff
path: root/engine/lib/pam.php
diff options
context:
space:
mode:
authorSteve Clay <steve@mrclay.org>2012-09-17 17:41:15 -0400
committerSteve Clay <steve@mrclay.org>2012-11-14 21:09:42 -0500
commit3048db0f3f1ade31d6f3a2cdd3268e978a3e3cf3 (patch)
tree1c21fd8f55bebeeedf4790aaa0e5e2f76e3a93eb /engine/lib/pam.php
parent7c6e3578ca8ab3e703852629e82b478265833d29 (diff)
downloadelgg-3048db0f3f1ade31d6f3a2cdd3268e978a3e3cf3.tar.gz
elgg-3048db0f3f1ade31d6f3a2cdd3268e978a3e3cf3.tar.bz2
Fixes #4861: allow lazy-loading for static method callbacks, allow more callables
Diffstat (limited to 'engine/lib/pam.php')
-rw-r--r--engine/lib/pam.php7
1 files changed, 5 insertions, 2 deletions
diff --git a/engine/lib/pam.php b/engine/lib/pam.php
index 4f9f44278..1c9c3bfe1 100644
--- a/engine/lib/pam.php
+++ b/engine/lib/pam.php
@@ -30,7 +30,9 @@ $_PAM_HANDLERS = array();
* failure, return false or throw an exception. Returning nothing indicates that
* the handler wants to be skipped.
*
- * @param string $handler The handler function in the format
+ * Note, $handler must be string callback (not an array/Closure).
+ *
+ * @param string $handler Callable global handler function in the format ()
* pam_handler($credentials = NULL);
* @param string $importance The importance - "sufficient" (default) or "required"
* @param string $policy The policy type, default is "user"
@@ -45,7 +47,8 @@ function register_pam_handler($handler, $importance = "sufficient", $policy = "u
$_PAM_HANDLERS[$policy] = array();
}
- if (is_callable($handler)) {
+ // @todo remove requirement that $handle be a global function
+ if (is_string($handler) && is_callable($handler, true)) {
$_PAM_HANDLERS[$policy][$handler] = new stdClass;
$_PAM_HANDLERS[$policy][$handler]->handler = $handler;