From 2965a981b7ec22866fbdf2d567d87e2d068d3617 Mon Sep 17 00:00:00 2001
From: Thomas Bruederli <thomas@roundcube.net>
Date: Fri, 31 Jul 2015 16:04:08 -0400
Subject: [PATCH] Allow to search and import missing PGP pubkeys from keyservers using Publickey.js
---
plugins/password/drivers/ldap.php | 9 +++------
1 files changed, 3 insertions(+), 6 deletions(-)
diff --git a/plugins/password/drivers/ldap.php b/plugins/password/drivers/ldap.php
index c18ff0f..6ed5ada 100644
--- a/plugins/password/drivers/ldap.php
+++ b/plugins/password/drivers/ldap.php
@@ -75,7 +75,7 @@
$ldap = Net_LDAP2::connect($ldapConfig);
// Checking for connection error
- if (PEAR::isError($ldap)) {
+ if (is_a($ldap, 'PEAR_Error')) {
return PASSWORD_CONNECT_ERROR;
}
@@ -176,7 +176,7 @@
$ldap = Net_LDAP2::connect($ldapConfig);
- if (PEAR::isError($ldap)) {
+ if (is_a($ldap, 'PEAR_Error')) {
return '';
}
@@ -189,7 +189,7 @@
$result = $ldap->search($base, $filter, $options);
$ldap->done();
- if (PEAR::isError($result) || ($result->count() != 1)) {
+ if (is_a($result, 'PEAR_Error') || ($result->count() != 1)) {
return '';
}
@@ -289,7 +289,6 @@
break;
case 'ssha':
- mt_srand((double) microtime() * 1000000);
$salt = substr(pack('h*', md5(mt_rand())), 0, 8);
if (function_exists('mhash') && function_exists('mhash_keygen_s2k')) {
@@ -316,7 +315,6 @@
case 'smd5':
- mt_srand((double) microtime() * 1000000);
$salt = substr(pack('h*', md5(mt_rand())), 0, 8);
if (function_exists('mhash') && function_exists('mhash_keygen_s2k')) {
@@ -373,7 +371,6 @@
{
$possible = '0123456789' . 'abcdefghijklmnopqrstuvwxyz' . 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' . './';
$str = '';
- // mt_srand((double)microtime() * 1000000);
while (strlen($str) < $length) {
$str .= substr($possible, (rand() % strlen($possible)), 1);
--
Gitblit v1.9.1