Changes to work with debian/ubuntu based php-pam auth libraries
authorMichael Rubinsky <mrubinsk@simon.horde.org>
Thu, 19 Nov 2009 17:14:54 +0000 (17:14 +0000)
committerMichael Rubinsky <mrubinsk@simon.horde.org>
Thu, 19 Nov 2009 17:16:34 +0000 (17:16 +0000)
framework/Auth/lib/Horde/Auth/Pam.php

index f1d7ae9..0d16aaf 100644 (file)
@@ -37,12 +37,13 @@ class Horde_Auth_Pam extends Horde_Auth_Base
      */
     public function __construct($params = array())
     {
-        if (!Horde_Util::extensionExists('pam')) {
+        if (!Horde_Util::extensionExists('pam_auth') && !Horde_Util::extensionExists('pam')) {
             throw new Horde_Auth_Exception(_("PAM authentication is not available."));
         }
 
         if (!empty($params['service'])) {
             ini_set('pam.servicename', $params['service']);
+            ini_set('pam_auth.servicename', $params['service']);
         }
 
         parent::__construct($params);
@@ -63,7 +64,7 @@ class Horde_Auth_Pam extends Horde_Auth_Base
         }
 
         $error = null;
-        if (!pam_auth($userId, $credentials['password'], $error)) {
+        if (!pam_auth($userId, $credentials['password'], &$error)) {
             throw new Horde_Auth_Exception($error);
         }
     }