aboutsummaryrefslogtreecommitdiff
path: root/engine
diff options
context:
space:
mode:
authorcash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-11-15 02:43:54 +0000
committercash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-11-15 02:43:54 +0000
commit481a5ecfe6b17836d47b8c89eabf346f941bbc3b (patch)
tree8ac3ce6d4ef99b0365b715f311362987eee2d783 /engine
parentf912c8e793ba1140dab7507c21afc3d917d815d7 (diff)
downloadelgg-481a5ecfe6b17836d47b8c89eabf346f941bbc3b.tar.gz
elgg-481a5ecfe6b17836d47b8c89eabf346f941bbc3b.tar.bz2
Fixes #1417 Users get notified when their accounts are not validated for any authentication attempt
git-svn-id: http://code.elgg.org/elgg/trunk@7319 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine')
-rw-r--r--engine/classes/ElggPAM.php5
-rw-r--r--engine/lib/pam.php6
2 files changed, 8 insertions, 3 deletions
diff --git a/engine/classes/ElggPAM.php b/engine/classes/ElggPAM.php
index a3e4f9a77..37436fba3 100644
--- a/engine/classes/ElggPAM.php
+++ b/engine/classes/ElggPAM.php
@@ -52,9 +52,10 @@ class ElggPAM {
try {
// Execute the handler
- if ($handler($credentials)) {
+ $result = $handler($credentials);
+ if ($result) {
$authenticated = true;
- } else {
+ } elseif ($result === false) {
if ($importance == 'required') {
$this->messages['required'][] = "$handler:failed";
return false;
diff --git a/engine/lib/pam.php b/engine/lib/pam.php
index f1df3feba..f6db28355 100644
--- a/engine/lib/pam.php
+++ b/engine/lib/pam.php
@@ -25,12 +25,16 @@ $_PAM_HANDLERS = array();
/**
* Register a PAM handler.
*
+ * A PAM handler should return true if the authentication attempt passed. For a
+ * 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
* pam_handler($credentials = NULL);
* @param string $importance The importance - "sufficient" (default) or "required"
* @param string $policy The policy type, default is "user"
*
- * @return boolean
+ * @return bool
*/
function register_pam_handler($handler, $importance = "sufficient", $policy = "user") {
global $_PAM_HANDLERS;